Repository navigation
ci(release): repair orphaned draft tag_name on retag - #2761
Conversation
When the git tag was deleted and re-created between draft creation and merge, GitHub orphaned the draft release: tag_name became "untagged-<hash>" while `name` was preserved. The finalize step looked up the draft by tag_name and threw `Draft release for <tag> not found`, blocking the release. Fall back to matching by `name` only when the candidate is the GitHub-orphaned form (tag_name matches /^untagged-/), repair the draft's tag_name via updateRelease, then publish. Hard-fail is preserved when neither lookup matches. Same failure recurred on the v1.4.1 finalize run; this commit prevents recurrence but does not auto-recover the stuck v1.4.2 draft. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe release workflow's draft publication step now robustly handles edge cases where GitHub changes a draft's ChangesDraft Release Selection Robustness
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Successfully created backport PR for |
|
Successfully created backport PR for |
What this PR does
When a release-cut PR is merged after the underlying git tag was deleted and re-created (e.g. the release branch was force-updated between the initial tag push and the merge), GitHub orphans the corresponding draft release — its
tag_namebecomesuntagged-<hash>whilenameis preserved.The "Publish draft release" step in
pull-requests-release.yamllooks up the draft strictly bytag_name === tagand throwsDraft release for <tag> not found, blocking the release. Observed on run #26558920814 cutting v1.4.2, and the same error fired on the earlier v1.4.1 finalize run.This change adds a fallback: when the primary lookup misses, search for a draft where
name === tagandtag_namematches/^untagged-/. If found, repair the draft'stag_nameto the real tag viaupdateReleasebefore publishing, so the released artifact correctly points at the git tag created earlier in the same job. The strict-fail path is preserved when neither lookup matches.The fix is forward-only and does not auto-recover the currently stuck v1.4.2 draft — that needs a one-time manual
tag_namepatch + job re-run, or publishing the draft via the GitHub UI.Release note
Summary by CodeRabbit