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

Commit e9646f0

Browse files
authored
Merge branch 'master' into azure-pipelines/certificate-sha1
2 parents 5a7627a + 7884364 commit e9646f0

30 files changed

+214
-479
lines changed

.github/workflows/main.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
env:
6+
config: Release
7+
githubvsSolution: GitHubVS.sln
8+
vsixContainer: ${{ github.workspace }}\GitHub.VisualStudio.vsix
9+
10+
# Controls when the action will run. Triggers the workflow on push or pull request
11+
# events but only for the master branch
12+
on:
13+
push:
14+
branches: [ master ]
15+
pull_request:
16+
branches: [ master ]
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
# This workflow contains a single job called "build"
21+
build:
22+
# The type of runner that the job will run on
23+
runs-on: windows-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v1
29+
with:
30+
submodules: true
31+
32+
- name: Nerdbank.GitVersioning
33+
uses: aarnott/[email protected]
34+
id: nbgv
35+
36+
- name: Add MSBuild to PATH
37+
uses: microsoft/[email protected]
38+
39+
- uses: nuget/setup-nuget@v1
40+
with:
41+
nuget-version: '5.x'
42+
43+
- name: Add VSTest to PATH
44+
uses: darenm/Setup-VSTest@v1
45+
46+
- name: NuGet restore ${{ env.githubvsSolution }}
47+
run: nuget restore ${{ env.githubvsSolution }}
48+
49+
- name: MSBuild ${{ env.githubvsSolution }}
50+
run: |
51+
msbuild ${{ env.githubvsSolution }} /p:Configuration=${{ env.config }} /p:TargetVsixContainer=${{ env.vsixContainer }} /p:DeployExtension=False /verbosity:minimal
52+
env:
53+
GitHubVS_ClientId: ${{ secrets.GitHubVS_ClientId }}
54+
GitHubVS_ClientSecret: ${{ secrets.GitHubVS_ClientSecret }}
55+
56+
- name: Upload VSIX artifact
57+
uses: actions/upload-artifact@v1
58+
with:
59+
name: GitHubVS-${{ steps.nbgv.outputs.SemVer2 }}
60+
path: ${{ env.vsixContainer }}
61+
62+
# We need to run '**\bin\**\*Tests.dll'
63+
- name: Run unit tests
64+
shell: bash
65+
run: |
66+
vstest.console /TestAdapterPath:test /Settings:test/test.runsettings \
67+
test/GitHub.App.UnitTests/bin/${{ env.config }}/net46/GitHub.App.UnitTests.dll \
68+
test/GitHub.Exports.Reactive.UnitTests/bin/${{ env.config }}/net46/GitHub.Exports.Reactive.UnitTests.dll \
69+
test/GitHub.Exports.UnitTests/bin/${{ env.config }}/net46/GitHub.Exports.UnitTests.dll \
70+
test/GitHub.Extensions.UnitTests/bin/${{ env.config }}/net46/GitHub.Extensions.UnitTests.dll \
71+
test/GitHub.InlineReviews.UnitTests/bin/${{ env.config }}/net46/GitHub.InlineReviews.UnitTests.dll \
72+
test/GitHub.Services.Vssdk.UnitTests/bin/${{ env.config }}/net461/GitHub.Services.Vssdk.UnitTests.dll \
73+
test/GitHub.StartPage.UnitTests/bin/${{ env.config }}/net46/GitHub.StartPage.UnitTests.dll \
74+
test/GitHub.TeamFoundation.UnitTests/bin/${{ env.config }}/net46/GitHub.TeamFoundation.UnitTests.dll \
75+
test/GitHub.UI.UnitTests/bin/${{ env.config }}/net46/GitHub.UI.UnitTests.dll \
76+
test/GitHub.VisualStudio.UnitTests/bin/${{ env.config }}/net46/GitHub.VisualStudio.UnitTests.dll \
77+
test/MetricsTests/MetricsTests/bin/${{ env.config }}/MetricsTests.dll

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Most of the extension UI lives in the Team Explorer pane, which is available fro
77

88
Official builds of this extension are available at the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=GitHub.GitHubExtensionforVisualStudio).
99

