bug(_release.yml): stale rolling PR not auto-closed after Layer 2 fall-through + later cut success #87
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#87
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?
Symptom
When the Layer 2 cut-safeguard race-condition (see sibling tracker for the Layer-2 race) fires protective fall-through, mode=update opens a new rolling PR as a precaution. If the cut is later dispatched manually + succeeds, the fall-through-opened rolling PR is left open as stale state — there's no cleanup step.
In the v0.5.0 cut: PR #84 was opened by the fall-through at
00:40:40. The cut was later dispatched and succeeded (v0.5.0 draft → operator Publish → GA). PR #84 sat open for ~7 minutes until I manually closed it. Operator's read: "first step on the stairway to version hell" — multiple "v0.5.0 release PRs" co-existing post-cut is confusing.Why it matters
In the steady state (no race condition), the rolling PR's identity reflects "what would ship next." When a cut happens, the rolling PR's content is consumed → next workflow run sees mode=noop or mode=update on the next bump-target. Coherent.
In the race-condition state, the fall-through opens a rolling PR for the SAME version that just shipped. After the cut succeeds, the rolling PR is stale (mergeable=false in our case because head=force-pushed-rolling-state, but in some cases it might still mergeable=true → footgun).
Proposed fix
Two complementary cleanup mechanisms:
_release.yml's cut path checks if there's an open rolling PR matching the just-cut version (title contains "v$CUT_VERSION") + closes it as stale. Substrate-honest cleanup at the success-event.release-prep.sh --rolling-modechecks the manifest'slast_released_versionagainst the currentnext_version. If they match (= would re-cut the version that already shipped), short-circuit + close any open rolling PR for that version + emitmode=already-released.Either alone unblocks the operator-experience. Both together is defense-in-depth.
Edge case
If a SECOND cut needs to happen at the same version (e.g., recall + re-cut), the cleanup logic should respect that — the fall-through-stale detection should specifically check for "rolling PR open AFTER the cut commit landed" rather than "rolling PR open AT the cut version."
Refs
refs/pull/N/headon auto-delete-branch merge #92