diff --git a/bert_e/tests/test_bert_e.py b/bert_e/tests/test_bert_e.py index 90009e56..169e371e 100644 --- a/bert_e/tests/test_bert_e.py +++ b/bert_e/tests/test_bert_e.py @@ -301,6 +301,14 @@ def test_feature_branch_names(self): self.assertIsNone(src.jira_issue_key) self.assertIsNone(src.jira_project) + src = self.feature_branch('copilot/fix-authentication-bug') + self.assertIsNone(src.jira_issue_key) + self.assertIsNone(src.jira_project) + + src = self.feature_branch('claude/fix-authentication-bug') + self.assertIsNone(src.jira_issue_key) + self.assertIsNone(src.jira_project) + def test_destination_branch_names(self): with self.assertRaises(exns.BranchNameInvalid): @@ -1558,7 +1566,9 @@ def test_not_my_job_cases(self): 'feature/invalid', 'hotfix/customer', 'hotfix/6.6.6.1', - 'dependabot/npm_and_yarn/ui/lodash-4.17.13']: + 'dependabot/npm_and_yarn/ui/lodash-4.17.13', + 'copilot/add-new-feature', + 'claude/add-new-feature']: create_branch(self.gitrepo, destination, file_=True, from_branch='development/4.3') pr = self.contributor_bb.create_pull_request( @@ -4694,6 +4704,50 @@ def test_dependabot_pr(self): backtrace=True ) + def test_copilot_pr(self): + """Test a simple copilot PR. + + Similar to dependabot, copilot branches should work without + a Jira ticket when properly configured. + """ + pr = self.create_pr('copilot/fix-authentication-bug', + 'development/4.3') + with self.assertRaises(exns.SuccessMessage): + self.handle( + pr.id, + options=[ + # bypass_author to be removed once we support it properly + 'bypass_author_approval', + 'bypass_jira_check', + 'bypass_leader_approval', + 'bypass_build_status', + 'bypass_peer_approval', + ], + backtrace=True + ) + + def test_claude_pr(self): + """Test a simple claude PR. + + Similar to dependabot and copilot, claude branches should work + without a Jira ticket when properly configured. + """ + pr = self.create_pr('claude/fix-authentication-bug', + 'development/4.3') + with self.assertRaises(exns.SuccessMessage): + self.handle( + pr.id, + options=[ + # bypass_author to be removed once we support it properly + 'bypass_author_approval', + 'bypass_jira_check', + 'bypass_leader_approval', + 'bypass_build_status', + 'bypass_peer_approval', + ], + backtrace=True + ) + def test_init_message(self): pr = self.create_pr('bugfix/TEST-00001', 'development/4.3') self.handle(pr.id) diff --git a/bert_e/workflow/gitwaterflow/branches.py b/bert_e/workflow/gitwaterflow/branches.py index 0d40ee73..e2d62abe 100644 --- a/bert_e/workflow/gitwaterflow/branches.py +++ b/bert_e/workflow/gitwaterflow/branches.py @@ -163,8 +163,8 @@ class ReleaseBranch(GWFBranch): class FeatureBranch(GWFBranch): all_prefixes = ('improvement', 'bugfix', 'feature', 'project', - 'documentation', 'design', 'dependabot', 'epic', - 'bug') + 'documentation', 'design', 'dependabot', 'copilot', + 'claude', 'epic', 'bug') jira_issue_pattern = '(?P[a-zA-Z0-9_]+)-[0-9]+' prefixes = '(?P(%s))' % '|'.join(all_prefixes) pattern = "^(?P%s/(?P