File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1042,15 +1042,28 @@ await client.Issue.Milestone.Update(
10421042 {
10431043 Logger . Information ( "Artifact not yet available (attempt {Attempt}/5)" , attempt + 1 ) ;
10441044 }
1045+ catch ( VssServiceException ex )
1046+ {
1047+ Logger . Information ( ex , "Error looking up artifact (attempt {Attempt}/5)" , attempt + 1 ) ;
1048+ }
10451049 }
10461050
1051+ string reportLink ;
10471052 if ( reportUrl is null )
10481053 {
1049- throw new Exception ( "Could not resolve single-file report URL" ) ;
1054+ // Fall back to the build's artifacts page: not a direct link to the report, but it's
1055+ // deterministic, so we can always give people _some_ way to get to the full report.
1056+ var artifactsPageUrl = $ "{ AzureDevopsOrganisation } /{ GitHubRepositoryName } /_build/results?buildId={ AzureDevopsBuildId . Value } &view=artifacts&pathAsName=false&type=publishedArtifacts";
1057+ Logger . Warning ( "Could not resolve single-file report URL, linking to the build artifacts page instead" ) ;
1058+ reportLink = $ "π **[Download the full report from the build artifacts β]({ artifactsPageUrl } )**";
1059+ }
1060+ else
1061+ {
1062+ var viewerUrl = $ "https://andrewlock.github.io/merview/?zen=1&url={ Uri . EscapeDataString ( reportUrl ) } ";
1063+ reportLink = $ "π **[View the full report (charts + all metrics) β]({ viewerUrl } )**";
10501064 }
10511065
1052- var viewerUrl = $ "https://andrewlock.github.io/merview/?zen=1&url={ Uri . EscapeDataString ( reportUrl ) } ";
1053- var fullMarkdown = summaryMarkdown + $ "\n \n π **[View the full report (charts + all metrics) β]({ viewerUrl } )**";
1066+ var fullMarkdown = summaryMarkdown + "\n \n " + reportLink ;
10541067
10551068 Logger . Information ( "Updating PR comment on GitHub" ) ;
10561069 await ReplaceCommentInPullRequest ( prNumber , "## Execution-Time Benchmarks Report" , fullMarkdown ) ;
You canβt perform that action at this time.
0 commit comments