From 598c44b03b1fcd62a38ad12094cfee251591ea9b Mon Sep 17 00:00:00 2001 From: Ronnie Smith Date: Tue, 9 Nov 2021 10:56:18 -0800 Subject: [PATCH] bugfix: BERT3E-550 support lowercase jira keys --- CHANGELOG | 8 ++++++++ bert_e/tests/test_bert_e.py | 5 +++++ bert_e/workflow/gitwaterflow/branches.py | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 3ad5af44..f407ac74 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/bert_e/tests/test_bert_e.py b/bert_e/tests/test_bert_e.py index fb42f93c..e273bc9f 100644 --- a/bert_e/tests/test_bert_e.py +++ b/bert_e/tests/test_bert_e.py @@ -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') diff --git a/bert_e/workflow/gitwaterflow/branches.py b/bert_e/workflow/gitwaterflow/branches.py index c896c472..9d63dcee 100644 --- a/bert_e/workflow/gitwaterflow/branches.py +++ b/bert_e/workflow/gitwaterflow/branches.py @@ -99,12 +99,19 @@ class ReleaseBranch(GWFBranch): class FeatureBranch(GWFBranch): all_prefixes = ('improvement', 'bugfix', 'feature', 'project', 'documentation', 'design', 'dependabot', 'epic') - jira_issue_pattern = '(?P[A-Z0-9_]+)-[0-9]+' + jira_issue_pattern = '(?P[a-zA-Z0-9_]+)-[0-9]+' prefixes = '(?P(%s))' % '|'.join(all_prefixes) pattern = "^(?P%s/(?P