Skip to content

Commit 73427f4

Browse files
authored
BERTE-582 support of tags created with v prefix (#153)
1 parent 1da2db7 commit 73427f4

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [3.10.0] - 2023-11-14
5+
# Added
6+
- Support of tags created with `v` prefix.
7+
48
## [3.9.0] - 2023-07-20
59
# Added
610
- Introducing a new option that prevent the creation of

bert_e/tests/test_bert_e.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,26 @@ def test_tags_with_stabilization(self):
670670
with self.assertRaises(exns.DeprecatedStabilizationBranch):
671671
self.finalize_cascade(branches, tags, destination, fixver)
672672

673+
def test_with_v_prefix(self):
674+
destination = 'development/4.3'
675+
branches = OrderedDict({
676+
1: {'name': 'stabilization/4.3.18', 'ignore': True},
677+
2: {'name': 'development/4.3', 'ignore': False},
678+
3: {'name': 'stabilization/5.1.4', 'ignore': True},
679+
4: {'name': 'development/5.1', 'ignore': False},
680+
5: {'name': 'development/10.0', 'ignore': False}
681+
})
682+
# mix and match tags with v prefix and without
683+
tags = ['4.3.16', '4.3.17', '4.3.18_rc1',
684+
'v5.1.3', 'v5.1.4_rc1', 'v10.0.1']
685+
fixver = ['4.3.19', '5.1.5', '10.0.2']
686+
self.finalize_cascade(branches, tags, destination, fixver)
687+
# only tags with v prefix
688+
v_tags = ['v4.3.16', 'v4.3.17', 'v4.3.18_rc1', 'v5.1.3',
689+
'v5.1.4_rc1', 'v10.0.1']
690+
# expect the same result
691+
self.finalize_cascade(branches, v_tags, destination, fixver)
692+
673693
def test_retry_handler(self):
674694
class DummyError(Exception):
675695
pass

bert_e/workflow/gitwaterflow/branches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ def add_branch(self, branch, dst_branch=None):
843843

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

0 commit comments

Comments
 (0)