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

Commit add8e9d

Browse files
Switch to CheckRunId
1 parent 06ad642 commit add8e9d

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

src/GitHub.App/SampleData/PullRequestAnnotationsViewModelDesigner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
1616
public ILocalRepositoryModel LocalRepository { get; set; }
1717
public string RemoteRepositoryOwner { get; set; }
1818
public int PullRequestNumber { get; set; } = 123;
19-
public int CheckRunId { get; set; }
19+
public string CheckRunId { get; set; }
2020
public ReactiveCommand<Unit, Unit> NavigateToPullRequest { get; }
2121
public string PullRequestTitle { get; } = "Fixing stuff in this PR";
2222
public string CheckSuiteName { get; } = "Awesome Check Suite";
@@ -61,7 +61,7 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
6161
};
6262

6363
public Task InitializeAsync(ILocalRepositoryModel localRepository, IConnection connection, string owner, string repo,
64-
int pullRequestNumber, int checkRunId)
64+
int pullRequestNumber, string checkRunId)
6565
{
6666
return Task.CompletedTask;
6767
}

src/GitHub.App/SampleData/PullRequestCheckViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public sealed class PullRequestCheckViewModelDesigner : ViewModelBase, IPullRequ
2222

2323
public PullRequestCheckType CheckType { get; set; } = PullRequestCheckType.ChecksApi;
2424

25-
public int CheckRunId { get; set; }
25+
public string CheckRunId { get; set; }
2626

2727
public bool HasAnnotations { get; } = true;
2828
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public async Task NavigateTo(Uri uri)
272272
var owner = match.Groups["owner"].Value;
273273
var repo = match.Groups["repo"].Value;
274274
var number = int.Parse(match.Groups["number"].Value);
275-
var id = int.Parse(match.Groups["id"].Value);
275+
var id = match.Groups["id"].Value;
276276

277277
await ShowPullRequestCheckRun(owner, repo, number, id);
278278
}
@@ -330,7 +330,7 @@ public Task ShowPullRequestReviews(string owner, string repo, int number, string
330330
}
331331

332332
/// <inheritdoc/>
333-
public Task ShowPullRequestCheckRun(string owner, string repo, int number, int checkRunId)
333+
public Task ShowPullRequestCheckRun(string owner, string repo, int number, string checkRunId)
334334
{
335335
Guard.ArgumentNotNull(owner, nameof(owner));
336336
Guard.ArgumentNotNull(repo, nameof(repo));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public PullRequestAnnotationsViewModel(IPullRequestSessionManager sessionManager
4141

4242
/// <inheritdoc/>
4343
public async Task InitializeAsync(ILocalRepositoryModel localRepository, IConnection connection, string owner,
44-
string repo, int pullRequestNumber, int checkRunId)
44+
string repo, int pullRequestNumber, string checkRunId)
4545
{
4646
if (repo != localRepository.Name)
4747
{
@@ -75,7 +75,7 @@ public async Task InitializeAsync(ILocalRepositoryModel localRepository, IConnec
7575
public int PullRequestNumber { get; private set; }
7676

7777
/// <inheritdoc/>
78-
public int CheckRunId { get; private set; }
78+
public string CheckRunId { get; private set; }
7979

8080
/// <inheritdoc/>
8181
public ReactiveCommand<Unit, Unit> NavigateToPullRequest { get; private set; }
@@ -119,7 +119,7 @@ void Load(PullRequestDetailModel pullRequest)
119119
var checkSuiteRun = pullRequest
120120
.CheckSuites.SelectMany(checkSuite => checkSuite.CheckRuns
121121
.Select(checkRun => new{checkSuite, checkRun}))
122-
.First(arg => arg.checkRun.DatabaseId == CheckRunId);
122+
.First(arg => arg.checkRun.CheckRunId == CheckRunId);
123123

124124
CheckSuiteName = checkSuiteRun.checkSuite.ApplicationName;
125125
CheckRunName = checkSuiteRun.checkRun.Name;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor
9494

9595
var pullRequestCheckViewModel = (PullRequestCheckViewModel)viewViewModelFactory.CreateViewModel<IPullRequestCheckViewModel>();
9696
pullRequestCheckViewModel.CheckType = PullRequestCheckType.ChecksApi;
97-
pullRequestCheckViewModel.CheckRunId = checkRunModel.DatabaseId;
97+
pullRequestCheckViewModel.CheckRunId = checkRunModel.CheckRunId;
9898
pullRequestCheckViewModel.HasAnnotations = checkRunModel.Annotations?.Any() ?? false;
9999
pullRequestCheckViewModel.Title = checkRunModel.Name;
100100
pullRequestCheckViewModel.Description = checkRunModel.Summary;
@@ -143,7 +143,7 @@ private void DoOpenDetailsUrl()
143143
public PullRequestCheckType CheckType { get; private set; }
144144

145145
/// <inheritdoc/>
146-
public int CheckRunId { get; private set; }
146+
public string CheckRunId { get; private set; }
147147

148148
/// <inheritdoc/>
149149
public bool HasAnnotations { get; private set; }

src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestAnnotationsViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public interface IPullRequestAnnotationsViewModel : IPanePageViewModel
3939
/// <summary>
4040
/// Gets the id of the check run.
4141
/// </summary>
42-
int CheckRunId { get; }
42+
string CheckRunId { get; }
4343

4444
/// <summary>
4545
/// Gets the name of the check run.
@@ -76,6 +76,6 @@ Task InitializeAsync(
7676
string owner,
7777
string repo,
7878
int pullRequestNumber,
79-
int checkRunId);
79+
string checkRunId);
8080
}
8181
}

src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestCheckViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public interface IPullRequestCheckViewModel: IViewModel
4444
/// <summary>
4545
/// Gets the id of the check run.
4646
/// </summary>
47-
int CheckRunId { get; }
47+
string CheckRunId { get; }
4848

4949
/// <summary>
5050
/// Gets a flag to show this check run has annotations.

src/GitHub.Exports/Models/CheckRunModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public class CheckRunModel
4646
/// <summary>
4747
/// The database id of a Check Run.
4848
/// </summary>
49-
public int DatabaseId { get; set; }
49+
public string CheckRunId { get; set; }
5050
}
5151
}

src/GitHub.Exports/ViewModels/GitHubPane/IGitHubPaneViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public interface IGitHubPaneViewModel : IViewModel
9797
/// <param name="owner">The repository owner.</param>
9898
/// <param name="repo">The repository name.</param>
9999
/// <param name="number">The pull rqeuest number.</param>
100-
/// <param name="checkRunId">The check run number.</param>
101-
Task ShowPullRequestCheckRun(string owner, string repo, int number, int checkRunId);
100+
/// <param name="checkRunId">The check run id.</param>
101+
Task ShowPullRequestCheckRun(string owner, string repo, int number, string checkRunId);
102102

103103
/// <summary>
104104
/// Shows the pull requests reviews authored by a user.

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,9 @@ async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress addres
787787
CheckRuns = suite.CheckRuns(null, null, null, null, null).AllPages(10)
788788
.Select(run => new CheckRunModel
789789
{
790+
CheckRunId = run.Id.Value,
790791
Conclusion = run.Conclusion.FromGraphQl(),
791792
Status = run.Status.FromGraphQl(),
792-
DatabaseId = run.DatabaseId.Value,
793793
Name = run.Name,
794794
DetailsUrl = run.Permalink,
795795
Summary = run.Summary,

0 commit comments

Comments
 (0)