Create the GitHub Check as in progress before benchmarks run - #950
Conversation
🤖 Claude Code ReviewPR: #950 I've completed a thorough review of the diff. Here is my assessment. Code Review: Create the GitHub Check as in-progress before benchmarks runSummaryThis PR creates the GitHub Check with an Strengths
Observations (non-blocking)
Verification notes
Overall: approve. The handle lifecycle is careful and correct on all reachable paths, the refactor reduces duplication, and tests/docs are in good shape. No correctness or security issues found; the notes above are pre-existing-behavior context and minor efficiency observations. Model: claude-opus-4-8 |
|
| Branch | claude/github-check-in-progress |
| Testbed | intel-v1 |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| Adapter::Json | 📈 view plot 🚷 view threshold | 4.71 µs(+1.55%)Baseline: 4.64 µs | 4.90 µs (96.21%) |
| Adapter::Magic (JSON) | 📈 view plot 🚷 view threshold | 4.57 µs(+1.24%)Baseline: 4.51 µs | 4.72 µs (96.80%) |
| Adapter::Magic (Rust) | 📈 view plot 🚷 view threshold | 25.51 µs(-0.37%)Baseline: 25.61 µs | 26.77 µs (95.29%) |
| Adapter::Rust | 📈 view plot 🚷 view threshold | 3.51 µs(+0.52%)Baseline: 3.49 µs | 3.61 µs (97.32%) |
| Adapter::RustBench | 📈 view plot 🚷 view threshold | 3.51 µs(+0.56%)Baseline: 3.49 µs | 3.60 µs (97.46%) |
df4ebfd to
5a1932d
Compare
|
Addressed the review findings in the latest push (5a1932d): Finding 1 (orphaned check on the Finding 2 (failed remote job completes the check from the fetched report): deferred. This mirrors the pre-existing behavior, where the check was also created from whatever report was displayed. Making a failed or canceled remote job force a Finding 3 (permission help text printed twice): declined. The two warnings come from two distinct failed API calls (start and complete), and each message names the operation that failed. Suppressing the second would require threading state between the two call sites to dedupe a best-effort log line, which does not seem worth the complexity. Also in this push: the in-progress and failed check summaries now render the same branded Local verification on the new commit: |
Create the GitHub Check with an in_progress status before the benchmark command runs, then complete that same check run with the results once they finish. On a rerun, the fresh in progress check immediately supersedes the stale conclusion left by the previous run. If bencher run exits with an error before the results are posted, the check is completed as failed so it does not linger in progress forever. If the in progress check cannot be created, bencher run falls back to the previous behavior of creating the check with a conclusion at the end of the run. Closes #945
5a1932d to
467986b
Compare
|
Addressed the second round of review feedback in 467986b: Issue 1 (duplicate permission warning): partially addressed. The start phase warning now notes that the check will still be created when the results are posted, so the second warning reads as the expected follow up rather than a mystery repeat. Full deduplication would require threading state between the two best effort call sites, which still does not seem worth it for a log line. Issue 2 (header markup duplication): fixed. The shared title markup now lives in a single Issue 3 (fail fallback invariant): addressed via comment. The Local verification: |
Summary
bencher run --github-actionscurrently creates theBencher ReportGitHub Check only after the benchmark completes, always with a terminal conclusion. On a rerun, the stale conclusion from the previous run lingers until the new benchmark finishes, which can take hours for slow benchmarks, and a cancelled job leaves the stale conclusion forever.This PR creates the check with an
in_progressstatus before the benchmark command runs and then completes that same check run with the results once they finish:GitHubActions::start_checkcreates the in progress check before the benchmark runs (best effort: failures log a warning and never abort the run)CheckRunHandleand threaded down to the existing CI completion step, which now updates the check run in place instead of creating a new onebencher runexits with an error before the results are posted (harness failure without--allow-failure, report send failure, remote job poll error or timeout), the check is completed asfailurewith a short summary instead of lingering in progress--dry-runnever creates a check, same as beforeOption::takeat the completion site, so the error path never overwrites a check that was already completed with the full report (for example the--error-on-alertpath)Notes
--detachpath keeps its existing semantics: the check is completed at submit time with the empty results report; it is just more visible now because the in progress check appears first.retryfeature transparently retries 5xx responses on the in progress create, so transient GitHub hiccups do not even need the fallback path.Testing
in_progresslands before the benchmark command executes, then PATCH withconclusion: successand the report summary), failing benchmark (PATCH withconclusion: failure),--dry-run(zero GitHub requests), and a rejected in progress create (falls back to POST with a conclusion)cargo nextest run -p bencher_cli,cargo clippy --all-targets --all-features -- -Dwarnings,cargo check --no-default-features, andcargo fmtare all cleanDocs
--github-actionssection for all nine languagesPending