10-
[![Build Status](https://github-editor-tools.visualstudio.com/VisualStudio/_apis/build/status/github.VisualStudio?branchName=master)](https://github-editor-tools.visualstudio.com/VisualStudio/_build/latest?definitionId=10&branchName=master)
10+
![CI](https://github.com/github/visualstudio/workflows/CI/badge.svg)
1111

1212
[![Follow GitHub for Visual Studio](https://img.shields.io/twitter/follow/GitHubVS.svg?style=social "Follow GitHubVS")](https://twitter.com/githubvs?ref_src=twsrc%5Etfw) [![Join the chat at https://gitter.im/github/VisualStudio](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/github/VisualStudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1313

@@ -72,4 +72,3 @@ Visit the [Contributor Guidelines](CONTRIBUTING.md) for details on how to contri
7272
Copyright 2015 - 2019 GitHub, Inc.
7373

7474
Licensed under the [MIT License](LICENSE.md)
75-

src/GitHub.Api/ApiClientConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static ApiClientConfiguration()
4040
/// <summary>
4141
/// Gets the ideal scopes requested by the application.
4242
/// </summary>
43-
public static IReadOnlyList<string> RequestedScopes { get; } = new[] { "user", "repo", "gist", "write:public_key", "read:org" };
43+
public static IReadOnlyList<string> RequestedScopes { get; } = new[] { "user", "repo", "gist", "write:public_key", "read:org", "workflow" };
4444

4545
/// <summary>
4646
/// Gets a note that will be stored with the OAUTH token.

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
<DebugType>full</DebugType>
55
<DebugSymbols>true</DebugSymbols>
66
</PropertyGroup>
7-
7+
8+
<PropertyGroup>
9+
<!-- Use a default client ID/secret for testing -->
10+
<!-- https://github.com/organizations/editor-tools/settings/applications/620133 -->
11+
<GitHubVS_ClientId Condition="'$(GitHubVS_ClientId)' == ''">2454a3e6102fd41cc212</GitHubVS_ClientId>
12+
<GitHubVS_ClientSecret Condition="'$(GitHubVS_ClientSecret)' == ''">2157c138e970165d955d09562230afcfbcda23f2</GitHubVS_ClientSecret>
13+
</PropertyGroup>
14+
815
<Import Project="$(SolutionDir)\src\common\signing.props" />
916

1017
<Target Name="AddClientSecret" BeforeTargets="BeforeCompile"

src/GitHub.App/Services/FromGraphQlExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public static class FromGraphQlExtensions
2929
return CheckConclusionState.Success;
3030
case Octokit.GraphQL.Model.CheckConclusionState.Neutral:
3131
return CheckConclusionState.Neutral;
32+
case Octokit.GraphQL.Model.CheckConclusionState.Skipped:
33+
return CheckConclusionState.Skipped;
34+
case Octokit.GraphQL.Model.CheckConclusionState.Stale:
35+
return CheckConclusionState.Stale;
3236
default:
3337
throw new ArgumentOutOfRangeException(nameof(value), value, null);
3438
}

src/GitHub.App/Services/MentionsAutoCompleteSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public IObservable<AutoCompleteSuggestion> GetSuggestions()
5454
{
5555
query = new Query().Repository(owner: Var(nameof(owner)), name: Var(nameof(name)))
5656
.Select(repository =>
57-
repository.MentionableUsers(null, null, null, null)
57+
repository.MentionableUsers(null, null, null, null, null)
5858
.AllPages()
5959
.Select(sourceItem =>
6060
new SuggestionItem(sourceItem.Login,

src/GitHub.App/ViewModels/Dialog/LoginCredentialsViewModel.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
22
using System.ComponentModel.Composition;
33
using System.Reactive.Linq;
4-
using GitHub.App;
5-
using GitHub.Primitives;
64
using GitHub.Services;
75
using ReactiveUI;
86

@@ -28,8 +26,7 @@ public LoginCredentialsViewModel(
2826
(x, y) => x.Value || y.Value
2927
).ToProperty(this, vm => vm.IsLoginInProgress);
3028

31-
UpdateLoginMode();
32-
connectionManager.Connections.CollectionChanged += (_, __) => UpdateLoginMode();
29+
LoginMode = LoginMode.DotComOrEnterprise;
3330

3431
Done = Observable.Merge(
3532
loginToGitHubViewModel.Login,
@@ -55,21 +52,5 @@ public LoginMode LoginMode
5552
public bool IsLoginInProgress { get { return isLoginInProgress.Value; } }
5653

5754
public IObservable<object> Done { get; }
58-
59-
void UpdateLoginMode()
60-
{
61-
var result = LoginMode.DotComOrEnterprise;
62-
63-
foreach (var connection in ConnectionManager.Connections)
64-
{
65-
if (connection.IsLoggedIn)
66-
{
67-
result &= ~((connection.HostAddress == HostAddress.GitHubDotComHostAddress) ?
68-
LoginMode.DotComOnly : LoginMode.EnterpriseOnly);
69-
}
70-
}
71-
72-
LoginMode = result;
73-
}
7455
}
7556
}

src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ public GitHubPaneViewModel(
160160
},
161161
currentPage.Select(x => x is IOpenInBrowser));
162162

163+
BrowseRepository = ReactiveCommand.Create(
164+
() =>
165+
{
166+
var url = LocalRepository.CloneUrl.ToRepositoryUrl();
167+
if (url != null) browser.OpenUrl(url);
168+
},
169+
currentPage.Select(x => x is IOpenInBrowser));
170+
163171
help = ReactiveCommand.Create(() => { });
164172
help.Subscribe(_ =>
165173
{
@@ -531,5 +539,7 @@ static Regex CreateRoute(string route)
531539
var routeFormat = "^" + new Regex("(:([a-z]+))\\b").Replace(route, @"(?<$2>[\w_.\-=]+)") + "$";
532540
return new Regex(routeFormat, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
533541
}
542+
543+
public ReactiveCommand<Unit, Unit> BrowseRepository { get; }
534544
}
535545
}

src/GitHub.Exports/Models/CheckConclusionState.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ public enum CheckConclusionState
88
Failure,
99
Success,
1010
Neutral,
11+
Skipped,
12+
Stale
1113
}
1214
}

src/GitHub.Exports/Settings/generated/IPackageSettings.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
"type": "bool",
88
"default": 'true'
99
},
10-
{
11-
"name": "EditorComments",
12-
"type": "bool",
13-
"default": "false"
14-
},
1510
{
1611
"name": "UIState",
1712
"type": "object",
@@ -40,7 +35,6 @@ public interface IPackageSettings : INotifyPropertyChanged
4035
{
4136
void Save();
4237
bool CollectMetrics { get; set; }
43-
bool EditorComments { get; set; }
4438
UIState UIState { get; set; }
4539
bool HideTeamExplorerWelcomeMessage { get; set; }
4640
bool EnableTraceLogging { get; set; }

0 commit comments

Comments
 (0)