mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #124] [MERGED] fix(pr-size): require a pinned workflows_ref, guard empty refs, drain the exemption (BE-5858) #135
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#135
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/124
Author: @mattmillerai
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @mattmillerai
Base:
matt/be-5546-require-workflows-ref← Head:matt/be-5858-pr-size-workflows-ref📝 Commits (1)
64b37b7fix(pr-size): require a pinned workflows_ref, guard empty refs, drain the exemption (BE-5858)📊 Changes
5 files changed (+48 additions, -22 deletions)
View changed files
📝
.github/workflow-pins/README.md(+6 -4)📝
.github/workflow-pins/check_workflow_pins.py(+3 -6)📝
.github/workflow-pins/tests/test_check_workflow_pins.py(+5 -3)📝
.github/workflows/pr-size.yml(+33 -8)📝
README.md(+1 -1)📄 Description
ELI-5
A consumer repo pins our PR-size check by exact commit SHA, which is supposed to mean "run exactly this code, forever." But the check downloads its actual counting tool separately, using a second setting called
workflows_ref— and that setting used to quietly default tomain. So you could pin the workflow to a frozen SHA and still get a tool built from whatever landed onmainfive minutes ago. The pin looked airtight and wasn't. This PR removes the default and makes the workflow refuse to run if the setting is missing, so the pin now means what it says.What changed
pr-size.ymlwas the last of the four reusable workflows still carrying aworkflows_refdefault — this closes the BE-5546 pin-integrity sweep.required: true,default: maindeleted, description rewritten to mirror the wording #103 used incursor-review.yml/groom.yml/agents-md-integrity.yml.uses:SHA, instead of "defaults to main".Require a pinned workflows_refstep, copied byte-for-byte fromcursor-review.yml(verified programmatically: both extract to an identical 1425-character block), inserted immediately before theLoad check-pr-size toolcheckout. It is needed because GitHub does not enforcerequired: trueforworkflow_callinputs: an omitted input arrives as'', andactions/checkoutwithref: ''silently takes the default branch. The step takes the value viaenv:(never interpolated into the script body), strips whitespace, hard-fails on empty, and warns when the ref is not a full 40-hex SHA.KNOWN_EXEMPTdrained —"pr-size.yml"removed along with its rationale block. This is not optional bookkeeping: the lint hard-fails on a stale exemption by design, so leaving it would turn CI red. The frozenset is now empty, with the explanatory comment kept.README.mdusage note and.github/workflow-pins/README.mdboth named the three fixed workflows / the pr-size exemption and would otherwise have gone stale.The guard is added only to the
pr-sizejob. Thecommentjob never consumesworkflows_ref(it checks out nothing) — verified in this diff, not just inherited from the ticket.Why this is safe to drop the default
The change denies something that previously worked (omitting the input), so I re-ran the BE-5856 caller audit empirically rather than trusting it:
vars.PR_SIZE_CALLERShas exactly one entry, and it resolves to a live repo.workflows_refexplicitly, SHA-matched to its ownuses:pin (same 40-hex SHA on both lines) — so it is unaffected by the removal.github-workflows/.github/workflows/pr-size.ymlreturns 3 hits: this repo's own header example, this repo'sbump-callerstest fixture, and that one caller. No unenrolled consumer exists — the roster audit holds in both directions.Caller repo names are withheld here per the public-repo hygiene rule; the evidence above was gathered from
vars.PR_SIZE_CALLERSand the code-search API.No caller change is needed. After this merges,
bump-pr-size-callers.ymlbumps the caller'suses:SHA andworkflows_refin lockstep — confirmed inbump-callers.sh, whoseSHA_ADDRmatches/github-workflows|workflows_ref/, so both pins move together.Verification
python3 .github/workflow-pins/check_workflow_pins.py→ green: "4 workflow(s) declareworkflows_ref, none with a default, every ref checkout guarded (0 exempt)."python3 -m unittest discover -s .github/workflow-pins/tests -p 'test_*.py'→ 71 passed.actionlint .github/workflows/*.yml→ clean.default: maininpr-size.yml; exactly oneRequire a pinned workflows_refstep, at line 166, ahead ofLoad check-pr-size toolat line 190.Judgment calls
mergeable: CONFLICTINGagainstmain— its author needs to reconcile it). Both reasons the ticket gave for waiting are resolved by stacking rather than waiting: the files to edit exist on #103's branch, and #103's own lint CI is untouched because this change lands on a separate branch that can only merge after #103 does. The standing team directive is to stack on an unmerged blocker that carries buildable branch code rather than gate on it, so I stacked. If you would rather this had waited, closing this PR costs nothing — the branch keeps the work.pr-size.ymlwas added to the two "this repo's own workflows" test loops, and the guarded-checkout count went 12 → 13. Without this the new guard has no direct regression pin.README.mdsentence ("oncursor-review.yml,groom.yml, andagents-md-integrity.yml…") and theworkflow-pins/README.md"today:pr-size.yml" note factually wrong. I rewrote both rather than leave stale docs in the same commit that invalidated them.No unmet acceptance criteria.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.