Repository navigation
ci(cli): add a full benchmark for integration-heavy commands - #7412
Prashansa-K wants to merge 13 commits into
Conversation
The benchmark comment holds a Lightweight Commands and an Integration Heavy Commands section. Each writer replaces only its own section, verifies it landed, and retries when another writer overwrote it. Previous runs record the result each section replaced. /bench full dispatches the stack benchmark workflow on the pull request's branch and refreshes the lightweight section only when it is behind the head commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ner counts The benchmark harness runs workloads that need a local stack: untimed setup and teardown shared per run or per block of launches, a stack switch, a runtime, fixtures, a shared native artifact cache, per-workload run counts, and tracing limits. Reports add container operation counts, a runtime column, a section name, shard packing, and a report merge. Every launch disables product telemetry. The stack manifest and fixtures are generated and committed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs from the Actions UI, the /bench full command, and a weekly schedule against the latest stable release. Plans shards, builds both binaries once, measures each shard on one runner, and reports to the job summary and the pull request comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CLI benchmarkLightweight Commands: no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 134.0 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
Verified all nine findings against the checked-out code: two major, five minor, and two nits are confirmed, with no duplicates. Controlled reproductions demonstrated lost concurrent updates, broken table rendering, discarded history, and skipped refresh of failed results. All 89 existing benchmark-comment tests pass but miss these cases. Both independent reviews were available; no branch-sync or next-context files were present.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟠 MAJOR | .github/scripts/cli-bench/post-comment.ts:290 |
concurrency |
codex | Concurrent section writers can both report success while a stale write permanently removes the other writer's result and history. |
| 🟠 MAJOR | apps/cli/scripts/bench-cli.ts:413 |
error-handling |
codex | Failed setup commands do not invalidate benchmark measurements, allowing incomplete workloads to produce apparently valid comparisons. |
| 🟡 MINOR | .github/scripts/cli-bench/post-comment.ts:68 |
correctness |
claude | Doubling all backslashes during sanitization breaks the escaped pipes produced for benchmark table cells. |
| 🟡 MINOR | .github/scripts/cli-bench/rerun.ts:211 |
correctness |
claude | /bench full treats a failed Lightweight Commands section at the head SHA as current and does not refresh it. |
| 🟡 MINOR | .github/scripts/cli-bench/post-comment.ts:168 |
data-loss |
claude | Oversized comment sections can erase all stored run history, and equal section budgets can unnecessarily truncate the larger section. |
| 🟡 MINOR | apps/cli/bench/workloads.stack.json:205 |
benchmark-correctness |
codex | The migration-up and db-push-local workloads measure migrations that setup has already applied. |
| 🟡 MINOR | apps/cli/docs/tracing-monitoring.md:269 |
documentation |
codex | The documentation incorrectly states that dispatched workflows execute only from the default branch. |
| ⚪ NIT | .github/scripts/cli-bench/post-comment.ts:61 |
readability |
claude | The zero-width-space constant and related test expressions use an invisible literal instead of an explicit Unicode escape, obscuring their intent. |
| ⚪ NIT | .github/scripts/cli-bench/post-comment.test.ts:132 |
test-quality |
codex | The test claiming the benchmark marker appears exactly once does not assert uniqueness and passes with duplicate markers. |
Stats
Claude findings: 4 · Codex findings: 5 · Confirmed: 9 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
… outputs Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep escaped table pipes through sanitizing, rebuild a comment another writer changed before writing it, keep each section's newest run and reallocate unused space when truncating, refresh a failed lightweight section on /bench full, skip launches when a setup step fails, and stage the migration fixture after setup for the migration workloads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lightweight and integration-heavy benchmarks each keep their own pull request comment, identified by its own hidden marker and carrying its own history and re-run note. This removes the shared-comment section markers, cross-section size budgeting and the read-back retry loop. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Created a temporary PR to show how the command output for Workflow run: https://github.com/supabase/cli/actions/runs/41058498633/attempts/1 |
Coly010
left a comment
There was a problem hiding this comment.
nice, the dry run on #7415 made this a lot easier to review, thanks for setting that up
a few things, none blocking since it's report-only:
- #7415 is basically an A/A run (no cli source changes, binary size unchanged) but the comment still flags 5 of 27 commands, e.g.
status+71% anddb lint-23%. i think it's the block-scoped workloads: withruns: 10andBLOCK_SIZE5 each build only gets two stack sessions, so session-to-session noise lands outside the base min-max. could we alternate in smaller blocks, or only call something slower/faster when it shifts in every block? otherwise folk will end up chasing regressions that aren't there - the lightweight comment concurrency in
cli-bench.ymlsays a waiting writer is never cancelled, but with the defaultqueue: singlegithub cancels the pending one when a newer one queues, so its result never gets written. addingqueue: maxto both groups should sort it (slim-release-published.ymlalready uses it, so jactionlint is happy with it) - teardown runs with the build under test and the exit code is dropped (
bench-cli.ts:521). if a branch breaksstop, the next unit (usually base) failsstarton the port and the comment ends up blaming base. could teardown failures go into the report, or a hard clean by project label after teardown? - small one: rows are labelled by command only, so gen types small/medium/large and db diff cold/warm show up as identical rows. the workload id next to the command would help
happy for any of these to be follow-ups if you'd rather, otherwise looks good to me!
Adds the second tier of the CLI benchmark: the commands that need a running local stack or
database. It stays report only; it never blocks a merge and is not a required check.
/bench fullon a pull request (same permission rules as/bench) dispatches the fullworkflow on the pull request's branch and re-measures the integration-heavy benchmark. It
refreshes the lightweight benchmark comment only when that comment is behind the head commit. It
replies when a run is already in progress, when the branch has no full benchmark workflow yet, or
when the pull request is a draft, from a fork, or not into
develop.workflow_dispatchon any branch withworkloads,runtime, andbase(the merge base, or a release tag). The job summary always has the report; the pull request
comments are updated when the base is the merge base and the branch has exactly one open pull
request into
develop.developagainst the latest stable release, resolved atrun time. The report goes to the job summary and artifacts. Slack notifications come later, once
the data proves valid and useful.
lightweight benchmark comment. Each comment shows the commit it measured, keeps its own previous
runs, and ends with a note on which command re-runs it. Writes to each comment are serialized per
pull request.
start,status,stop,db start, andstack start|status|stop), database work against the local stack (db reset,db query,test db,gen typesat three schema sizes,db diffcold and warm,db dump,db lint), and migrations(
migration up,db push --local,migration list). Migration workloads add their migrationsafter the stack starts, so the measured command applies them.
roughly ten minutes; base and branch alternate on one runner, and one workload runs at a time.
binary size. Benchmark runs never send product telemetry.
Changed:
apps/cli/scripts/bench-cli.ts,bench-report.ts,bench-summary.ts,.github/workflows/cli-bench.yml,.github/scripts/cli-bench/*, andapps/cli/docs/tracing-monitoring.md. Added:.github/workflows/cli-bench-full.yml,.github/scripts/cli-bench/full-plan.ts,apps/cli/scripts/bench-pack.ts,bench-merge.ts,bench-fixtures.ts, andapps/cli/bench/(the full benchmark manifest and fixtures).GitHub runs dispatch, schedule, and comment-triggered workflows only from the default branch, so the
workflow's actual runs (the Actions UI dispatch,
/bench full, and the schedule) cannot be testedbefore this merges to
develop. They get their first real run after the merge.🤖 Generated with Claude Code