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

Commit 23e48d1

Browse files
Merge pull request #1798 from github/features/check-suites
Functionality to support Check Suites API
2 parents f7424c8 + caaf122 commit 23e48d1

32 files changed

+622
-157
lines changed

lib/Octokit.GraphQL.0.1.1-beta.nupkg

194 KB
Binary file not shown.

src/GitHub.Api/GitHub.Api.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
5151
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
5252
</Reference>
53-
<Reference Include="Octokit.GraphQL, Version=0.1.0.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
54-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.0-beta\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
53+
<Reference Include="Octokit.GraphQL, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
54+
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
5555
</Reference>
56-
<Reference Include="Octokit.GraphQL.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
57-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.0-beta\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
56+
<Reference Include="Octokit.GraphQL.Core, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
57+
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
5858
</Reference>
5959
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
6060
<HintPath>..\..\packages\Serilog.2.5.0\lib\net46\Serilog.dll</HintPath>

src/GitHub.Api/GraphQLKeychainCredentialStore.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Threading;
23
using System.Threading.Tasks;
34
using GitHub.Extensions;
45
using GitHub.Primitives;
@@ -23,7 +24,7 @@ public GraphQLKeychainCredentialStore(IKeychain keychain, HostAddress address)
2324
this.address = address;
2425
}
2526

