mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #136] [MERGED] ci(bump-callers): add preflight.sh — one tested staleness/decommission guard (BE-6475) #147
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#147
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/136
Author: @mattmillerai
Created: 8/5/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-6475-bump-callers-preflight📝 Commits (3)
0ed4e0aci(bump-callers): add preflight.sh — one tested staleness/decommission guard (BE-6475)13c540ffix(bump-callers): harden preflight.sh inputs, tip fetch and decommission verdict (BE-6475)7e8490aci(bump-callers): add preflight.sh ancestry direction guard (BE-6675) (#141)📊 Changes
5 files changed (+1109 additions, -8 deletions)
View changed files
📝
.github/bump-callers/README.md(+148 -1)➕
.github/bump-callers/preflight.sh(+418 -0)➕
.github/bump-callers/tests/test_preflight.sh(+529 -0)📝
.github/workflows/test-bump-callers.yml(+8 -4)📝
AGENTS.md(+6 -3)📄 Description
ELI-5
Every
bump-*-callers.ymlworkflow in this repo has the same ~40 lines of "wait, is this run actually the newest one, and does the thing I'm about to pin still exist?" pasted into it before it calls the shared bump script. There are eight copies and they have quietly drifted apart, so different fleets behave differently on the same situation. This PR lifts the best copy out into one tested file,.github/bump-callers/preflight.sh, and adds a test suite that builds throwaway git repos to prove each branch. Nothing uses it yet — swapping the entrypoints over is a separate change — so this merge changes no fleet's behaviour and fires no bump run.What this adds
.github/bump-callers/preflight.sh— the guard, extracted frombump-detect-unreviewed-merge-callers.yml(PR #117, the most-hardened copy) and generalized. InputsWATCHED(required),WATCHED_ASSETS(optional, for multi-path fleets),NEW_SHA, plus Actions'GITHUB_SHA/GITHUB_OUTPUT. Outputsproceed=true|falseandnew_sha=<sha>on every exit-0 path. Exits non-zero only for a lookup it could not perform..github/bump-callers/tests/test_preflight.sh— 42 assertions across 9 cases, no network: each case builds a local bare repo asoriginplus a clone as the run workspace, drives the real script, and asserts exit code, both outputs, and the presence/absence of::error::/::warning::.test-bump-callers.ymlshellchecks both scripts and both suites and runs the new suite;.github/bump-callers/README.mdgains a "Preflight" section (inputs, outputs, the two-step consumption pattern);AGENTS.mdCommands/Layout updated to match.Why the #117 semantics specifically
The five simple copies skip on a bare tip mismatch. That is wrong: the push trigger is path-filtered, so an unrelated commit landing between the trigger and the check starts no run of its own — skipping there discards the only run for the change and freezes every caller, which is the exact pin-drift this directory exists to prevent.
bump-auto-label-callers.ymlcompares content but then pins the stalegithub.sharather than the verified tip. The #117 copy gets both right, plus the exact-refname tip parse (a branch literally namedfoo/refs/heads/mainmatches thels-remotepattern at component boundaries and must not be consumed), theFETCH_HEADverification (an unresolvableFETCH_HEADmust not be read as deletion), and the$WATCHED-variable deletion test (two literals drift on a rename and turn the fleet into a permanent silent no-op).The one generalization is
WATCHED_ASSETS: #117's own comment says its single-blob comparison is coupled to the path filter and must be widened before the re-point is reused by a fleet whosepaths:has more than one entry (cursor-review,groom,pr-size). Test case 6 is that case — a commit touching only the asset directory must read as stale, and the same fixture run withoutWATCHED_ASSETSproceeds, which is the under-verification the widening removes.Test cases
refs/heads/foo/refs/heads/mainsorting first is not consumed; run proceeds at the real tip, no "main moved" log::error::,proceednottrueproceed=false, stale logproceed=true,new_sha== the new tip (the re-point)proceed=false,::warning::decommissionproceed=false— and the single-path config on the same fixture proceeds::warning::own-commit decommission, not reported as staleproceed=true,new_sha==GITHUB_SHA, no fetch/compare-d "$WATCHED_ASSETS"guard firesVerification
git statusconfirms nobump-*-callers.ymlfile is touched.Judgment calls worth a reviewer's attention
bump-pr-risk-callers.ymlhas diverged past #117 and this script does not implement its extra checks. Since #117 landed, the pr-risk entrypoint grew agit rev-list --count HEAD..FETCH_HEAD -- "${WATCHED[@]}"test ("did a later commit touch a watched path", which survives a land-then-revert that nets to zero content diff), an--unshallowprobe that test needs, path-filter exclusions (:(exclude)scripts/pr-risk/tests), and agit merge-base --is-ancestorrefusal to pin an orphaned commit. The ticket is explicit that the extraction adopts the #117 semantics, and this PR does exactly that — but that means the phase-2 swap must decide whether to fold pr-risk's checks in or leave that fleet on its own guard. Deleting them in the name of consolidation would be a regression. Flagged in the script header, the README, and here.mainis supported as the default branch, hardcoded — same as all eight existing copies. Not generalized, because no fleet needs it and an unused input is a footgun.WATCHED_ASSETSstring. That is fine forcursor-review/groom/pr-sizeand is the scope the ticket specifies; see (1) for pr-risk.proceed=falseeither way). That follows the specified condition — both objects must be gone for the decommission message — and is defensible: the deletion commit did touch the path filter, so it does have its own run.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.