fix: stop freezing the draft release's tag_name after first creation #45
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/44-draft-tag-name-frozen-after-creation"
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?
Closes #44.
More precise than the issue's original diagnosis
The issue named
create_or_update_release()'s own fallback ternary as the bug:True, but turned out to be one level removed from the actual cause —
main()itself already collapsesnew_tagdown to the existing draft's stale tag before ever calling that function:So
create_or_update_release()'s parameter is literally namednew_tag, but by the time it arrives it's already the old tag whenever a draft exists. Its own internal fallback never even gets a chance to matter — the value's already wrong one call frame earlier.Fix
Both places now just always use the freshly-computed
new_tag:main(): removed thecomparison_tagindirection entirely. The version-comparison text and the tag sent to the API both just usenew_tagdirectly.create_or_update_release(): dropped its now-fully-redundant fallback (tag = new_tag, unconditionally).Same
PATCHrequest already fires on every run (to refresh the notes body) — this costs nothing extra, it just letstag_name/nameget the same "always reflect current truth" treatment the notes already get. The draft'sid/URL is untouched throughout; nothing gets deleted/recreated.Not done here (discussed on #44, explicitly out of scope)
An alternative approach — delete the existing draft and create a fresh one whenever the new tag is semver-"bigger" — was considered and rejected: it discards the draft's
id/URL on every escalation (breaking any open link/bookmark) and needs real semver-comparison logic to decide when to fire, for no benefit over unconditionally trusting the fresh computation.Verification
No test suite exists in this repo. Verified with
python3 -m py_compile release_drafter.py(clean) and a manual read-through of the fullmain()flow post-change.🤖 Generated with Claude Code