Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit a8df4e6

Browse files
authored
Merge branch 'master' into feature/pr-conversation
2 parents abce76d + 9b9a90a commit a8df4e6

File tree

9 files changed

+91
-29
lines changed

9 files changed

+91
-29
lines changed

appveyor.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ os: Visual Studio 2017
22
version: '2.8.0.{build}'
33
skip_tags: true
44

5-
environment:
6-
matrix:
7-
- BUILD_TYPE: normal
8-
95
install:
106
- choco install --no-progress BCC-MSBuildLog
117
- choco install --no-progress BCC-Submission
128
- ps: |
139
$full_build = Test-Path env:GHFVS_KEY
1410
$forVSInstaller = $env:BUILD_TYPE -eq "vsinstaller"
15-
$package = $full_build -and ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_BRANCH -eq "master" -or $forVSInstaller -or $env:BUILD_TYPE -eq "package")
11+
$forPackage = $env:BUILD_TYPE -eq "package"
12+
$package = $full_build -and ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $forVSInstaller -or $forPackage)
1613
1714
$message = "Building "
1815
if ($package) { $message += "and packaging "}
@@ -53,12 +50,25 @@ on_success:
5350
}
5451
5552
for:
53+
-
54+
branches:
55+
except:
56+
- /releases/.*-vsinstaller/
57+
environment:
58+
matrix:
59+
- BUILD_TYPE: normal
5660
-
5761
branches:
5862
only:
5963
- /releases/.*-vsinstaller/
60-
- master
6164
environment:
6265
matrix:
6366
- BUILD_TYPE: package
6467
- BUILD_TYPE: vsinstaller
68+
-
69+
branches:
70+
only:
71+
- master
72+
environment:
73+
matrix:
74+
- BUILD_TYPE: package

azure-pipelines.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@ steps:
4848
platform: '$(buildPlatform)'
4949
configuration: '$(buildConfiguration)'
5050

51-
# VSTest is hanging. Skip tests for now; we're still running Appveyor which will handle the tests.
52-
#- task: VSTest@2
53-
# inputs:
54-
# searchFolder: '$(Build.SourcesDirectory)\test'
55-
# testAssemblyVer2: '**\bin\**\*Tests.dll'
56-
# platform: '$(buildPlatform)'
57-
# configuration: '$(buildConfiguration)'
58-
# diagnosticsEnabled: true
59-
# runSettingsFile: '$(Build.SourcesDirectory)\test\test.runsettings'
51+
- task: VSTest@2
52+
inputs:
53+
searchFolder: '$(Build.SourcesDirectory)\test'
54+
testAssemblyVer2: '**\bin\**\*Tests.dll'
55+
platform: '$(buildPlatform)'
56+
configuration: '$(buildConfiguration)'
57+
diagnosticsEnabled: true
58+
runSettingsFile: '$(Build.SourcesDirectory)\test\test.runsettings'
6059

6160
- task: PublishBuildArtifacts@1
6261
inputs:

