feat: idempotent cut pipeline — pre-check existing release + manifest state before re-doing work #128
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#128
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?
Why
Surveyor df03 + operator question 2026-06-26 surfaced this jointly:
The cut work itself is irreversible by design (you can't un-publish a release without manual operator action). But the pipeline could be idempotent at the pre-check layer: see existing state, recognize "this cut already ran," exit clean.
Current idempotency state
release-decide.shrelease-prep.sh --rolling-modedraft-release.sh(release-create)git push HEAD:mainrejected if already pushedProposed fixes
draft-release.sh: pre-check existing releaseBefore calling release-create, GET
/repos/{owner}/{repo}/releases/tags/{tag}:draftvalue, sametarget_commitish, samebody— or a documented subset thereof): log "release already exists at expected state — idempotent skip" + exit 0Manifest commit step (path-α + path-γ)
Before committing, read
last_released_shafrom the manifest on disk vs the cut's$HEAD_SHA:last_released_sha == $HEAD_SHA: manifest is already at post-cut state → skip the commit + push entirelyTag creation (implicit via release publish)
Forgejo creates the tag when the release is published. The release-pre-check above naturally covers this — if the release exists, the tag exists.
Composition with the multi-stage gates
The idempotency layer respects ADR-0003 + path-α: it just adds "if work is already done, recognize that + skip cleanly." No new gates, no behavior change on the first-run path.
Test seam
tests/draft-release.bats+ a newtests/manifest-update.bats(or extend existing). Test cases:What this PR does NOT do
Sequencing
Substantive but bounded. Estimated ~50 lines of bash + ~50 lines of bats. Engageable as a v0.10.x sprint, or bundled with #122 (test seam for read_rolling_pr_bump_label) since both are operator-paced post-v1.0-readiness work.
Refs