Skip to content

Fix GitHub Check creation failing to parse response (#894) - #902

Merged
epompeii merged 1 commit into
develfrom
claude/github-actions-workflow-docs-dzr53c
Jun 17, 2026
Merged

epompeii merged 1 commit into
develfrom
claude/github-actions-workflow-docs-dzr53c

Conversation

@epompeii

@epompeii epompeii commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Problem

bencher run --github-actions creates a Bencher Report GitHub Check on the PR head commit. The check was actually created (GitHub returns 201 Created), but octocrab 0.51 failed to deserialize the response, surfacing as a misleading failure:

Failed to create GitHub Check: JSON Error in pull_requests[0]: missing field `node_id` at line 1 column 4954

Reported in #894 (#894 (comment)) and reproduced at NomicFoundation/slang#1873.

Root cause

octocrab's CheckRun model deserializes the response pull_requests array into the full models::pulls::PullRequest type. In octocrab 0.51, PullRequest.node_id was a required String, but GitHub's create-check-run response returns only a minimal pull request representation (no node_id), so deserialization failed. The pull_requests array is only populated when the check is attached to a PR, which is why a plain push never surfaced it.

Bug: XAMPPRocky/octocrab#902

Fix

octocrab 0.52 relaxed PullRequest fields to Option to accept GitHub's SimplePullRequest payload, so the minimal check-run pull_requests objects now deserialize. This bumps octocrab 0.51 -> 0.53.1; the existing create_check_run().send() path then just works.

  • None of the octocrab APIs in use changed across 0.51 -> 0.53.1 (builder, create_check_run, issue comments, CommentId, CheckRunConclusion/CheckRunOutput). The one relevant breaking change (PR fields -> Option) does not touch Bencher, which never reads PullRequest fields directly. The only new transitive dependency is http-serde 2.1.1 (MIT/Apache-2.0).
  • Added a regression test that deserializes GitHub's minimal check-run pull_requests payload, guarding against an octocrab downgrade reintroducing the bug.
  • Log on successful check creation (previously the path only logged on failure).

Release with fix: https://github.com/XAMPPRocky/octocrab/releases/tag/v0.52.0

Verification

  • cargo build -p bencher_cli (no breaking API changes)
  • cargo test -p bencher_cli (17 pass, including the new test; doc tests pass)
  • cargo clippy --no-deps -p bencher_cli --all-targets --all-features -- -Dwarnings (clean)
  • cargo clippy on bencher_github_client (the other octocrab consumer; clean)
  • cargo fmt (no changes)

cargo deny check was not run locally (cargo-deny not installed in this environment); worth confirming in CI for the new http-serde dependency.

bencher run --github-actions creates a Bencher Report GitHub Check on
the PR head commit. Creating the check succeeded (HTTP 201), but octocrab
0.51 failed to deserialize the response: its CheckRun model parses the
response pull_requests array into the full PullRequest type, whose node_id
was a required String, while GitHub returns a minimal pull request
representation without node_id. This surfaced as a misleading failure:

  Failed to create GitHub Check: JSON Error in pull_requests[0]: missing
  field node_id at line 1 column 4954

octocrab 0.52 relaxed PullRequest fields to Option to accept GitHub's
SimplePullRequest payload, so the minimal check-run pull_requests objects
now deserialize. Bump octocrab to 0.53. None of the octocrab APIs in use
changed, and Bencher does not read PullRequest fields directly.

Add a regression test that deserializes GitHub's minimal check-run
pull_requests payload, and log on successful check creation.
@epompeii epompeii added the claude label Jun 17, 2026 — with Claude
@epompeii epompeii self-assigned this Jun 17, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​octocrab@​0.51.0 ⏵ 0.53.187100100100100

View full report

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

PR: #902
Base: devel
Head: claude/github-actions-workflow-docs-dzr53c
Commit: 6c693a8eca3b45f13d6ed7ebc1b87d9e354a01dc


This is a small, focused PR. Here's my review.

Review: Fix GitHub Check creation failing to parse response (#894)

Summary

The PR fixes a parsing failure when creating GitHub Checks by bumping octocrab 0.51 → 0.53. Newer octocrab models the minimal/simple PR representation in check-run responses with optional fields (node_id, etc.), which previously failed deserialization. It also adds a regression test and a user-facing log line on success.

Strengths

  • Correct root-cause fix. The dependency bump addresses the actual deserialization issue rather than papering over it.
  • TDD compliance. A regression test (octocrab_pull_request_accepts_minimal_check_run_payload) is added, matching CLAUDE.md's TDD requirement, and it documents the linkage to issue enable posting to GitHub Checks API #894.
  • Version declared in workspace Cargo.toml, per the "all dependency versions go in the workspace Cargo.toml" rule. Feature flags are preserved across the bump.
  • Consistent logging. The new cli_println_quietable!(log, "Created GitHub Check.") matches the existing quietable-logging idiom used throughout the file.

Observations / Minor

  1. cargo deny check should be run. Dependencies changed: a new transitive crate http-serde 2.1.1 was pulled in, octocrab bumped, and heck 0.4 → 0.5 shifted. CLAUDE.md requires cargo deny check when dependencies are added/updated. Worth confirming license/advisory checks pass for http-serde.

  2. Test is a serde-only guard, not an integration test. It validates Vec<PullRequest> deserialization in isolation rather than exercising create_check_run. That's a reasonable and cheap regression guard given the real path needs a live/mocked GitHub API, but it won't catch breakage elsewhere in the response shape (e.g., the CheckRun wrapper type). The intent is clearly documented, so this is acceptable; just be aware the guard is narrow.

  3. Comment accuracy nit. The test comment says "octocrab >= 0.52 models these as optional," while the workspace now pins 0.53. Harmless, but pinning the comment to the actually-used version (or just "octocrab 0.53") avoids confusion.

  4. Asymmetric success logging. create_check_run now logs "Created GitHub Check." on success, but the parallel create_pull_request_comment path (line 371-373) has no equivalent success message. Not a bug, but if the goal is observability for the check path, consider whether the comment path deserves the same for consistency. Optional.

Verdict

Low-risk, well-scoped fix with a sensible regression guard. No bugs, security, or performance concerns. Recommend running cargo deny check, cargo nextest run -p bencher_cli, and cargo fmt/clippy before merge to satisfy the project's dependency-update and code-quality gates.


Model: claude-opus-4-8

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchclaude/github-actions-workflow-docs-dzr53c
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
4.69 µs
(+2.32%)Baseline: 4.59 µs
4.82 µs
(97.28%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
4.56 µs
(+2.17%)Baseline: 4.47 µs
4.68 µs
(97.56%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
25.56 µs
(+0.43%)Baseline: 25.45 µs
26.42 µs
(96.72%)
Adapter::Rust📈 view plot
🚷 view threshold
3.49 µs
(+0.69%)Baseline: 3.47 µs
3.59 µs
(97.38%)
Adapter::RustBench📈 view plot
🚷 view threshold
3.49 µs
(+0.67%)Baseline: 3.47 µs
3.58 µs
(97.56%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii merged commit 6b95cff into devel Jun 17, 2026
62 checks passed
@epompeii
epompeii deleted the claude/github-actions-workflow-docs-dzr53c branch June 17, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants