mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #141] [MERGED] ci(bump-callers): add preflight.sh ancestry direction guard (BE-6675) #151
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#151
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/141
Author: @mattmillerai
Created: 8/6/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @mattmillerai
Base:
matt/be-6475-bump-callers-preflight← Head:matt/be-6675-preflight-ancestry-guard📝 Commits (2)
21b7cceci(bump-callers): add preflight.sh ancestry direction guard (BE-6675)93d0f78fix(bump-callers): measure the direction of BOTH tip moves in preflight (BE-6675)📊 Changes
3 files changed (+352 additions, -21 deletions)
View changed files
📝
.github/bump-callers/README.md(+58 -8)📝
.github/bump-callers/preflight.sh(+119 -13)📝
.github/bump-callers/tests/test_preflight.sh(+175 -0)📄 Description
STACKED — merging lands on
matt/be-6475-bump-callers-preflight(owned by @mattmillerai, PR #136), NOTmain.preflight.shonly exists on that branch; #136 must merge first. GitHub retargets this PR tomainautomatically when #136 lands.ELI-5
preflight.shis the guard that decides whether a bump run should fan a new pin out to every consumer repo. When it notices thatmainhas moved since this run started, it compares the two and decides "stale re-run, do nothing" or "still the only run — pin the tip instead."It never checked which direction main moved. If main went backwards — someone force-pushed, a revert-reset landed, or a stale read replica answered the tip lookup — the guard happily compared against a commit that came before this run, and both outcomes were silently wrong:
new_shathe older tip, pinning every caller backwards.This adds one line of git — "is the fetched tip a descendant of this run's commit?" — and makes a
noa loud::error::+ exit 1 instead of a quiet green skip.What changed
git merge-base --is-ancestor HEAD FETCH_HEAD), placed after the existingFETCH_HEADverification and themain_tip="$fetched_tip"assignment, and before any blob/tree comparison — so both failure modes above become loud, not just one.--depth=1was replaced with a.git/shallowprobe +--unshallow. This is not cosmetic: against a--depth=1graft--is-ancestorreturns false even for a legitimate forward move, so the naive one-liner would hard-fail every re-point.--unshallowerrors out on an already-complete clone, hence the probe rather than an unconditional flag.refs/heads/mainis kept (thebump-pr-risk-callers.ymlreference copy fetches a baremain). The existing tag-shadowing comment above the fetch explains why; I added an explicit "do not align with pr-risk here" note so the next person doesn't regress it.bump-pr-risk-callers.ymlneeds a decision rather than a swap" note is now the decision (BE-6670): direction guard adopted for all fleets;git rev-listdeliberately not ported.Why
rev-listis not portedpr-risk's
rev-listtest exists because that fleet has no re-point: on a land-then-revert (net content change of zero) its content comparison would call this run the only one for the change and pin callers backwards togithub.sha.preflight.shalready answers that case by pinning the verified tip — which on a land-then-revert is the revert commit, i.e. forward. Layeringrev-liston top would only add a stricter staleness verdict that skips a run whose content the tip still needs pinned. New testland_then_revertdocuments this mechanism.Verification (both claims falsified empirically, not just asserted)
bash .github/bump-callers/tests/test_preflight.sh→ 94 passed, 0 failed.shellcheck -xclean on all four bump-callers scripts.test_bump_callers.sh→ 175 passed, 0 failed.check_agents_md.pypasses.Four new cases, and I confirmed each one actually tests the new behavior by reverting the change and re-running:
proceed=falseand the falsestale run/re-runlog; the content-equal case emitsnew_sha= the older SHA (backwards re-point).--depth=1restored, guard kept → 38 failures, including the shallow happy path and every full-clone re-point case. That is the spike's empirical finding reproduced here: a shallow FETCH_HEAD makes--is-ancestorreject legitimate forward moves. The deepening is load-bearing, not incidental.shallow_repoint, Actions' realactions/checkoutshape — the existing full-clone helper never exercised the--unshallowarm), land-then-revert, tag-shadow, and the benign ls-remote→fetch race all still pass.Judgment calls
MERGEABLE, and carriespreflight.sh, so the standing always-stack directive applies: I built on its branch rather than blocking. Nothing else changes.merge-baseexit codes are not split.resolve_oidsplits "absent" (exit 1) from "lookup failed" (exit >1) because those verdicts diverge — absence exits 0 silently. Here they converge (both are::error::+ exit 1), so splitting would only reword a log line. Documented in a comment rather than adding an untestable branch.preflight.shyet (the entrypoints still carry their inline copies), so this hardens the script ahead of the swap rather than changing any fleet's live behavior.Provenance
Ticket BE-6675, implementing the decision from spike BE-6670. Reference implementation:
bump-pr-risk-callers.yml:196-231onmain.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.