Skip to content

fix: complete hotfix-rejoin cleanup for published releases - #264

Merged
joshua-temple merged 2 commits into
mainfrom
fix/hotfix-rejoin-published-release-cleanup
Jun 23, 2026
Merged

joshua-temple merged 2 commits into
mainfrom
fix/hotfix-rejoin-published-release-cleanup

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

An adversarial audit (prompted by recurring one-per-rc fleet failures) found the hotfix rejoin/finalize cleanup path could wedge or leak objects:

  • A hotfix on the prerelease env promotes its release to a non-draft prerelease; a later superseding promote's rejoin cleanup hit the general "cannot delete non-draft" guard and aborted finalize, so target state never landed.
  • On a release-delete error the loop still deleted the tag, orphaning a tagless release no rerun could resolve.
  • A half-completed multi-env rejoin could strand the remaining envs and wedge an already-persisted state write.

Fix

  • Add a scoped AllowPublishedDelete opt-in used only by rejoin cleanup; the general delete guard for normal published releases stays in force.
  • Delete the release first and only delete the tag on success; pass the env SHA as a lookup fallback for an already-tagless orphan.
  • Make cleanup of disposable objects best-effort with loud warnings; reserve hard-fail for state writes, so a finalize never wedges and a rerun reconciles.
  • Harden the release lookup (prefer an exact tag-match over a stale SHA-only draft) and make a partial publish rerun converge via the semver tag.

Verification

Full unit suite (1725 passed), golangci-lint clean, e2e module builds/vets, and a new hotfix-rejoin-prerelease-supersede e2e scenario exercises the prerelease-env supersede/rejoin. The general delete guard is proven intact by a negative test. schema_version unchanged; no manifest field; no generated-workflow change.

A confirmed same-rc-base cross-env cleanup scoping gap is documented for a focused follow-up (the env SHA is already plumbed for it).

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple enabled auto-merge (squash) June 23, 2026 19:02
…ario

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit b8ef53e into main Jun 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant