-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Functionality to support Check Suites API #1798
Conversation
This reverts commit b086078.
# Conflicts: # src/GitHub.App/Services/PullRequestService.cs # src/GitHub.App/ViewModels/GitHubPane/PullRequestDetailViewModel.cs # src/GitHub.Exports/Models/PullRequestDetailModel.cs # src/GitHub.InlineReviews/Services/PullRequestSessionService.cs # test/GitHub.App.UnitTests/ViewModels/GitHubPane/PullRequestDetailViewModelTests.cs
33be14b
to
fc1e2ea
Compare
fc1e2ea
to
b16b5ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far! A few nits, and one requested change that I couldn't add as an inline comment:
- Could the nupkg be removed from the
lib
directory now? That package is on nuget.org right?
{ | ||
item.CommentCount += item.Reviews.Sum(x => x.Count); | ||
item.Reviews = null; | ||
|
||
var hasStatuses = item.LastCommit.Statuses != null | ||
var hasCheckSuites = item.LastCommit.CheckSuites != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could these be written more simply?
var hasCheckSuites = item.LastCommit.CheckSuites?.Any() ?? false;
return pullRequestCheckViewModel; | ||
}) ?? new PullRequestCheckViewModel[0]; | ||
|
||
return statuses.Union(checks).OrderBy(model => model.Title); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is .Union
the best operator to use here? It will do equality checks for each item, even though the items will never be equal. Not a big deal but I would have said that .Concat
would be a better choice here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I never knew that...
/// <summary> | ||
/// Model for a single check annotation. | ||
/// </summary> | ||
public class CheckRunAnnotationModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely documented ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/// Gets or sets a collection of pull request Checks & Statuses | ||
/// Gets or sets a collection of pull request Checks Suites | ||
/// </summary> | ||
public List<CheckSuiteModel> CheckSuites { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IReadOnlyList
is used for the lists elsewhere in this model (and oops I didn't notice this with Statuses
).
This LGTM! Thanks for your work on this @StanleyGoldman ✨ |
This pull request displays a summary line for Check Runs and links a user to the Check Run page.