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

Commit bfd6bfb

Browse files
Trying to get a Check and Status summary
1 parent d1d60ff commit bfd6bfb

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,29 +99,16 @@ public async Task<Page<PullRequestListItemModel>> ReadPullRequests(
9999
{
100100
suite.Conclusion,
101101
suite.Status,
102-
CheckRuns = suite.CheckRuns(null, null, null, null, null).AllPages()
103-
.Select(run => new
104-
{
105-
run.Title,
106-
run.Name,
107-
run.Summary,
108-
run.Conclusion,
109-
run.Status,
110-
run.Text,
111-
Annotations = run.Annotations(null, null, null, null).AllPages()
112-
.Select(annotation => new
113-
{
114-
annotation.Title,
115-
annotation.Message,
116-
annotation.WarningLevel,
117-
annotation.Filename,
118-
annotation.BlobUrl,
119-
annotation.StartLine,
120-
annotation.EndLine,
121-
annotation.RawDetails
122-
}).ToList()
123-
}).ToList()
124-
})).ToList(),
102+
}).ToList()
103+
).ToList().FirstOrDefault(),
104+
Statuses = pr.Commits(null, null, 1, null).Nodes.Select(commit =>
105+
commit.Commit.Status.Contexts
106+
.Select(context => new
107+
{
108+
context.Context,
109+
context.State,
110+
}).ToList()
111+
).ToList().FirstOrDefault(),
125112
Author = new ActorModel
126113
{
127114
Login = pr.Author.Login,
@@ -871,6 +858,7 @@ class ListItemAdapter : PullRequestListItemModel
871858
public IList<ReviewAdapter> Reviews { get; set; }
872859

873860
public object CheckSuites { get; set; }
861+
public object Statuses { get; set; }
874862
}
875863

876864
class ReviewAdapter

0 commit comments

Comments
 (0)