26-
public async Task<string> GetCredentials()
27+
public async Task<string> GetCredentials(CancellationToken cancellationToken = default)
2728
{
2829
var userPass = await keychain.Load(address).ConfigureAwait(false);
2930
return userPass?.Item2;

src/GitHub.Api/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
4-
<package id="Octokit.GraphQL" version="0.1.0-beta" targetFramework="net461" />
4+
<package id="Octokit.GraphQL" version="0.1.1-beta" targetFramework="net461" />
55
<package id="Serilog" version="2.5.0" targetFramework="net461" />
66
</packages>

src/GitHub.App/GitHub.App.csproj

+8-6
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@
144144
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
145145
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
146146
</Reference>
147-
<Reference Include="Octokit.GraphQL, Version=0.1.0.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
148-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.0-beta\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
147+
<Reference Include="Octokit.GraphQL, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
148+
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
149149
</Reference>
150-
<Reference Include="Octokit.GraphQL.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
151-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.0-beta\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
150+
<Reference Include="Octokit.GraphQL.Core, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
151+
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
152152
</Reference>
153153
<Reference Include="PresentationCore" />
154154
<Reference Include="PresentationFramework" />
@@ -229,6 +229,7 @@
229229
<Compile Include="SampleData\PullRequestUserReviewsViewModelDesigner.cs" />
230230
<Compile Include="SampleData\UserFilterViewModelDesigner.cs" />
231231
<Compile Include="Services\EnterpriseCapabilitiesService.cs" />
232+
<Compile Include="Services\FromGraphQlExtensions.cs" />
232233
<Compile Include="Services\GitHubContextService.cs" />
233234
<Compile Include="Services\GlobalConnection.cs" />
234235
<Compile Include="Services\RepositoryForkService.cs" />
@@ -259,6 +260,7 @@
259260
<Compile Include="ViewModels\GitHubPane\NavigationViewModel.cs" />
260261
<Compile Include="ViewModels\GitHubPane\GitHubPaneViewModel.cs" />
261262
<Compile Include="SampleData\PullRequestCheckViewModelDesigner.cs" />
263+
<Compile Include="ViewModels\GitHubPane\PullRequestCheckType.cs" />
262264
<Compile Include="ViewModels\GitHubPane\PullRequestFilesViewModel.cs" />
263265
<Compile Include="ViewModels\GitHubPane\PullRequestListItemViewModel.cs" />
264266
<Compile Include="ViewModels\GitHubPane\PullRequestListViewModel.cs" />
@@ -416,8 +418,8 @@
416418
</ItemGroup>
417419
<ItemGroup>
418420
<EmbeddedResource Include="Resources.en-US.resx">
419-
<DependentUpon>Resources.resx</DependentUpon>
420-
</EmbeddedResource>
421+
<DependentUpon>Resources.resx</DependentUpon>
422+
</EmbeddedResource>
421423
<EmbeddedResource Include="Resources.resx">
422424
<Generator>PublicResXFileCodeGenerator</Generator>
423425
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

src/GitHub.App/SampleData/PullRequestCheckViewModelDesigner.cs

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ public sealed class PullRequestCheckViewModelDesigner : ViewModelBase, IPullRequ
1616

1717
public Uri DetailsUrl { get; set; } = new Uri("http://github.com");
1818

19-
public string AvatarUrl { get; set; } = "https://avatars1.githubusercontent.com/u/417571?s=88&v=4";
20-
21-
public BitmapImage Avatar { get; set; } = null;
22-
2319
public ReactiveCommand<object> OpenDetailsUrl { get; set; } = null;
2420
}
2521
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
using System;
2+
using GitHub.Models;
3+
using Octokit.GraphQL.Model;
4+
using CheckConclusionState = GitHub.Models.CheckConclusionState;
5+
using CheckStatusState = GitHub.Models.CheckStatusState;
6+
using PullRequestReviewState = GitHub.Models.PullRequestReviewState;
7+
using StatusState = GitHub.Models.StatusState;
8+
9+
namespace GitHub.Services
10+
{
11+
public static class FromGraphQlExtensions
12+
{
13+
public static CheckConclusionState? FromGraphQl(this Octokit.GraphQL.Model.CheckConclusionState? value)
14+
{
15+
switch (value)
16+
{
17+
case null:
18+
return null;
19+
case Octokit.GraphQL.Model.CheckConclusionState.ActionRequired:
20+
return CheckConclusionState.ActionRequired;
21+
case Octokit.GraphQL.Model.CheckConclusionState.TimedOut:
22+
return CheckConclusionState.TimedOut;
23+
case Octokit.GraphQL.Model.CheckConclusionState.Cancelled:
24+
return CheckConclusionState.Cancelled;
25+
case Octokit.GraphQL.Model.CheckConclusionState.Failure:
26+
return CheckConclusionState.Failure;
27+
case Octokit.GraphQL.Model.CheckConclusionState.Success:
28+
return CheckConclusionState.Success;
29+
case Octokit.GraphQL.Model.CheckConclusionState.Neutral:
30+
return CheckConclusionState.Neutral;
31+
default:
32+
throw new ArgumentOutOfRangeException(nameof(value), value, null);
33+
}
34+
}
35+
36+
public static PullRequestStateEnum FromGraphQl(this PullRequestState value)
37+
{
38+
switch (value)
39+
{
40+
case PullRequestState.Open:
41+
return PullRequestStateEnum.Open;
42+
case PullRequestState.Closed:
43+
return PullRequestStateEnum.Closed;
44+
case PullRequestState.Merged:
45+
return PullRequestStateEnum.Merged;
46+
default:
47+
throw new ArgumentOutOfRangeException(nameof(value), value, null);
48+
}
49+
}
50+
51+
public static StatusState FromGraphQl(this Octokit.GraphQL.Model.StatusState value)
52+
{
53+
switch (value)
54+
{
55+
case Octokit.GraphQL.Model.StatusState.Expected:
56+
return StatusState.Expected;
57+
case Octokit.GraphQL.Model.StatusState.Error:
58+
return StatusState.Error;
59+
case Octokit.GraphQL.Model.StatusState.Failure:
60+
return StatusState.Failure;
61+
case Octokit.GraphQL.Model.StatusState.Pending:
62+
return StatusState.Pending;
63+
case Octokit.GraphQL.Model.StatusState.Success:
64+
return StatusState.Success;
65+
default:
66+
throw new ArgumentOutOfRangeException(nameof(value), value, null);
67+
}
68+
}
69+
70+
public static CheckStatusState FromGraphQl(this Octokit.GraphQL.Model.CheckStatusState value)
71+
{
72+
switch (value)
73+
{
74+
case Octokit.GraphQL.Model.CheckStatusState.Queued:
75+
return CheckStatusState.Queued;
76+
case Octokit.GraphQL.Model.CheckStatusState.InProgress:
77+
return CheckStatusState.InProgress;
78+
case Octokit.GraphQL.Model.CheckStatusState.Completed:
79+
return CheckStatusState.Completed;
80+
case Octokit.GraphQL.Model.CheckStatusState.Requested:
81+
return CheckStatusState.Requested;
82+
default:
83+
throw new ArgumentOutOfRangeException(nameof(value), value, null);
84+
}
85+
}
86+
87+
public static GitHub.Models.PullRequestReviewState FromGraphQl(this Octokit.GraphQL.Model.PullRequestReviewState value)
88+
{
89+
switch (value) {
90+
case Octokit.GraphQL.Model.PullRequestReviewState.Pending:
91+
return PullRequestReviewState.Pending;
92+
case Octokit.GraphQL.Model.PullRequestReviewState.Commented:
93+
return PullRequestReviewState.Commented;
94+
case Octokit.GraphQL.Model.PullRequestReviewState.Approved:
95+
return PullRequestReviewState.Approved;
96+
case Octokit.GraphQL.Model.PullRequestReviewState.ChangesRequested:
97+
return PullRequestReviewState.ChangesRequested;
98+
case Octokit.GraphQL.Model.PullRequestReviewState.Dismissed:
99+
return PullRequestReviewState.Dismissed;
100+
default:
101+
throw new ArgumentOutOfRangeException(nameof(value), value, null);
102+
}
103+
}
104+
}
105+
}

0 commit comments

Comments
 (0)