← Back to Pull requests

chore: Update merged_pr_numbers to detect stacked PR merges in release #442

Closed
unknown closed this pull request without merging on Nov 13, 2026 21:19 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 20:13 UTC
Author

The scripts used in the prepare-release job use a merged_pr_numbers helper function to determine the set of PRs that have been merged into develop since the last release. This set of PRs is then fed into the CHANGELOG generation process.

As it turns out, the heuristic used in merged_pr_numbers can miss PRs that are merged as part of a stack. (When 0.8.0 was prepared, #354, #355, #357, and #359 were merged as a stack topped by #360: the script only considered #360.)

This PR fixes that issue. merged_pr_numbers previously checked git log and parsed PR numbers from commit messages: this only gave us PRs that had their own merge commit (or squash commit). As of this PR, we use a slightly more complicated approach to ensure that we resolve _all_ PRs, including those that weren't merged directly to develop:

1. We use git log to get the precise set of commits being merged, along with their commit times
2. We take the time of the oldest commit and subtract 24 hours to define the start of our PR search range
3. We use gh pr list to find all PRs merged (into _any_ branch) since that time
4. We filter those results to only include PRs whose merge commits are in the range we checked in step 1

This works for stacked PRs because, when a stack is merged from the top, GitHub marks each PR in the stack as merged and records the top PR's merge commit as its merge commit.

Unfortunately, GitHub doesn't have a way to cleanly query "what PRs were merged _in this specific rev range_", so we need to do a fuzzy PR search (overshooting the date range for safety) followed by a check of each PR's merge commit SHA.

Diff: 204 lines (+153 / -51) across 2 files Reviewer: fuzzybinary Review duration: 66m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 204 lines diff across 2 files
0.36
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%
60%
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.318
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #442"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% 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: 36.3% (MEDIUM) · Higher = larger blast radius
36.3%
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: 60.5% · Lower = rushed or shallow review
60.5%
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: 14.3% · Safe to merge
14.3%