docs/using/publishing-an-existing-project-to-github.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
5. Click the **Publish to GitHub** button.
1111
![Location of the Publish to GitHub button in the Team Explorer pane](images/publish-to-github.png)
1212
6. Enter a name and description for the repository on GitHub.
13-
7. Check the **Private Repository** box if you want to upload the repository as a private repository on GitHub. You must have a [Developer, Team or Business account](https://github.com/pricing) to create private repositories.
13+
7. Check the **Private Repository** box if you want to upload the repository as a private repository on GitHub.
1414
8. Click the **Publish** button.

src/GitHub.App/ViewModels/Dialog/Clone/RepositorySelectViewModel.cs

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContext
5050

5151
var filterRepository = this.WhenAnyValue(x => x.Filter)
5252
.Select(f => gitHubContextService.FindContextFromUrl(f))
53-
.Where(c => c?.LinkType == LinkType.Repository)
54-
.Select(c => new RepositoryModel(c.RepositoryName, c.Url));
53+
.Select(CreateRepository);
5554

5655
repository = selectedRepository
5756
.Merge(filterRepository)
@@ -179,14 +178,21 @@ bool FilterItem(object obj)
179178
{
180179
if (obj is IRepositoryItemViewModel item && !string.IsNullOrWhiteSpace(Filter))
181180
{
182-
var urlString = item.Url.ToString();
183-
var urlStringWithGit = urlString + ".git";
184-
var urlStringWithSlash = urlString + "/";
185-
return
186-
item.Caption.Contains(Filter, StringComparison.CurrentCultureIgnoreCase) ||
187-
urlString.Contains(Filter, StringComparison.OrdinalIgnoreCase) ||
188-
urlStringWithGit.Contains(Filter, StringComparison.OrdinalIgnoreCase) ||
189-
urlStringWithSlash.Contains(Filter, StringComparison.OrdinalIgnoreCase);
181+
if (new UriString(Filter).IsHypertextTransferProtocol)
182+
{
183+
var urlString = item.Url.ToString();
184+
var urlStringWithGit = urlString + ".git";
185+
var urlStringWithSlash = urlString + "/";
186+
return
187+
urlString.Contains(Filter, StringComparison.OrdinalIgnoreCase) ||
188+
urlStringWithGit.Contains(Filter, StringComparison.OrdinalIgnoreCase) ||
189+
urlStringWithSlash.Contains(Filter, StringComparison.OrdinalIgnoreCase);
190+
}
191+
else
192+
{
193+
return
194+
item.Caption.Contains(Filter, StringComparison.CurrentCultureIgnoreCase);
195+
}
190196
}
191197

192198
return true;
@@ -198,5 +204,17 @@ RepositoryModel CreateRepository(IRepositoryItemViewModel item)
198204
new RepositoryModel(item.Name, UriString.ToUriString(item.Url)) :
199205
null;
200206
}
207+
208+
RepositoryModel CreateRepository(GitHubContext context)
209+
{
210+
switch (context?.LinkType)
211+
{
212+
case LinkType.Repository:
213+
case LinkType.Blob:
214+
return new RepositoryModel(context.RepositoryName, context.Url);
215+
}
216+
217+
return null;
218+
}
201219
}
202220
}

