Skip to content

fix: handle patch-testing comment runs without PR context#2842

Draft
peter941221 wants to merge 1 commit into
succinctlabs:mainfrom
peter941221:fix/patch-testing-comment-no-pr
Draft

fix: handle patch-testing comment runs without PR context#2842
peter941221 wants to merge 1 commit into
succinctlabs:mainfrom
peter941221:fix/patch-testing-comment-no-pr

Conversation

@peter941221

Copy link
Copy Markdown

This fixes Patch Testing Cycles Comment runs that do not have a PR attached in the workflow_run payload.

The failure showed up in run 27173224829. GitHub returned pull_requests: [] for that run, but the workflow still tried to read .pull_requests[0].number and passed the result into post-to-github. The posting binary then unwrapped PR_NUMBER and panicked while decoding the GitHub comments response.

This change adds the guard in both places that assume PR context:

  • the workflow now reads the first PR number with a null-safe jq expression and skips the posting step when no PR is attached
  • post-to-github now treats a missing or blank PR_NUMBER as a no-op instead of panicking

The benchmark comparison path stays the same. If the run has a real PR, the workflow still posts the generated comparison comment through the existing code path.

Testing:

  • cargo test -p sp1-test --bin post-to-github -- --nocapture
  • cargo run --bin post-to-github with PR_NUMBER='' and empty cycle stats now exits 0 after printing the comparison table and a skip message

@peter941221 peter941221 changed the title Handle patch-testing comment runs without PR context fix: handle patch-testing comment runs without PR context Jun 9, 2026
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