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

Commit 7406d70

Browse files
Merge branch 'master' into enhancements/add-user-guid-to-metrics
# Conflicts: # src/GitHub.Exports/Models/UsageModel.cs # src/GitHub.VisualStudio/Services/UsageService.cs # src/GitHub.VisualStudio/Services/UsageTracker.cs # test/UnitTests/GitHub.VisualStudio/Services/UsageTrackerTests.cs
2 parents ea1ee59 + ee77977 commit 7406d70

File tree

92 files changed

+2920
-943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2920
-943
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
Hi there! We're thrilled that you'd like to contribute to the __GitHub Extension for Visual Studio__. Your help is essential for keeping it great.
99

10+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md).
11+
1012
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
1113

1214
## Submitting a pull request

ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Hello! Please read the contributing guidelines before submitting an issue regarding the GitHub Extension for Visual Studio.
22

3-
- GitHub Extension for Visual Studio version:
3+
- GitHub Extension for Visual Studio version:
44
- Visual Studio version:
55

66
__What happened__ (with steps, logs and screenshots, if possible)

appveyor.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.4.0.{build}'
1+
version: '2.4.3.{build}'
22
skip_tags: true
33
install:
44
- ps: |
@@ -19,8 +19,10 @@ install:
1919
nuget restore GitHubVS.sln
2020
build_script:
2121
- ps: scripts\build.ps1 -AppVeyor -BuildNumber:$env:APPVEYOR_BUILD_NUMBER
22-
test_script:
23-
- ps: scripts\test.ps1 -AppVeyor
22+
test:
23+
categories:
24+
except:
25+
- Timings
2426
on_success:
2527
- ps: |
2628
if ($full_build) {
-7.67 KB
Binary file not shown.

scripts/test.ps1

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Param(
1818
$TimeoutDuration = 180
1919
,
2020
[switch]
21-
$AppVeyor = $false
22-
,
23-
[switch]
2421
$Trace = $false
2522

2623
)
@@ -35,30 +32,30 @@ $env:PATH = "$PSScriptRoot;$env:PATH"
3532
$exitcode = 0
3633

3734
Write-Output "Running Tracking Collection Tests..."
38-
Run-NUnit test TrackingCollectionTests $TimeoutDuration $config -AppVeyor:$AppVeyor
35+
Run-NUnit test TrackingCollectionTests $TimeoutDuration $config
3936
if (!$?) {
4037
$exitcode = 1
4138
}
4239

4340
Write-Output "Running GitHub.UI.UnitTests..."
44-
Run-NUnit test GitHub.UI.UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
41+
Run-NUnit test GitHub.UI.UnitTests $TimeoutDuration $config
4542
if (!$?) {
4643
$exitcode = 2
4744
}
4845

4946
Write-Output "Running UnitTests..."
50-
Run-NUnit test UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
47+
Run-NUnit test UnitTests $TimeoutDuration $config
5148
if (!$?) {
5249
$exitcode = 3
5350
}
5451

5552
Write-Output "Running GitHub.InlineReviews.UnitTests..."
56-
Run-NUnit test GitHub.InlineReviews.UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
53+
Run-NUnit test GitHub.InlineReviews.UnitTests $TimeoutDuration $config
5754
if (!$?) {
5855
$exitcode = 4
5956
}
6057

61-
if ($exitcode -ne 0 -and $AppVeyor) {
58+
if ($exitcode -ne 0) {
6259
$host.SetShouldExit($exitcode)
6360
}
6461
exit $exitcode

src/GitHub.Api/SimpleApiClient.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async Task<Repository> GetRepositoryInternal()
7272
if (repo != null)
7373
{
7474
hasWiki = await HasWikiInternal(repo);
75-
isEnterprise = await IsEnterpriseInternal();
75+
isEnterprise = isEnterprise ?? await IsEnterpriseInternal();
7676
repositoryCache = repo;
7777
}
7878
owner = ownerLogin;
@@ -99,9 +99,14 @@ public bool HasWiki()
9999
return hasWiki.HasValue && hasWiki.Value;
100100
}
101101

102-
public bool IsEnterprise()
102+
public async Task<bool> IsEnterprise()
103103
{
104-
return isEnterprise.HasValue && isEnterprise.Value;
104+
if (!isEnterprise.HasValue)
105+
{
106+
isEnterprise = await IsEnterpriseInternal();
107+
}
108+
109+
return isEnterprise ?? false;
105110
}
106111

107112
async Task<bool> HasWikiInternal(Repository repo)

src/GitHub.App/Api/ApiClient.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static string GetMachineNameSafe()
157157
}
158158
catch (Exception e)
159159
{
160-
log.Information(e, "Failed to retrieve host name using `DNS.GetHostName`");
160+
log.Warning(e, "Failed to retrieve host name using `DNS.GetHostName`");
161161
try
162162
{
163163
return Environment.MachineName;
@@ -242,7 +242,8 @@ public IObservable<PullRequest> GetPullRequestsForRepository(string owner, strin
242242
Guard.ArgumentNotEmptyString(name, nameof(name));
243243

244244
return gitHubClient.PullRequest.GetAllForRepository(owner, name,
245-
new PullRequestRequest {
245+
new PullRequestRequest
246+
{
246247
State = ItemStateFilter.All,
247248
SortProperty = PullRequestSort.Updated,
248249
SortDirection = SortDirection.Descending
@@ -268,7 +269,7 @@ public IObservable<Branch> GetBranches(string owner, string repo)
268269
Guard.ArgumentNotEmptyString(owner, nameof(owner));
269270
Guard.ArgumentNotEmptyString(repo, nameof(repo));
270271

271-
#pragma warning disable CS0618
272+
#pragma warning disable 618
272273
// GetAllBranches is obsolete, but don't want to introduce the change to fix the
273274
// warning in the PR, so disabling for now.
274275
return gitHubClient.Repository.GetAllBranches(owner, repo);

src/GitHub.App/Caches/CacheIndex.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static IObservable<CacheIndex> AddAndSaveToIndex(IBlobCache cache, string
6262
Guard.ArgumentNotNull(item, nameof(item));
6363

6464
return cache.GetOrCreateObject(indexKey, () => Create(indexKey))
65+
.Select(x => x.IndexKey == null ? Create(indexKey) : x)
6566
.Do(index =>
6667
{
6768
var k = string.Format(CultureInfo.InvariantCulture, "{0}|{1}", index.IndexKey, item.Key);

src/GitHub.App/Extensions/AkavacheExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ static IObservable<T> GetAndFetchLatestFromIndex<T>(this IBlobCache This,
200200
bool shouldInvalidateOnError = false)
201201
where T : CacheItem
202202
{
203-
var idx = Observable.Defer(() => This.GetOrCreateObject(key, () => CacheIndex.Create(key))).Replay().RefCount();
203+
var idx = Observable.Defer(() => This
204+
.GetOrCreateObject(key, () => CacheIndex.Create(key)))
205+
.Select(x => x.IndexKey == null ? CacheIndex.Create(key) : x)
206+
.Replay()
207+
.RefCount();
204208

205209

206210
var fetch = idx
@@ -264,6 +268,7 @@ public static IObservable<T> PutAndUpdateIndex<T>(this IBlobCache blobCache,
264268
{
265269
var absoluteExpiration = blobCache.Scheduler.Now + maxCacheDuration;
266270
return blobCache.GetOrCreateObject(key, () => CacheIndex.Create(key))
271+
.Select(x => x.IndexKey == null ? CacheIndex.Create(key) : x)
267272
.SelectMany(index => fetchFunc()
268273
.Catch<T, Exception>(Observable.Throw<T>)
269274
.SelectMany(x => x.Save<T>(blobCache, key, absoluteExpiration))

src/GitHub.App/GitHub.App.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
<HintPath>..\..\packages\Microsoft.VisualStudio.ComponentModelHost.14.0.25424\lib\net45\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
6262
<Private>True</Private>
6363
</Reference>
64+
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
65+
<HintPath>..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
66+
<Private>True</Private>
67+
</Reference>
6468
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
6569
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
6670
<Private>True</Private>
@@ -69,10 +73,18 @@
6973
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
7074
<Private>True</Private>
7175
</Reference>
76+
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
77+
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
78+
<Private>True</Private>
79+
</Reference>
7280
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
7381
<HintPath>..\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
7482
<Private>True</Private>
7583
</Reference>
84+
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
85+
<HintPath>..\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
86+
<Private>True</Private>
87+
</Reference>
7688
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7789
<SpecificVersion>False</SpecificVersion>
7890
<HintPath>..\..\packages\Microsoft.VisualStudio.Threading.14.1.131\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
@@ -142,6 +154,7 @@
142154
<Compile Include="Models\PullRequestDetailArgument.cs" />
143155
<Compile Include="Services\EnterpriseCapabilitiesService.cs" />
144156
<Compile Include="Services\GlobalConnection.cs" />
157+
<Compile Include="Services\PullRequestEditorService.cs" />
145158
<Compile Include="Services\TeamExplorerContext.cs" />
146159
<Compile Include="Services\OAuthCallbackListener.cs" />
147160
<Compile Include="ViewModels\Dialog\GistCreationViewModel.cs" />

0 commit comments

Comments
 (0)