Draft release's tag_name never updates after first creation, even when a later PR should escalate the bump type #44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while debugging why
Aevana/aevana's releases always seemed to end up as patch bumps regardless of what merged.The bug
release_drafter.py,create_or_update_release():generate_next_tag()does recompute the correct bump type (major/minor/patch, frombreaking-change/featurelabels on every merged PR since the last real release) on every single run. Butcreate_or_update_release()only ever uses that fresh value on the initialPOST(when no draft exists yet). Every subsequent run is aPATCH, and thePATCHpath discardsnew_tagand reusesexisting_draft["tag_name"]— onlybody/nameget refreshed,tag_nameis frozen at whatever it was on first creation.Concrete failure mode
fix) merges first after the last publish → draft created asv1.2.4(patch).feature) merges before anyone publishes the draft →generate_next_tag()correctly computesv1.3.0, butcreate_or_update_release()throws it away and keepsv1.2.4.v1.2.4even though it contains a real feature — undercounting the actual scope of the release, silently, every time.In practice this means the drafter's bump-type logic only ever matters for whichever PR happens to land first in a release window — every later PR's labels are computed but never acted on.
Suggested fix (my recommendation, not the only option — happy to be overruled)
Just stop discarding the fresh value:
Same
PATCHcall already fires every run (to refreshbody), so this costs nothing extra — it just letstag_name/nameget the same "always reflect current truth" treatment the notes already get.I'd specifically recommend against an alternative I was asked to weigh in on — delete the existing draft and create a fresh one whenever the newly computed tag is semver-"bigger" than the existing draft's tag. That works, but:
id/URL on every escalation, breaking any link/bookmark someone has open on it mid-review, for no benefit.tag = new_tagalways reflects whatever the current true computation is, in either direction.Depends on
Nothing — self-contained fix to this repo. Downstream consumer for context:
Aevana/aevana, where this surfaced.