Skip to content

fix: dev branch must skip past a pre-GA hotfix's reserved micro version (BERTE-609)#278

Merged
charlesprost merged 2 commits into
mainfrom
bugfix/BERTE-609-dev-branch-version-vs-pre-ga-hotfix
Jul 23, 2026
Merged

fix: dev branch must skip past a pre-GA hotfix's reserved micro version (BERTE-609)#278
charlesprost merged 2 commits into
mainfrom
bugfix/BERTE-609-dev-branch-version-vs-pre-ga-hotfix

Conversation

@charlesprost

@charlesprost charlesprost commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

A pre-GA hotfix branch (e.g. hotfix/10.0.0) permanently reserves its X.Y.Z version the moment it is cut: every version it can ever produce is X.Y.Z.<hfrev> (.0 pre-GA, .1+ post-GA), never a bare X.Y.Z. The parent dev branch (development/10.0) must therefore target X.Y.(Z+1), not X.Y.Z, or a later X.Y.Z tag cut from the dev branch would collide with the hotfix line while describing different code. development/<major> already implemented this correctly against hotfix/<major>.0.0; development/<major>.<minor> did not.

Two separate gaps needed fixing, both in BranchCascade (bert_e/workflow/gitwaterflow/branches.py):

  1. _update_major_versions() — the minor-branch path computed latest_micro only from real cascade entries, never from phantom hotfix branches (self._phantom_hotfixes), unlike the major-only path which already folded them into latest_minor. Fixed by mirroring that existing pattern.
  2. _set_target_versions() — even after (1), the tag-driven _next_micro (set by update_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.3 branched after 9.5.0/9.5.1/9.5.2 were already tagged) — still collided: development/9.5 kept targeting 9.5.3 instead of 9.5.4. Fixed by clamping the computed next_micro to at least reserved_micro + 1 whenever 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_hotfix updated (no prior tag at the reserved micro)
  • New test_branch_cascade_pre_ga_hotfix_after_prior_releases added (hotfix cut after prior micro releases already tagged — the realistic case, and the one that exposed gap 2)
  • Full QuickTest cascade/hotfix/phantom test class passing (30 tests)
  • test_queueing.py/test_jira.py unit tests passing
  • Verified unrelated TestQueueing/TaskQueueTests failures pre-exist on unmodified main (require the full mock-server CLI harness, not bare pytest)

🤖 Generated with Claude Code

…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>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

LGTM

Review by Claude Code

…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>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

LGTM

Review by Claude Code

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.02%. Comparing base (b35e425) to head (9408a13).

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              
Flag Coverage Δ
integration 87.78% <100.00%> (+0.02%) ⬆️
tests 87.74% <100.00%> (+0.02%) ⬆️
tests-BuildFailedTest 25.79% <5.26%> (-0.04%) ⬇️
tests-QuickTest 33.14% <100.00%> (+0.12%) ⬆️
tests-RepositoryTests 25.46% <5.26%> (-0.04%) ⬇️
tests-TaskQueueTests 49.48% <42.10%> (+<0.01%) ⬆️
tests-TestBertE 66.94% <42.10%> (-0.04%) ⬇️
tests-TestQueueing 51.59% <42.10%> (-0.01%) ⬇️
tests-api-mock 14.71% <0.00%> (-0.03%) ⬇️
tests-noqueue 78.42% <100.00%> (+0.03%) ⬆️
tests-noqueue-BuildFailedTest 25.79% <5.26%> (-0.04%) ⬇️
tests-noqueue-QuickTest 33.14% <100.00%> (+0.12%) ⬆️
tests-noqueue-RepositoryTests 25.46% <5.26%> (-0.04%) ⬇️
tests-noqueue-TaskQueueTests 49.48% <42.10%> (+<0.01%) ⬆️
tests-noqueue-TestBertE 63.50% <42.10%> (-0.03%) ⬇️
tests-noqueue-TestQueueing 25.49% <5.26%> (-0.04%) ⬇️
tests-server 27.21% <0.00%> (-0.04%) ⬇️
unittests 42.27% <0.00%> (-0.07%) ⬇️
utests 27.65% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@charlesprost
charlesprost merged commit a6e95a1 into main Jul 23, 2026
19 checks passed
@charlesprost
charlesprost deleted the bugfix/BERTE-609-dev-branch-version-vs-pre-ga-hotfix branch July 23, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant