@@ -97,7 +97,7 @@ public IReadOnlyList<InlineAnnotationModel> BuildAnnotations(
9797 relativePath = relativePath . Replace ( "\\ " , "/" ) ;
9898
9999 return pullRequest . CheckSuites
100- ? . SelectMany ( checkSuite => checkSuite . CheckRuns . Select ( checkRun => new { checkSuite , checkRun } ) )
100+ ? . SelectMany ( checkSuite => checkSuite . CheckRuns . Select ( checkRun => new { checkSuite , checkRun } ) )
101101 . SelectMany ( arg =>
102102 arg . checkRun . Annotations
103103 . Where ( annotation => annotation . Path == relativePath )
@@ -361,17 +361,21 @@ public virtual async Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddr
361361 var result = await connection . Run ( readPullRequest , vars ) ;
362362
363363 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 ) ;
366364
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 > ( ) ;
368372
369373 if ( lastCommitModel . CheckSuites == null )
370374 {
371375 result . CheckSuites = Array . Empty < CheckSuiteModel > ( ) ;
372376 }
373377 else
374- {
378+ {
375379 result . CheckSuites = lastCommitModel . CheckSuites ;
376380 foreach ( var checkSuite in result . CheckSuites )
377381 {
@@ -838,8 +842,8 @@ async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress addres
838842 commit => new LastCommitAdapter
839843 {
840844 Statuses = commit . Commit . Status == null ? null : commit . Commit . Status
841- . Select ( context => context == null
842- ? null
845+ . Select ( context => context == null
846+ ? null
843847 : context . Contexts
844848 . Select ( statusContext => new StatusModel
845849 {
@@ -871,7 +875,7 @@ async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress addres
871875 static void BuildPullRequestThreads ( PullRequestDetailModel model )
872876 {
873877 var commentsByReplyId = new Dictionary < string , List < CommentAdapter > > ( ) ;
874-
878+
875879 // Get all comments that are not replies.
876880 foreach ( CommentAdapter comment in model . Reviews . SelectMany ( x => x . Comments ) )
877881 {
@@ -961,5 +965,5 @@ class LastCommitAdapter
961965
962966 public string HeadSha { get ; set ; }
963967 }
964- }
968+ }
965969}
0 commit comments