← Back to Pull requests

Add --stack option to test a GitHub PR stack #44

Closed
unknown closed this pull request without merging on Nov 17, 2026 17:24 UTC
View on GitHub
unknown unknown commented on Nov 14, 2026 23:51 UTC
Author

Given a PR that is part of a GitHub PR stack, look up the whole stack and use the source branch of the top PR in the modified ros2.repos, since it contains the changes from all PRs of the stack. With --comment, post the comment on every open PR of the stack; this also works with --test-report.

PyGithub does not support PR stacks, so query the REST API directly: https://docs.github.com/en/rest/pulls/stacks

When using --build, ask for confirmation if the stack targets a different branch than the selected release (this check already exists for normal PRs), or if the top PR's branch is missing changes from the other PRs of the stack.

--stack cannot be combined with --pulls, --interactive, or --branch: testing a PR stack along with other PRs is not supported for now.

---

Example: ros2/rviz#1916 is stacked on ros2/rviz#1915 against Lyrical. Running:

$ GITHUB_TOKEN=... ros-ci-for-pr \
  --stack ros2/rviz#1915 -k rviz_ogre_vendor -t lyrical -b -c

Creates a gist using ros2/rviz#1916 (the top of the stack, which includes ros2/rviz#1915's changes) and comments on both ros2/rviz#1915 and ros2/rviz#1916 with the CI jobs info:

https://github.com/ros2/rviz/pull/1915#issuecomment-6886087162
https://github.com/ros2/rviz/pull/1916#issuecomment-6886087336

I used Claude Opus 5.5 to implement this.

Diff: 169 lines (+126 / -43) across 2 files Reviewer: mjcarroll Review duration: 3933m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 169 lines diff across 2 files
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.307
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #44"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.2% (MEDIUM) · Higher = larger blast radius
35.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.2% · Safe to merge
15.2%