From 86a4208f02035f9831c8cdbd5bfb5b7422e01b9f Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 29 Mar 2026 17:00:48 +0900 Subject: [PATCH 1/3] ci(perf-benchmark): Remove tags from commit SHAs for GitHub autolink GitHub auto-links 7+ char commit SHAs in PR comments, but wrapping them in HTML tags prevented this. Remove the tags so SHAs become clickable links automatically. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/scripts/perf-benchmark/bench-comment.mjs | 2 +- .github/scripts/perf-benchmark/bench-pending.mjs | 4 ++-- .github/scripts/perf-benchmark/bench-utils.mjs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/perf-benchmark/bench-comment.mjs b/.github/scripts/perf-benchmark/bench-comment.mjs index 8077cfded..c2cb1681f 100644 --- a/.github/scripts/perf-benchmark/bench-comment.mjs +++ b/.github/scripts/perf-benchmark/bench-comment.mjs @@ -38,7 +38,7 @@ const windowsStr = formatResult(readResult('windows-latest')); const jsonComment = ``; let body = `\n${jsonComment}\n`; body += '## \u26a1 Performance Benchmark\n\n'; -body += `\n`; +body += `
Latest commit:${shortSha} ${esc(commitMsg)}
\n`; body += `\n`; body += `\n`; body += `\n`; diff --git a/.github/scripts/perf-benchmark/bench-pending.mjs b/.github/scripts/perf-benchmark/bench-pending.mjs index 1f6533960..16c98e347 100644 --- a/.github/scripts/perf-benchmark/bench-pending.mjs +++ b/.github/scripts/perf-benchmark/bench-pending.mjs @@ -12,7 +12,7 @@ let history = extractHistory(oldBody); if (oldBody.includes('\u2705 Benchmark complete!')) { // Extract only the main result table (before any
block) const mainSection = oldBody.split('
')[0] || ''; - const commitMatch = mainSection.match(/Latest commit:<\/strong><\/td>
Latest commit:${shortSha} ${esc(commitMsg)}
Status:\u2705 Benchmark complete!
Ubuntu:${ubuntuStr}
macOS:${macosStr}
([a-f0-9]+)<\/code>\s*(.*?)<\/td>/); + const commitMatch = mainSection.match(/Latest commit:<\/strong><\/td>([a-f0-9]+)\s*(.*?)<\/td>/); const prevSha = commitMatch ? commitMatch[1] : ''; const prevMsg = commitMatch ? commitMatch[2] : ''; if (prevSha) { @@ -33,7 +33,7 @@ history = history.slice(0, 50); const jsonComment = ``; let body = `\n${jsonComment}\n`; body += '## \u26a1 Performance Benchmark\n\n'; -body += `\n`; +body += `
Latest commit:${shortSha} ${esc(commitMsg)}
\n`; body += '
Latest commit:${shortSha} ${esc(commitMsg)}
Status:\u26a1 Benchmark in progress...
\n\n'; body += `[Workflow run](${runUrl})`; diff --git a/.github/scripts/perf-benchmark/bench-utils.mjs b/.github/scripts/perf-benchmark/bench-utils.mjs index fef64dfa0..3e15cb5cb 100644 --- a/.github/scripts/perf-benchmark/bench-utils.mjs +++ b/.github/scripts/perf-benchmark/bench-utils.mjs @@ -24,7 +24,7 @@ export function renderHistory(hist) { if (hist.length === 0) return ''; return hist .map((h) => { - const label = `${h.sha}${h.msg ? ` ${h.msg}` : ''}`; + const label = `${h.sha}${h.msg ? ` ${h.msg}` : ''}`; const osRows = ['ubuntu', 'macos', 'windows'] .filter((os) => h[os] && h[os] !== '-') .map((os) => { From 362a8ebe7c5452ff1547e794415fb66be6ac32bf Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 29 Mar 2026 21:05:20 +0900 Subject: [PATCH 2/3] fix(perf-benchmark): Make regex backwards-compatible with old format Make tags optional in the commit SHA regex so existing benchmark comments with the old format are still parsed correctly during transition. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/scripts/perf-benchmark/bench-pending.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/perf-benchmark/bench-pending.mjs b/.github/scripts/perf-benchmark/bench-pending.mjs index 16c98e347..50f33ea10 100644 --- a/.github/scripts/perf-benchmark/bench-pending.mjs +++ b/.github/scripts/perf-benchmark/bench-pending.mjs @@ -12,7 +12,7 @@ let history = extractHistory(oldBody); if (oldBody.includes('\u2705 Benchmark complete!')) { // Extract only the main result table (before any
block) const mainSection = oldBody.split('
')[0] || ''; - const commitMatch = mainSection.match(/Latest commit:<\/strong><\/td>
([a-f0-9]+)\s*(.*?)<\/td>/); + const commitMatch = mainSection.match(/Latest commit:<\/strong><\/td>(?:)?([a-f0-9]+)(?:<\/code>)?\s*(.*?)<\/td>/); const prevSha = commitMatch ? commitMatch[1] : ''; const prevMsg = commitMatch ? commitMatch[2] : ''; if (prevSha) { From d2563188c056de01149547079be07efb2352e9ab Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 29 Mar 2026 21:15:31 +0900 Subject: [PATCH 3/3] style(perf-benchmark): Format regex with Biome Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/scripts/perf-benchmark/bench-pending.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/perf-benchmark/bench-pending.mjs b/.github/scripts/perf-benchmark/bench-pending.mjs index 50f33ea10..bb6ae2179 100644 --- a/.github/scripts/perf-benchmark/bench-pending.mjs +++ b/.github/scripts/perf-benchmark/bench-pending.mjs @@ -12,7 +12,9 @@ let history = extractHistory(oldBody); if (oldBody.includes('\u2705 Benchmark complete!')) { // Extract only the main result table (before any
block) const mainSection = oldBody.split('
')[0] || ''; - const commitMatch = mainSection.match(/Latest commit:<\/strong><\/td>
(?:)?([a-f0-9]+)(?:<\/code>)?\s*(.*?)<\/td>/); + const commitMatch = mainSection.match( + /Latest commit:<\/strong><\/td>(?:)?([a-f0-9]+)(?:<\/code>)?\s*(.*?)<\/td>/, + ); const prevSha = commitMatch ? commitMatch[1] : ''; const prevMsg = commitMatch ? commitMatch[2] : ''; if (prevSha) {