Skip to content

Build: Post bench reports as Semantic Performance Bot#147

Merged
jlukic merged 2 commits intomainfrom
ci/bench-app-token
Apr 15, 2026
Merged

Build: Post bench reports as Semantic Performance Bot#147
jlukic merged 2 commits intomainfrom
ci/bench-app-token

Conversation

@jlukic
Copy link
Copy Markdown
Member

@jlukic jlukic commented Apr 15, 2026

Threads an installation token from the newly-registered Semantic Performance Bot GitHub App through both jobs in `benchmarks-report.yml`. Same permission surface as `GITHUB_TOKEN`; branded identity, not widened scope.

What changes

  • Comment job — mints a bot token at the top of the job, uses it for artifact download, PR-number resolution, and the comment post/update step. PR comments appear under the bot's identity + avatar rather than `github-actions[bot]`.
  • History job — same token-gen step. The archival commit to main is authored by the bot, and the checkout's persisted credential helper handles the `git push` authentication.

Secrets consumed

Two, both already configured:

  • `SEMANTIC_PERF_BOT_APP_ID`
  • `SEMANTIC_PERF_BOT_PRIVATE_KEY`

One thing to verify

The archival commit's author email uses the slug `semantic-performance-bot` in the `+[bot]@users.noreply.github.com` format. If the app was registered under a different slug, that's a one-line fix in `benchmarks-report.yml`. GitHub still attributes the commit to the app either way — the slug only affects the rendered author email + avatar linkage in the commit view.

Acceptance test

After this merges, the next PR that touches `packages/**` posts its bench comment under the bot's identity and avatar. One-commit revert restores `GITHUB_TOKEN` if anything's off.

Bundled

`docs/public/images/{heap,performance}-avatar.png` — the avatar assets that land with the workflow that uses them.

Swap the comment job and the history-archive job from `GITHUB_TOKEN` to
an installation token minted via `actions/create-github-app-token@v1`,
driven by the two secrets already set up in repo settings:

- SEMANTIC_PERF_BOT_APP_ID
- SEMANTIC_PERF_BOT_PRIVATE_KEY

Same permission surface as before — Pull requests (write), Contents
(write), Actions (read). Branded identity, not widened scope.

Effect downstream:

- PR bench comments post as the bot with its uploaded SUI-themed avatar
  instead of the generic `github-actions[bot]` face.
- Archival commits on main are authored by the bot, so git blame /
  history listings clearly show which chunk of main was machine-
  authored bench bookkeeping vs. developer work.

Commit-author fields on the archive step use the
`<app-id>+<app-slug>[bot]@users.noreply.github.com` format. Slug
assumed to be `semantic-performance-bot` — if the app was registered
under a different slug, that's a one-line fix in this file. GitHub
still attributes the commit to the app regardless, the slug just
affects the display email and avatar linkage.

Also bundles `docs/public/images/{heap,performance}-avatar.png` staged
alongside — the avatar assets land with the workflow change that uses
them.

Acceptance test: next PR that touches `packages/**` after this merges
posts its bench comment under the bot's identity. One-commit revert
restores `GITHUB_TOKEN` if anything's off.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
semantic-next Ready Ready Preview, Comment Apr 15, 2026 7:44pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mcp Ignored Ignored Preview Apr 15, 2026 7:44pm

Request Review

…l out

Two corrections to the pull_request path filter now that we've exercised
the workflow enough to see the gaps:

- Add `tools/bench-reporter/**`. A PR that modifies only reporter.js or
  append-history.js previously didn't trigger benchmarks, yet those
  scripts run from the PR-head checkout when the report workflow fires,
  so the change DOES take effect on the PR's own comment. Missed coverage.

- Drop `.github/workflows/benchmarks-report.yml`. This workflow file is
  the `workflow_run` handler — GitHub runs it from main's copy, not the
  PR's, which means a PR that modifies only this file cannot validate
  its own change inline anyway. Triggering benchmarks on such a PR
  wastes ~10 min of CI without producing actionable signal.

`benchmarks.yml` itself stays in the filter — it's the `pull_request`
entry point and GitHub runs it from PR-head YAML, so self-validation
works.
@jlukic jlukic merged commit cc52ae2 into main Apr 15, 2026
14 of 15 checks passed
@jlukic jlukic deleted the ci/bench-app-token branch April 15, 2026 19:43
@jlukic jlukic restored the ci/bench-app-token branch April 15, 2026 19:48
@jlukic jlukic deleted the ci/bench-app-token branch April 15, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI modifies continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant