Skip to content

Commit

Permalink
Merge branch 'master' into azure-pipelines/certificate-sha1
Browse files Browse the repository at this point in the history
  • Loading branch information
jcansdale authored Mar 28, 2020
2 parents 5a7627a + 7884364 commit e9646f0
Show file tree
Hide file tree
Showing 30 changed files with 214 additions and 479 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This is a basic workflow to help you get started with Actions

name: CI

env:
config: Release
githubvsSolution: GitHubVS.sln
vsixContainer: ${{ github.workspace }}\GitHub.VisualStudio.vsix

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v1
with:
submodules: true

- name: Nerdbank.GitVersioning
uses: aarnott/[email protected]
id: nbgv

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'

- name: Add VSTest to PATH
uses: darenm/Setup-VSTest@v1

- name: NuGet restore ${{ env.githubvsSolution }}
run: nuget restore ${{ env.githubvsSolution }}

- name: MSBuild ${{ env.githubvsSolution }}
run: |
msbuild ${{ env.githubvsSolution }} /p:Configuration=${{ env.config }} /p:TargetVsixContainer=${{ env.vsixContainer }} /p:DeployExtension=False /verbosity:minimal
env:
GitHubVS_ClientId: ${{ secrets.GitHubVS_ClientId }}
GitHubVS_ClientSecret: ${{ secrets.GitHubVS_ClientSecret }}

- name: Upload VSIX artifact
uses: actions/upload-artifact@v1
with:
name: GitHubVS-${{ steps.nbgv.outputs.SemVer2 }}
path: ${{ env.vsixContainer }}

# We need to run '**\bin\**\*Tests.dll'
- name: Run unit tests
shell: bash
run: |
vstest.console /TestAdapterPath:test /Settings:test/test.runsettings \
test/GitHub.App.UnitTests/bin/${{ env.config }}/net46/GitHub.App.UnitTests.dll \
test/GitHub.Exports.Reactive.UnitTests/bin/${{ env.config }}/net46/GitHub.Exports.Reactive.UnitTests.dll \
test/GitHub.Exports.UnitTests/bin/${{ env.config }}/net46/GitHub.Exports.UnitTests.dll \
test/GitHub.Extensions.UnitTests/bin/${{ env.config }}/net46/GitHub.Extensions.UnitTests.dll \
test/GitHub.InlineReviews.UnitTests/bin/${{ env.config }}/net46/GitHub.InlineReviews.UnitTests.dll \
test/GitHub.Services.Vssdk.UnitTests/bin/${{ env.config }}/net461/GitHub.Services.Vssdk.UnitTests.dll \
test/GitHub.StartPage.UnitTests/bin/${{ env.config }}/net46/GitHub.StartPage.UnitTests.dll \
test/GitHub.TeamFoundation.UnitTests/bin/${{ env.config }}/net46/GitHub.TeamFoundation.UnitTests.dll \
test/GitHub.UI.UnitTests/bin/${{ env.config }}/net46/GitHub.UI.UnitTests.dll \
test/GitHub.VisualStudio.UnitTests/bin/${{ env.config }}/net46/GitHub.VisualStudio.UnitTests.dll \
test/MetricsTests/MetricsTests/bin/${{ env.config }}/MetricsTests.dll
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Most of the extension UI lives in the Team Explorer pane, which is available fro

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

