Skip to content

runner: restate the run's configuration in every PR comment - #20

Merged
adriangb merged 1 commit into
mainfrom
claude/response-comment-triggers-259703
Jul 31, 2026
Merged

runner: restate the run's configuration in every PR comment#20
adriangb merged 1 commit into
mainfrom
claude/response-comment-triggers-259703

Conversation

@adriangb

Copy link
Copy Markdown
Owner

Result comments link back to the triggering comment, but the link alone doesn't say what the run did — you have to click through to find out which benchmark, which refs, which env vars. Every runner comment (running, completed, and failed) now opens with the comparison line and a collapsed Run configuration block:

🤖 Benchmark completed (GKE) | [trigger](…#issuecomment-100)

**Instance:** `c4a-standard-48` (12 vCPU / 65 GiB)

Comparing my-branch (aaaa111bbbb) to v45.0.0 [diff](…/compare/cccc222dddd..aaaa111bbbb)

<details><summary>Run configuration</summary>

```yaml
run benchmark tpch
env:
  CARGO_BUILD_JOBS: "1"
baseline:
  ref: "v45.0.0"
changed:
  env:
    DATAFUSION_RUNTIME_MEMORY_LIMIT: "2G"
… (lscpu, Details, Memory Pool Peaks, Resource Usage unchanged) ```

Why re-rendered rather than quoted verbatim

The trigger comment and the run it produces describe different things. One run benchmark tpch clickbench_1 fans out into a job — and a pod, and a comment — per name, and a bare run benchmarks expands to the repo's default suite. Quoting the trigger into each result comment would list benchmarks that comment's own run never touched.

So the block is re-rendered from the job, in the same YAML the trigger accepts. Pasting it back into a PR reproduces that single run; yaml_re_parses_as_the_same_request asserts the rendering round-trips through detect_benchmark. Empty sections are omitted, so an unconfigured run renders as just run benchmark tpch. Values are always quoted so "1" doesn't read back as an int.

Changes

  • controller/src/runner/trigger.rs (new) — Comparison::line() and config_block(), with tests
  • job_manager.rs — passes SHARED_ENV_VARS as a JSON map. These were already set individually on the pod, but the runner couldn't tell which of its env vars came from the trigger's shared env: block and which the controller injected (sccache, tokens, …). The map is for reporting only; it changes nothing about what the benchmark sees.
  • runner/config.rs — new shared_env_vars field
  • bench_datafusion.rs, bench_arrow.rs — both comments use the shared helpers; the running comment's ad-hoc BENCH_NAME= / BENCH_FILTER= lines are now covered by the block
  • bin/runner.rs — failure comments get the config block too, without a comparison line (a failure can precede either checkout)
  • README.md — documents the block and why it isn't a verbatim copy

One subtlety: BENCH_FILTER reaches the runner both as bench_filter and as a shared env var when set through env: in a trigger comment (as the README documents), so it renders once — as a # BENCH_FILTER: note only in the main-tracking workflow case, where it's set outside the env block.

Testing

cargo test -p benchmark-controller — 154 passed, 0 failed. cargo clippy --all-targets clean, cargo fmt --check clean.

🤖 Generated with Claude Code

Result comments linked back to the trigger but didn't say what the run
actually did, so reading one meant clicking through. Every runner comment
— running, completed, and failed — now opens with the comparison line and
a collapsed "Run configuration" block holding the benchmark names, refs,
and env vars.

The block is re-rendered from the job rather than quoted from the trigger
comment, because the two describe different things: one `run benchmark a b`
fans out into a job (and a comment) per name, and a bare `run benchmarks`
expands to the repo's default suite, so a verbatim quote would list
benchmarks the comment's own run never touched. It is emitted in the same
YAML the trigger accepts, so pasting it back into a PR reproduces that one
run; a test asserts the rendering re-parses into the same request.

The runner previously couldn't tell which of its env vars came from the
trigger's shared `env:` block and which the controller injected (sccache,
tokens, …), since shared vars are set individually on the pod. Pass them
along as a JSON map too, for reporting only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adriangb
adriangb merged commit 586dbb0 into main Jul 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant