@@ -97,7 +97,7 @@ public IReadOnlyList<InlineAnnotationModel> BuildAnnotations(
97
97
relativePath = relativePath . Replace ( "\\ " , "/" ) ;
98
98
99
99
return pullRequest . CheckSuites
100
- ? . SelectMany ( checkSuite => checkSuite . CheckRuns . Select ( checkRun => new { checkSuite , checkRun } ) )
100
+ ? . SelectMany ( checkSuite => checkSuite . CheckRuns . Select ( checkRun => new { checkSuite , checkRun } ) )
101
101
. SelectMany ( arg =>
102
102
arg . checkRun . Annotations
103
103
. Where ( annotation => annotation . Path == relativePath )
@@ -361,17 +361,21 @@ public virtual async Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddr
361
361
var result = await connection . Run ( readPullRequest , vars ) ;
362
362
363
363
var apiClient = await apiClientFactory . Create ( address ) ;
364
- var files = await apiClient . GetPullRequestFiles ( owner , name , number ) . ToList ( ) ;
365
- var lastCommitModel = await GetPullRequestLastCommitAdapter ( address , owner , name , number ) ;
366
364
367
- result . Statuses = ( IReadOnlyList < StatusModel > ) lastCommitModel . Statuses ?? Array . Empty < StatusModel > ( ) ;
365
+ var files = await log . TimeAsync ( nameof ( apiClient . GetPullRequestFiles ) ,
366
+ async ( ) => await apiClient . GetPullRequestFiles ( owner , name , number ) . ToList ( ) ) ;
367
+
368
+ var lastCommitModel = await log . TimeAsync ( nameof ( GetPullRequestLastCommitAdapter ) ,
369
+ ( ) => GetPullRequestLastCommitAdapter ( address , owner , name , number ) ) ;
370
+
371
+ result . Statuses = ( IReadOnlyList < StatusModel > ) lastCommitModel . Statuses ?? Array . Empty < StatusModel > ( ) ;
368
372
369
373
if ( lastCommitModel . CheckSuites == null )
370
374
{
371
375
result . CheckSuites = Array . Empty < CheckSuiteModel > ( ) ;
372
376
}
373
377
else
374
- {
378
+ {
375
379
result . CheckSuites = lastCommitModel . CheckSuites ;
376
380
foreach ( var checkSuite in result . CheckSuites )
377
381
{
@@ -838,8 +842,8 @@ async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress addres
838
842
commit => new LastCommitAdapter
839
843
{
840
844
Statuses = commit . Commit . Status == null ? null : commit . Commit . Status
841
- . Select ( context => context == null
842
- ? null
845
+ . Select ( context => context == null
846
+ ? null
843
847
: context . Contexts
844
848
. Select ( statusContext => new StatusModel
845
849
{
@@ -871,7 +875,7 @@ async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress addres
871
875
static void BuildPullRequestThreads ( PullRequestDetailModel model )
872
876
{
873
877
var commentsByReplyId = new Dictionary < string , List < CommentAdapter > > ( ) ;
874
-
878
+
875
879
// Get all comments that are not replies.
876
880
foreach ( CommentAdapter comment in model . Reviews . SelectMany ( x => x . Comments ) )
877
881
{
@@ -961,5 +965,5 @@ class LastCommitAdapter
961
965
962
966
public string HeadSha { get ; set ; }
963
967
}
964
- }
968
+ }
965
969
}
0 commit comments