src/GitHub.TeamFoundation.14/Services/VSGitServices.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,22 @@ public async Task Clone(
8686
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
8787
await WaitForCloneOnHomePageAsync(teamExplorer);
8888
#elif TEAMEXPLORER15 || TEAMEXPLORER16
89+
// IGitActionsExt is proffered by SccProviderPackage, but isn't advertised.
90+
// To ensure that getting IGitActionsExt doesn't return null, we first request the
91+
// IGitExt service which is advertised. This forces SccProviderPackage to load
92+
// and proffer IGitActionsExt.
93+
var gitExt = serviceProvider.GetService(typeof(IGitExt));
94+
Assumes.NotNull(gitExt);
95+
var gitActionsExt = serviceProvider.GetService<IGitActionsExt>();
96+
Assumes.NotNull(gitActionsExt);
97+
8998
// The progress parameter uses the ServiceProgressData type which is defined in
9099
// Microsoft.VisualStudio.Shell.Framework. Referencing this assembly directly
91100
// would cause type conflicts, so we're using reflection to call CloneAsync.
92-
var gitExt = serviceProvider.GetService<IGitActionsExt>();
93101
var cloneAsyncMethod = typeof(IGitActionsExt).GetMethod(nameof(IGitActionsExt.CloneAsync));
94102
Assumes.NotNull(cloneAsyncMethod);
95103
var cloneParameters = new object[] { cloneUrl, clonePath, recurseSubmodules, cancellationToken, progress };
96-
var cloneTask = (Task)cloneAsyncMethod.Invoke(gitExt, cloneParameters);
104+
var cloneTask = (Task)cloneAsyncMethod.Invoke(gitActionsExt, cloneParameters);
97105

98106
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
99107
await cloneTask;

test/GitHub.App.UnitTests/ViewModels/Dialog/Clone/RepositorySelectViewModelTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class TheFilterProperty
2626
[TestCase("https://github.com/jcansdale/TestDriven.Net", "owner", "name", "https://github.com/jcansdale/TestDriven.Net-issues", 1)]
2727
[TestCase("https://github.com/owner/name/", "owner", "name", "https://github.com/owner/name", 1, Description = "Trailing slash")]
2828
[TestCase("https://github.com/owner/name.git", "owner", "name", "https://github.com/owner/name", 1, Description = "Trailing .git")]
29+
[TestCase("github.com", "owner", "name", "https://github.com/owner/name", 0, Description = "Don't include host name in search")]
2930
public async Task Filter(string filter, string owner, string name, string url, int expectCount)
3031
{
3132
var contributedToRepositories = new[]
@@ -57,6 +58,8 @@ public async Task Filter(string filter, string owner, string name, string url, i
5758
[TestCase("filter", null)]
5859
[TestCase("https://github.com", null)]
5960
[TestCase("https://github.com/github/VisualStudio", "https://github.com/github/VisualStudio")]
61+
[TestCase("https://github.com/github/VisualStudio/blob/master/README.md", "https://github.com/github/VisualStudio/blob/master/README.md")]
62+
[TestCase("https://github.com/github/VisualStudio/pull/2208", null)]
6063
public void Set_Repository_When_Filter_Is_Url(string url, string expectUrl)
6164
{
6265
var expectCloneUrl = expectUrl != null ? new UriString(expectUrl) : null;
@@ -69,6 +72,24 @@ public void Set_Repository_When_Filter_Is_Url(string url, string expectUrl)
6972

7073
Assert.That(target.Repository?.CloneUrl, Is.EqualTo(expectCloneUrl));
7174
}
75+
76+
[TestCase("filter;https://github.com/github/VisualStudio", "https://github.com/github/VisualStudio")]
77+
[TestCase("https://github.com/github/VisualStudio;filter", null)]
78+
public void Change_Filters(string filters, string expectUrl)
79+
{
80+
var expectCloneUrl = expectUrl != null ? new UriString(expectUrl) : null;
81+
var repositoryCloneService = CreateRepositoryCloneService();
82+
var gitHubContextService = new GitHubContextService(Substitute.For<IGitHubServiceProvider>(),
83+
Substitute.For<IGitService>(), Substitute.For<IVSServices>());
84+
var target = new RepositorySelectViewModel(repositoryCloneService, gitHubContextService);
85+
86+
foreach (var filter in filters.Split(';'))
87+
{
88+
target.Filter = filter;
89+
}
90+
91+
Assert.That(target.Repository?.CloneUrl, Is.EqualTo(expectCloneUrl));
92+
}
7293
}
7394

7495
static IGitHubContextService CreateGitHubContextService()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using NUnit.Framework;
2+
3+
[assembly: Timeout(10000)] // Set a 10 second timeout for all tests

test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionManagerTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ Line 2
445445
}
446446

447447
[Test, NUnit.Framework.Category("CodeCoverageFlake")]
448+
[Ignore("This test sometimes hangs, see https://github.com/github/VisualStudio/issues/2221")]
448449
public async Task UpdatesInlineCommentThreadsFromEditorContent()
449450
{
450451
var baseContents = @"Line 1
@@ -500,6 +501,7 @@ Line 2
500501
}
501502

502503
[Test, NUnit.Framework.Category("CodeCoverageFlake")]
504+
[Ignore("This test sometimes hangs, see https://github.com/github/VisualStudio/issues/2221")]
503505
public async Task UpdatesReviewCommentWithNewBody()
504506
{
505507
var baseContents = @"Line 1
@@ -553,6 +555,7 @@ Line 2
553555
}
554556

555557
[Test]
558+
[Ignore("This test sometimes hangs, see https://github.com/github/VisualStudio/issues/2221")]
556559
public async Task AddsNewReviewCommentToThread()
557560
{
558561
var baseContents = @"Line 1

test/test.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RunSettings>
33
<RunConfiguration>
4-
<TestSessionTimeout>120000</TestSessionTimeout>
4+
<TestSessionTimeout>600000</TestSessionTimeout> <!-- 10 minutes -->
55
</RunConfiguration>
66
</RunSettings>

0 commit comments

Comments
 (0)