Repository navigation
Description
Description
RC draft pre-releases are still surviving in the vig-os/devcontainer-smoke-test repo after each release cycle, despite the cleanup added in #601 (fix for #600).
Current stranded state in the smoke-test repo:
| Release | draft | prerelease | git RC tag present? |
|---|---|---|---|
0.3.7-rc1 |
✅ true | ✅ true | ❌ deleted |
0.3.8-rc1 |
✅ true | ✅ true | ❌ deleted |
The #601 cleanup logic is reached and attempts the deletion, but the gh release delete "$tag" --yes call fails for draft pre-releases, while the code still falls through and deletes the git RC tag. Because the cleanup loop is seeded from git ls-remote --tags ${VERSION}-rc*, once the tag is gone the orphaned draft can never be re-discovered — it is stranded permanently.
Root cause
Evidence from the 0.3.8 final promote-release run in the smoke-test repo (run 27982523396, cleanup step Delete RC draft pre-releases and git RC tags):
Deleting RC draft pre-release 0.3.8-rc1 (draft pre-release)
WARN: failed to delete RC draft pre-release 0.3.8-rc1 <-- release delete FAILS (after 3 retries)
Deleting remote tag 0.3.8-rc1 (no GitHub Release) <-- git tag deleted anyway
Two compounding bugs in the cleanup step (assets/workspace/.github/workflows/promote-release.yml, lines ~399-443; mirrored in the upstream .github/workflows/promote-release.yml, lines 602-647):
-
gh release delete <tag>cannot resolve a draft release.gh release delete "$tag"resolves the release via the "Get a release by tag name" API (GET /repos/{o}/{r}/releases/tags/{tag}), which does not return draft releases. So the delete fails with "release not found" even though the draft exists and was correctly identified from the list-releases response. The cleanup already fetched the matching release object (it reads.draft/.prereleasefrom it) — it should delete by release id viagh api -X DELETE repos/${GITHUB_REPOSITORY}/releases/<id>instead ofgh release delete <tag>. -
The git RC tag is deleted unconditionally on fall-through, even when the release delete failed.
gh release delete ... || echo "WARN: failed..."swallows the failure, then control falls through to the tag deletion. This orphans the draft permanently, because: -
The loop is seeded from git tags, not from the releases list. Candidate seed is
git ls-remote --tags --refs ... "${VERSION}-rc*". A draft whose tag has already been removed is invisible to this loop forever. Seeding from the list-releases endpoint (filtered todraft && prerelease && tag ~ ^${VERSION}-rc[0-9]+$) would make cleanup idempotent and self-healing for already-orphaned drafts.
Steps to Reproduce
- Run a downstream candidate cycle in
devcontainer-smoke-testwithcreate-release=true(the standard smoke-test dispatch) → aX.Y.Z-rcNgit tag and a draft pre-release are created. - Run the final
X.Y.Zcycle →promote-release.ymlcleanup runs. - Observe the cleanup step log:
WARN: failed to delete RC draft pre-release X.Y.Z-rcN, followed byDeleting remote tag X.Y.Z-rcN. - Check
gh release list --repo vig-os/devcontainer-smoke-test: theX.Y.Z-rcNdraft pre-release remains; its git tag is gone.
Expected Behavior
After a final promote-release, no X.Y.Z-rc* draft pre-releases (nor their git tags) remain for the promoted base version. Cleanup should also reclaim already-orphaned drafts from prior cycles.
Actual Behavior
The git RC tag is deleted but the RC draft pre-release survives and accumulates every release cycle. Drafts orphaned before their tag was removed can never be cleaned up by subsequent runs.
Environment
- Repos:
vig-os/devcontainer(SSoT) and deployed templates invig-os/devcontainer-smoke-test - Workflows:
assets/workspace/.github/workflows/promote-release.yml(deployed, the one that runs in smoke-test) and.github/workflows/promote-release.yml(upstream, same latent bug) - Observed on cleanup runs for finals
0.3.7and0.3.8(2026-06-22) - Prior work: promote-release cleanup never prunes RC draft pre-releases (and their tags) #600 (original report), fix(promote-release): prune RC draft pre-releases in cleanup #601 / commit
09e780d(incomplete fix)
Possible Solution
In the cleanup step of both promote-release workflows:
- Seed the loop (or a second pass) from the list-releases endpoint, selecting
draft == true && prerelease == true && tag_name ~ ^${VERSION}-rc[0-9]+$, so orphaned drafts (no git tag) are also reclaimed and the step is idempotent. - Delete the draft by release id:
gh api -X DELETE "repos/${GITHUB_REPOSITORY}/releases/<id>"(orgh release delete <tag> --cleanup-tagonly if/when gh can resolve drafts), instead ofgh release delete <tag>which can't resolve drafts. - Gate the git-tag deletion on the release deletion succeeding — do not fall through and delete the tag when the draft delete returned non-zero, to avoid permanently orphaning the draft.
- Add a final verification pass that fails (loudly) if any
X.Y.Z-rc*draft pre-release still exists for the promoted base version, mirroring the existing GHCR RC prune verification.
Clean up the two already-stranded drafts (0.3.7-rc1, 0.3.8-rc1) in the smoke-test repo as part of the fix.
Changelog Category
Fixed
Activity
test: add failing test for RC draft pre-release selection
fix: add select-rc-draft-releases helper for cleanup
fix(promote-release): delete RC draft pre-releases by id and gate tag…
test(image): bump expected just version to 1.54
fix(promote-release): delete RC draft pre-releases by id and gate tag…
chore: release 0.3.9 (#184)
chore: release 0.3.9 (#643)
c-vigo commentedon Jul 2, 2026
Fixed by #601 + #624 (both on
dev). Cleanup deletes RC draft pre-releases by release id (seeded from the list-releases endpoint, so orphaned drafts are reclaimed), gates git-tag removal on the release still being attached, and fails loudly if any RC draft survives — in both the upstream and scaffoldpromote-release.yml.