Skip to content

Commit

Permalink
BERTE-582 support of tags created with v prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Nov 14, 2023
1 parent 1da2db7 commit 590cbe8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [3.10.0] - 2023-11-14
# Added
- Support of tags created with `v` prefix.

## [3.9.0] - 2023-07-20
# Added
- Introducing a new option that prevent the creation of
Expand Down
20 changes: 20 additions & 0 deletions bert_e/tests/test_bert_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,26 @@ def test_tags_with_stabilization(self):
with self.assertRaises(exns.DeprecatedStabilizationBranch):
self.finalize_cascade(branches, tags, destination, fixver)

def test_with_v_prefix(self):
destination = 'development/4.3'
branches = OrderedDict({
1: {'name': 'stabilization/4.3.18', 'ignore': True},
2: {'name': 'development/4.3', 'ignore': False},
3: {'name': 'stabilization/5.1.4', 'ignore': True},
4: {'name': 'development/5.1', 'ignore': False},
5: {'name': 'development/10.0', 'ignore': False}
})
# mix and match tags with v prefix and without
tags = ['4.3.16', '4.3.17', '4.3.18_rc1',
'v5.1.3', 'v5.1.4_rc1', 'v10.0.1']
fixver = ['4.3.19', '5.1.5', '10.0.2']
self.finalize_cascade(branches, tags, destination, fixver)
# only tags with v prefix
v_tags = ['v4.3.16', 'v4.3.17', 'v4.3.18_rc1', 'v5.1.3',
'v5.1.4_rc1', 'v10.0.1']
# expect the same result
self.finalize_cascade(branches, v_tags, destination, fixver)

def test_retry_handler(self):
class DummyError(Exception):
pass
Expand Down
2 changes: 1 addition & 1 deletion bert_e/workflow/gitwaterflow/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def add_branch(self, branch, dst_branch=None):

def update_micro(self, tag):
"""Update development branch latest micro based on tag."""
pattern = r"^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<micro>\d+)" \
pattern = r"^v?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<micro>\d+)" \
r"(\.(?P<hfrev>\d+)|)$"
match = re.match(pattern, tag)
if not match:
Expand Down

0 comments on commit 590cbe8

Please sign in to comment.