runner: restate the run's configuration in every PR comment - #20
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Why re-rendered rather than quoted verbatim
The trigger comment and the run it produces describe different things. One
run benchmark tpch clickbench_1fans out into a job — and a pod, and a comment — per name, and a barerun benchmarksexpands 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_requestasserts the rendering round-trips throughdetect_benchmark. Empty sections are omitted, so an unconfigured run renders as justrun benchmark tpch. Values are always quoted so"1"doesn't read back as an int.Changes
controller/src/runner/trigger.rs(new) —Comparison::line()andconfig_block(), with testsjob_manager.rs— passesSHARED_ENV_VARSas 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 sharedenv: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— newshared_env_varsfieldbench_datafusion.rs,bench_arrow.rs— both comments use the shared helpers; the running comment's ad-hocBENCH_NAME=/BENCH_FILTER=lines are now covered by the blockbin/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 copyOne subtlety:
BENCH_FILTERreaches the runner both asbench_filterand as a shared env var when set throughenv: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-targetsclean,cargo fmt --checkclean.🤖 Generated with Claude Code