fix: dev branch must skip past a pre-GA hotfix's reserved micro version (BERTE-609)#278
Merged
charlesprost merged 2 commits intoJul 23, 2026
Conversation
…on (BERTE-609) A pre-GA hotfix branch (e.g. hotfix/10.0.0) permanently reserves its X.Y.Z version the moment it is cut, since every version it can ever produce is X.Y.Z.<hfrev>, never a bare X.Y.Z. The parent dev branch (development/10.0) must therefore target X.Y.(Z+1), not X.Y.Z. _update_major_versions() already applied this rule for major-only dev branches (development/10 skipping past hotfix/10.0.0 to 10.1.0), but not for minor dev branches, which ignored phantom hotfix branches when computing latest_micro. Fold phantom hotfix micros into that computation too, mirroring the existing major-only handling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
|
LGTM |
…x's reserved version (BERTE-609) The previous commit only made the cascade/latest_micro fallback path phantom-hotfix-aware. It missed that _next_micro (computed by update_versions() from existing tags) takes unconditional priority in _set_target_versions() and is never itself adjusted for phantom hotfixes. This meant the common, realistic case -- a hotfix branched to patch an *already-tagged* micro line (e.g. hotfix/9.5.3 cut after 9.5.0/9.5.1/9.5.2 were tagged) -- still collided: dev/9.5 kept targeting 9.5.3 instead of skipping to 9.5.4, since _next_micro was already resolved to 3 before the hotfix ever existed. Add a floor: whenever a phantom hotfix reserves a micro on the same major.minor line, clamp the computed next_micro to at least reserved_micro + 1, regardless of which code path produced it. Skipped for three-digit dev branches, whose own version is not a "next" version but the branch's own identity. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
+ Coverage 90.00% 90.02% +0.01%
==========================================
Files 81 81
Lines 11048 11064 +16
==========================================
+ Hits 9944 9960 +16
Misses 1104 1104
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
charlesprost
deleted the
bugfix/BERTE-609-dev-branch-version-vs-pre-ga-hotfix
branch
July 23, 2026 20:41
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.
Summary
A pre-GA hotfix branch (e.g.
hotfix/10.0.0) permanently reserves itsX.Y.Zversion the moment it is cut: every version it can ever produce isX.Y.Z.<hfrev>(.0pre-GA,.1+ post-GA), never a bareX.Y.Z. The parent dev branch (development/10.0) must therefore targetX.Y.(Z+1), notX.Y.Z, or a laterX.Y.Ztag cut from the dev branch would collide with the hotfix line while describing different code.development/<major>already implemented this correctly againsthotfix/<major>.0.0;development/<major>.<minor>did not.Two separate gaps needed fixing, both in
BranchCascade(bert_e/workflow/gitwaterflow/branches.py):_update_major_versions()— the minor-branch path computedlatest_microonly from real cascade entries, never from phantom hotfix branches (self._phantom_hotfixes), unlike the major-only path which already folded them intolatest_minor. Fixed by mirroring that existing pattern._set_target_versions()— even after (1), the tag-driven_next_micro(set byupdate_versions()from existing tags) takes unconditional priority and was never itself checked against phantom hotfixes. This meant the common case — a hotfix cut to patch an already-tagged micro line (e.g.hotfix/9.5.3branched after9.5.0/9.5.1/9.5.2were already tagged) — still collided:development/9.5kept targeting9.5.3instead of9.5.4. Fixed by clamping the computednext_microto at leastreserved_micro + 1whenever a phantom hotfix reserves a micro on the same line, regardless of which code path produced the initial value.Audited the rest of the cascade for the same class of gap (queueing.py, jira.py's Fix Version check, the major-only path, 3-digit dev branches) — no other instance found; see commit messages for the reasoning trail.
Ref: BERTE-609
(Supersedes #277, closed automatically when its source branch was renamed to follow the
bugfix/BERTE-609-...naming convention.)Test plan
test_branch_cascade_2digit_with_pre_ga_hotfixupdated (no prior tag at the reserved micro)test_branch_cascade_pre_ga_hotfix_after_prior_releasesadded (hotfix cut after prior micro releases already tagged — the realistic case, and the one that exposed gap 2)QuickTestcascade/hotfix/phantom test class passing (30 tests)test_queueing.py/test_jira.pyunit tests passingTestQueueing/TaskQueueTestsfailures pre-exist on unmodifiedmain(require the full mock-server CLI harness, not bare pytest)🤖 Generated with Claude Code