Skip to content

Commit

Permalink
bugfix: BERT3E-550 support lowercase jira keys
Browse files Browse the repository at this point in the history
  • Loading branch information
miniscruff committed Nov 9, 2021
1 parent c1c1bcf commit 598c44b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Change Log
All notable changes to this project will be documented in this file.

## [3.6.7] - 2021-11-09
# Changed
- Allow jira issue keys to be lowercase

## [3.6.6] - 2021-11-08
# Changed
- Track new pattern for epic branches

## [3.6.5] - 2021-10-29
# Fixed
- Build status is green with Github Action even if a step is skipped
Expand Down
5 changes: 5 additions & 0 deletions bert_e/tests/test_bert_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ def test_feature_branch_names(self):
self.assertEqual(src.jira_issue_key, 'TEST-0005')
self.assertEqual(src.jira_project, 'TEST')

# fix accidental lowercasing of JIRA project keys
src = self.feature_branch('project/test-0006')
self.assertEqual(src.jira_issue_key, 'TEST-0006')
self.assertEqual(src.jira_project, 'TEST')

src = self.feature_branch('feature/PROJECT-05-some-text_here')
self.assertEqual(src.jira_issue_key, 'PROJECT-05')
self.assertEqual(src.jira_project, 'PROJECT')
Expand Down
9 changes: 8 additions & 1 deletion bert_e/workflow/gitwaterflow/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,19 @@ class ReleaseBranch(GWFBranch):
class FeatureBranch(GWFBranch):
all_prefixes = ('improvement', 'bugfix', 'feature', 'project',
'documentation', 'design', 'dependabot', 'epic')
jira_issue_pattern = '(?P<jira_project>[A-Z0-9_]+)-[0-9]+'
jira_issue_pattern = '(?P<jira_project>[a-zA-Z0-9_]+)-[0-9]+'
prefixes = '(?P<prefix>(%s))' % '|'.join(all_prefixes)
pattern = "^(?P<feature_branch>%s/(?P<label>(?P<jira_issue_key>%s)?" \
"(?(jira_issue_key).*|.+)))$" % (prefixes, jira_issue_pattern)
cascade_producer = True

def __init__(self, repo, name):
super().__init__(repo, name)
if self.jira_issue_key:
self.jira_issue_key = self.jira_issue_key.upper()
if self.jira_project:
self.jira_project = self.jira_project.upper()


@total_ordering
class HotfixBranch(GWFBranch):
Expand Down

0 comments on commit 598c44b

Please sign in to comment.