From d1a3fbc147059abc0ae8cb0a7ba8c57540ff8ff7 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:30:52 +0000 Subject: [PATCH] finish it up with all todos --- bert_e/tests/test_bert_e.py | 11 +++++++++++ bert_e/workflow/gitwaterflow/branches.py | 5 ----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bert_e/tests/test_bert_e.py b/bert_e/tests/test_bert_e.py index bd25bc5b..48a8fb65 100644 --- a/bert_e/tests/test_bert_e.py +++ b/bert_e/tests/test_bert_e.py @@ -744,6 +744,17 @@ def test_major_development_branch_no_tag_bump(self): fixver = ['4.3.19', '4.4.0', '5.1.5', '10.0.0', '10.1.0'] self.finalize_cascade(branches, tags, destination, fixver) + def test_major_dev_branch_lonely_stab(self): + destination = 'stabilization/6.1.5' + branches = OrderedDict({ + 1: {'name': 'stabilization/6.1.5', 'ignore': False}, + 2: {'name': 'development/6', 'ignore': False} + }) + tags = [] + fixver = ['6.1.5', '6.2.0'] + with self.assertRaises(exns.DevBranchDoesNotExist): + self.finalize_cascade(branches, tags, destination, fixver) + def test_retry_handler(self): class DummyError(Exception): pass diff --git a/bert_e/workflow/gitwaterflow/branches.py b/bert_e/workflow/gitwaterflow/branches.py index 978d0950..dbf29c45 100644 --- a/bert_e/workflow/gitwaterflow/branches.py +++ b/bert_e/workflow/gitwaterflow/branches.py @@ -1031,11 +1031,6 @@ def _set_target_versions(self, dst_branch): self.target_versions.append('%d.%d.%d' % ( major, minor, dev_branch.micro + offset)) elif dev_branch and dev_branch.has_minor is False: - # TODO: handle case with stab/x.y.z with no dev/x.y - # -> no need as stab/x.y.z cannot exist without a dev/x.y - # TODO: handle case where dev/1 and dev/1.0 exists - # but no 1.0.0 tag - # -> Should return 1.0.0 only self.target_versions.append( f"{major}." f"{dev_branch.latest_minor + 1}."