← Back to Pull requests

[CI] Require an upstream decision on PRs to release branches #4006

Open
pablo-garay opened this pull request with 63 lines diff across 1 files
View on GitHub
pablo-garay pablo-garay commented on Nov 13, 2026 23:18 UTC
Author

Linked issue or supporting maintainer

Part of AIPYTORCH-1303 (design reviewed and approved by the team).

BC-breaking?

No

Summary (human written only)

Adds an upstream-pr-check job on PRs to release/*. It passes when the description references the upstream PR (pytorch/pytorch#12345 or a github.com/pytorch/pytorch/pull/... link) or the PR has the new no-upstream label for ROCm-only changes. Otherwise it fails and keeps one comment on the PR explaining how to pass; it re-runs when the description or labels change. It only reads the event payload and never checks out PR code, so pull_request_target is safe. This is the advisory phase: nothing blocks merges until a release/ ruleset requires upstream-pr-check. Because pull_request_target loads the workflow from the base branch, the same file also goes to release/2.15 in #4007; future release branches pick it up from develop and the release carry-forward.

Tested with actionlint, and by running the script against mocks for every pass/fail and comment path, and against the last 15 merged release/2.15 PRs (8 pass, 7 would need a link or the label).

Demo

Running in pablo-garay/upstream-pr-check-demo, which has the same branch layout:

!Demo PR list: #1 fails, #2 to #5 pass

No upstream decision recorded (#1): the check fails and the bot explains how to pass.

!Demo PR #1: failing check and bot comment

Upstream PR referenced in the description (#2): the check passes.

!Demo PR #2: passing with an upstream link

ROCm fork-only change with the no-upstream label (#3): the check passes.

!Demo PR #3: passing with the no-upstream label

Fixed by adding the upstream link to the description (#4): the check re-runs and the same comment flips to passing.

!Demo PR #4: passing after the description was edited

Diff: 63 lines (+63 / -0) across 1 files Reviewer: cgoea Review duration: 15455m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.28) × (1 − Review Confidence (0.66)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.28 · 63 lines diff across 1 files
0.28
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.54 · 3 substantive comment(s)
0.54
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
66%
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.249
Real PR Conversation Timeline
5 items
github-actions[bot] github-actions[bot] commented on Nov 13, 2026 23:21 UTC
Bot

<!-- rocm-security-gh:pr-findings:v1 -->

<details>
<summary><b>Security scan found no critical or high findings on lines changed by this pull request</b></summary>

View the security scan run for complete reports.

_“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta._

</details>

jithunnair-amd jithunnair-amd commented on Nov 19, 2026 17:13 UTC
Contributor

@haribabug Can you please let us know if you have any concerns on this commit of this PR: https://github.com/ROCm/pytorch/pull/4006/changes/95abf7d146706218d88bb12efc059b6c2797bca0? We are trying to set up a flow that comments on the PR if the user needs to take action.

haribabug haribabug commented on Nov 20, 2026 10:42 UTC
Contributor

@haribabug Can you please let us know if you have any concerns on this commit of this PR: 95abf7d? We are trying to set up a flow that comments on the PR if the user needs to take action.

@jithunnair-amd Reviewed. No concerns with the current implementation. The pull_request_target workflow only processes PR metadata/API operations, and the Zizmor suppression is scoped to dangerous-triggers. Please maintain this trust boundary and do not introduce checkout or execution of PR-controlled code or artifacts without a security review.

cgoea cgoea approved these changes on Nov 20, 2026 10:56 UTC
Approved Reviewer

Approved these changes.

Reviewers
Assignees
pablo-garay pablo-garay
Labels
risk: low confidence: 66.3% 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: 27.9% (LOW) · Higher = larger blast radius
27.9%
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: 66.3% · Lower = rushed or shallow review
66.3%
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: 9.4% · Safe to merge
9.4%
Repository