File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 fetchPreviousRun ,
1212 postToSiteApi ,
1313} from "./reporters/site-api.ts" ;
14+ import { formatCost , queryPreview } from "./reporters/github/github.ts" ;
1415import { DEFAULT_CONFIG , fetchAnalyzerConfig } from "./config.ts" ;
1516
1617async function runInCI (
@@ -95,10 +96,14 @@ async function runInCI(
9596
9697 // Block PR if regressions exceed thresholds
9798 if ( reportContext . comparison && reportContext . comparison . regressed . length > 0 ) {
98- const messages = reportContext . comparison . regressed . map (
99- ( q ) =>
100- ` - ${ q . hash } : cost ${ q . previousCost } → ${ q . currentCost } (+${ q . regressionPercentage . toFixed ( 1 ) } %)` ,
101- ) ;
99+ const messages = reportContext . comparison . regressed . map ( ( q ) => {
100+ const preview = queryPreview ( q . formattedQuery ) ;
101+ const cost = `cost ${ formatCost ( q . previousCost ) } → ${ formatCost ( q . currentCost ) } (+${ q . regressionPercentage . toFixed ( 1 ) } %)` ;
102+ const link = reportContext . runUrl
103+ ? `\n ${ reportContext . runUrl } /${ q . hash } `
104+ : "" ;
105+ return ` - ${ preview } : ${ cost } ${ link } ` ;
106+ } ) ;
102107 core . setFailed (
103108 `${ reportContext . comparison . regressed . length } untriaged regression(s) beyond threshold:\n${ messages . join ( "\n" ) } ` ,
104109 ) ;
You can’t perform that action at this time.
0 commit comments