[![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)
![CI](https://github.com/github/visualstudio/workflows/CI/badge.svg)

[![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)

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

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

2 changes: 1 addition & 1 deletion src/GitHub.Api/ApiClientConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static ApiClientConfiguration()
/// <summary>
/// Gets the ideal scopes requested by the application.
/// </summary>
public static IReadOnlyList<string> RequestedScopes { get; } = new[] { "user", "repo", "gist", "write:public_key", "read:org" };
public static IReadOnlyList<string> RequestedScopes { get; } = new[] { "user", "repo", "gist", "write:public_key", "read:org", "workflow" };

/// <summary>
/// Gets a note that will be stored with the OAUTH token.
Expand Down
9 changes: 8 additions & 1 deletion src/GitHub.Api/GitHub.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>


<PropertyGroup>
<!-- Use a default client ID/secret for testing -->
<!-- https://github.com/organizations/editor-tools/settings/applications/620133 -->
<GitHubVS_ClientId Condition="'$(GitHubVS_ClientId)' == ''">2454a3e6102fd41cc212</GitHubVS_ClientId>
<GitHubVS_ClientSecret Condition="'$(GitHubVS_ClientSecret)' == ''">2157c138e970165d955d09562230afcfbcda23f2</GitHubVS_ClientSecret>
</PropertyGroup>

<Import Project="$(SolutionDir)\src\common\signing.props" />

<Target Name="AddClientSecret" BeforeTargets="BeforeCompile"
Expand Down
4 changes: 4 additions & 0 deletions src/GitHub.App/Services/FromGraphQlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public static class FromGraphQlExtensions
return CheckConclusionState.Success;
case Octokit.GraphQL.Model.CheckConclusionState.Neutral:
return CheckConclusionState.Neutral;
case Octokit.GraphQL.Model.CheckConclusionState.Skipped:
return CheckConclusionState.Skipped;
case Octokit.GraphQL.Model.CheckConclusionState.Stale:
return CheckConclusionState.Stale;
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.App/Services/MentionsAutoCompleteSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public IObservable<AutoCompleteSuggestion> GetSuggestions()
{
query = new Query().Repository(owner: Var(nameof(owner)), name: Var(nameof(name)))
.Select(repository =>
repository.MentionableUsers(null, null, null, null)
repository.MentionableUsers(null, null, null, null, null)
.AllPages()
.Select(sourceItem =>
new SuggestionItem(sourceItem.Login,
Expand Down
21 changes: 1 addition & 20 deletions src/GitHub.App/ViewModels/Dialog/LoginCredentialsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.ComponentModel.Composition;
using System.Reactive.Linq;
using GitHub.App;
using GitHub.Primitives;
using GitHub.Services;
using ReactiveUI;

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

UpdateLoginMode();
connectionManager.Connections.CollectionChanged += (_, __) => UpdateLoginMode();
LoginMode = LoginMode.DotComOrEnterprise;

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

public IObservable<object> Done { get; }

void UpdateLoginMode()
{
var result = LoginMode.DotComOrEnterprise;

foreach (var connection in ConnectionManager.Connections)
{
if (connection.IsLoggedIn)
{
result &= ~((connection.HostAddress == HostAddress.GitHubDotComHostAddress) ?
LoginMode.DotComOnly : LoginMode.EnterpriseOnly);
}
}

LoginMode = result;
}
}
}
10 changes: 10 additions & 0 deletions src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ public GitHubPaneViewModel(
},
currentPage.Select(x => x is IOpenInBrowser));

BrowseRepository = ReactiveCommand.Create(
() =>
{
var url = LocalRepository.CloneUrl.ToRepositoryUrl();
if (url != null) browser.OpenUrl(url);
},
currentPage.Select(x => x is IOpenInBrowser));

help = ReactiveCommand.Create(() => { });
help.Subscribe(_ =>
{
Expand Down Expand Up @@ -531,5 +539,7 @@ static Regex CreateRoute(string route)
var routeFormat = "^" + new Regex("(:([a-z]+))\\b").Replace(route, @"(?<$2>[\w_.\-=]+)") + "$";
return new Regex(routeFormat, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
}

public ReactiveCommand<Unit, Unit> BrowseRepository { get; }
}
}
2 changes: 2 additions & 0 deletions src/GitHub.Exports/Models/CheckConclusionState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ public enum CheckConclusionState
Failure,
Success,
Neutral,
Skipped,
Stale
}
}
6 changes: 0 additions & 6 deletions src/GitHub.Exports/Settings/generated/IPackageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
"type": "bool",
"default": 'true'
},
{
"name": "EditorComments",
"type": "bool",
"default": "false"
},
{
"name": "UIState",
"type": "object",
Expand Down Expand Up @@ -40,7 +35,6 @@ public interface IPackageSettings : INotifyPropertyChanged
{
void Save();
bool CollectMetrics { get; set; }
bool EditorComments { get; set; }
UIState UIState { get; set; }
bool HideTeamExplorerWelcomeMessage { get; set; }
bool EnableTraceLogging { get; set; }
Expand Down
10 changes: 0 additions & 10 deletions src/GitHub.InlineReviews/GitHub.InlineReviews.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
<Compile Include="Commands\NextInlineCommentCommand.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Margins\InlineCommentTextViewOptions.cs" />
<Compile Include="Margins\PullRequestFileMargin.cs" />
<Compile Include="Margins\PullRequestFileMarginProvider.cs" />
<Compile Include="Glyph\GlyphData.cs" />
<Compile Include="Glyph\GlyphMargin.cs" />
<Compile Include="Glyph\GlyphMarginVisualManager.cs" />
Expand Down Expand Up @@ -97,12 +95,8 @@
<Compile Include="Tags\ShowInlineCommentAnnotationGlyph.xaml.cs">
<DependentUpon>ShowInlineCommentAnnotationGlyph.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\PullRequestFileMarginViewModel.cs" />
<Compile Include="ViewModels\InlineCommentPeekViewModel.cs" />
<Compile Include="ViewModels\PullRequestStatusViewModel.cs" />
<Compile Include="Views\PullRequestFileMarginView.xaml.cs">
<DependentUpon>PullRequestFileMarginView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GlyphMarginGrid.xaml.cs">
<DependentUpon>GlyphMarginGrid.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -251,10 +245,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\PullRequestFileMarginView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GlyphMarginGrid.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
122 changes: 0 additions & 122 deletions src/GitHub.InlineReviews/Margins/PullRequestFileMargin.cs

This file was deleted.

Loading

0 comments on commit e9646f0

Please sign in to comment.