mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #116] [MERGED] fix(pr-risk): let a manual dispatch grade while enabled is false #126
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/116
Author: @mattmillerai
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @mattmillerai
Base:
main← Head:matt/pr-risk-dispatch-bypasses-gate📝 Commits (1)
ccb6108fix(pr-risk): let a manual dispatch grade whileenabledis false📊 Changes
4 files changed (+106 additions, -23 deletions)
View changed files
📝
.github/workflows/pr-risk.yml(+34 -8)📝
README.md(+1 -1)📝
scripts/pr-risk/resolve-enabled.sh(+35 -11)📝
scripts/pr-risk/tests/test_resolve_enabled.sh(+36 -3)📄 Description
ELI-5
enabled: falsewas blocking every path, including a manual run. That broke the staged rollout the switch was added for: a repo enrolled OFF couldn't grade even one PR to see what the grader would say, so "try it here before turning it on" required turning it on first — the very thing being evaluated.enablednow governs automatic grading (thepull_requeststream). A manualworkflow_dispatchgrades regardless.pull_requestworkflow_dispatchenabled: falseenabled: trueWhy a dispatch is safe to exempt
Running a
workflow_dispatchrequires write access on the repo and is an explicit, attributed act. There's no unattended behaviour left for the switch to govern.The cost, stated rather than buried — it's in the input description and beside the job
if:, not just here:falseis now a mute on the PR stream, not a lockout. A repo that needs the harder guarantee should remove the caller; nothing in this workflow can bind a maintainer who can already edit the workflow file.The part worth reviewing: the summary was about to lie
The gate writes a step summary when grading is off. It said:
On a dispatch that is about to do exactly that, this is the single most misleading line this workflow could emit — it's the sentence a reader trusts to decide whether the label on their PR is current. Left unchanged, the fix above would have shipped a workflow that grades a PR while telling the operator it didn't.
So the resolver now branches on
GITHUB_EVENT_NAME:pull_request→ keeps its original claim (accurate there) and gains a pointer to the manual route.Verification
test_resolve_enabled.shis now 27 assertions, up from 21. The six new ones pin the summary contract in both directions, including a negative assertion that the disabled-dispatch summary does not contain "No grade was computed" — the specific wrong sentence, rather than a loose match that would pass on any rewrite.All four pr-risk suites pass;
shellcheck -xclean; the workflow parses; README row updated.Consumer impact
None until a repo bumps its pin. For the two live consumers this only adds a capability — both pin
enabled: true, so their automatic path is unchanged either way.Worth knowing for whoever enrols next: a repo can now land the caller with
enabled: false, dispatch a grade against two or three real PRs to see the tiers it produces, and only then switch it on. That was the intended flow when the switch landed and it didn't actually work.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.