diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 05af0de9f..6a46e9120 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -266,10 +266,11 @@ jobs: # Shared CI runners are noisy, so one alert on its own is usually a slow # runner, not a regression. Report only benchmarks that also alerted in - # this suite on the previous run. Each suite has its own issue: if one is - # open, add a comment to it instead of skipping. Every outcome, including - # an alert that is not reported, goes in the job summary, because the - # Bencher step is continue-on-error and the run stays green (#393). + # this suite on the previous run. Each suite and branch has its own issue, + # titled with the branch like the nightly fuzz issue: if one is open, add + # a comment to it instead of skipping. Every outcome, including an alert + # that is not reported, goes in the job summary, because the Bencher step + # is continue-on-error and the run stays green (#393). - name: Report regression if: steps.bencher.outcome == 'failure' uses: actions/github-script@v9 @@ -282,8 +283,7 @@ jobs: const suite = process.env.SUITE; const ref = process.env.BENCH_REF; const jobName = `bench / ${suite}`; - // main keeps its existing issue titles; other branches get their own. - const label = ref === 'main' ? suite : `${suite}, ${ref}`; + const label = `${suite}, ${ref}`; // Bencher lists each alert as "- (Latency): <.../alerts/>". // The "View results" lines use /perf? URLs, so they do not match. @@ -300,6 +300,7 @@ jobs: body = [ `Bencher failed in the nightly benchmark run (${label}) but listed no alerts. This is likely an API or upload error.`, '', + `**Branch:** \`${ref}\``, `**Run:** ${runUrl}`, ].join('\n'); } else { @@ -358,6 +359,7 @@ jobs: '', ...repeated.map(b => `- \`${b}\``), '', + `**Branch:** \`${ref}\``, `**Run:** ${runUrl}`, `**Previous run:** ${previousUrl}`, '', @@ -371,12 +373,20 @@ jobs: state: 'open', per_page: 100, }); - const title = ref === 'main' - ? `Benchmark regression: ${suite}` - : `Benchmark regression: ${suite} (${ref})`; - const existing = openIssues.find(i => !i.pull_request && i.title === title); + const title = `Benchmark regression: ${suite} (${ref})`; + // Issues for main used to be titled without the branch. Keep + // commenting on such an open issue, and give it the new title. + const legacyTitle = ref === 'main' ? `Benchmark regression: ${suite}` : null; + const existing = + openIssues.find(i => !i.pull_request && i.title === title) || + openIssues.find(i => !i.pull_request && legacyTitle && i.title === legacyTitle); let reported; if (existing) { + if (existing.title !== title) { + await github.rest.issues.update({ + owner, repo, issue_number: existing.number, title, + }); + } await github.rest.issues.createComment({ owner, repo, issue_number: existing.number, body, });