Repository navigation
fix(promote-release): delete RC draft pre-releases by id and gate tag removal - #624
Merged
Merged
Conversation
Adds a bats spec and fixture for a select-rc-draft-releases helper that enumerates RC draft pre-releases for a base version from a GitHub releases list. The helper does not exist yet, so the spec fails (exit 127) and pins the contract for the cleanup fix. Refs: #623
Enumerates RC draft pre-releases for a base version directly from the GitHub releases list, emitting "<id>\t<tag>" for each draft pre-release tagged X.Y.Z-rcN. Seeding from releases (not git tags) lets cleanup delete drafts by id and reclaim drafts whose RC tag was already removed by an earlier partial run. Refs: #623
… removal The cleanup step deleted RC draft pre-releases with `gh release delete <tag>`, but that resolves the release via the get-release-by-tag API, which never returns drafts -- so every delete failed while the code fell through and deleted the git RC tag anyway. Because the loop was seeded from `git ls-remote --tags`, the now-tagless draft became undiscoverable and survived every later run, accumulating in the smoke-test repo. Rework cleanup in both promote-release workflows: - Seed from the releases list (not git tags), so drafts whose RC tag was already removed by an earlier partial run are reclaimed. - Delete each RC draft pre-release by release id via the releases API. - Delete a git RC tag only when no GitHub Release is still attached, preserving published pre-releases and keeping a failed-delete draft discoverable. - Verify no RC draft pre-release survives and fail loudly if one does. The upstream workflow uses the new bats-tested select-rc-draft-releases helper; the self-contained workspace template inlines the same jq filter. Refs: #623
The image installs just from its latest release, which advanced to 1.54.0, so the pinned minor-version assertion (1.53.) failed in Image Tests. Update the expectation to match. Refs: #623
c-vigo
enabled auto-merge
June 23, 2026 06:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
promote-release.ymlleft RC draft pre-releases stranded in the smoke-test repo every release cycle (e.g.0.3.7-rc1,0.3.8-rc1are currently orphaned). The cleanup step (added in #601) identified each RC draft correctly but deleted it withgh release delete <tag>, which resolves the release via the get-release-by-tag API — an endpoint that never returns drafts. So the delete failed (WARN: failed to delete RC draft pre-release …), yet the code fell through and deleted the git RC tag anyway. Since the loop was seeded fromgit ls-remote --tags, the now-tagless draft became undiscoverable and survived every subsequent run.Root cause confirmed from the
0.3.8promote run log in the smoke-test repo:Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
Rework the cleanup step in both promote-release workflows:
.github/scripts/select-rc-draft-releases.sh(new) — enumerates RC draft pre-releases for a base version from a GitHub releases list, emitting<id>\t<tag>for eachdraft && prereleasewhose tag isX.Y.Z-rcN. Bats-tested..github/workflows/promote-release.yml— cleanup now: (1) seeds from the releases list, not git tags, so drafts whose RC tag was already removed by an earlier partial run are reclaimed; (2) deletes each RC draft by release id (works for drafts); (3) deletes a git RC tag only when no GitHub Release is still attached (preserves published pre-releases and keeps a failed-delete draft discoverable); (4) verifies no RC draft survives and fails loudly otherwise. Uses the new helper.assets/workspace/.github/workflows/promote-release.yml— same fix; since consumer repos don't ship.github/scripts, the template inlines the equivalent jq filter.tests/bats/select-rc-draft-releases.bats+tests/bats/fixtures/releases-list.json(new) — 8 cases covering selection, draft/prerelease/base filtering, malformed suffixes, and arg validation.CHANGELOG.md/ syncedassets/workspace/.devcontainer/CHANGELOG.md— Fixed entry.Changelog Entry
Fixed
gh release delete <tag>, which cannot resolve a draft, then deleted the git RC tag anyway — stranding the draft and making it undiscoverable on later runs (the loop was seeded from git tags)Testing
just test)Manual Testing Details
worktree.batstmux integration test (unrelated;skipped in CI).tests/bats/fixtures/releases-list.json: RC drafts of the base are selected by id; published pre-releases and other base versions are retained;HAS_RELEASEcorrectly keeps tags that still have a release and deletes orphans.Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The two already-orphaned drafts (
0.3.7-rc1,0.3.8-rc1) invig-os/devcontainer-smoke-testare not removed by this PR; the next final promote will reclaim them now that cleanup seeds from the releases list, or they can be deleted manually.Refs: #623