Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 "- <benchmark> (Latency): <.../alerts/<id>>".
// The "View results" lines use /perf? URLs, so they do not match.
Expand All @@ -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 {
Expand Down Expand Up @@ -358,6 +359,7 @@ jobs:
'',
...repeated.map(b => `- \`${b}\``),
'',
`**Branch:** \`${ref}\``,
`**Run:** ${runUrl}`,
`**Previous run:** ${previousUrl}`,
'',
Expand All @@ -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,
});
Expand Down
Loading