Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion bert_e/tests/test_bert_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions bert_e/workflow/gitwaterflow/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<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)?" \
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ requests-mock==1.12.1
werkzeug==2.2.3
WTForms==3.2.1
jwt==1.3.1
setuptools<75
2 changes: 1 addition & 1 deletion settings.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ prefixes:
# automatically bypass issue tracker related checks.
#
# default value: empty
# accepted values: (improvement|bugfix|feature|project|documentation|dependabot)
# accepted values: (improvement|bugfix|feature|project|documentation|dependabot|copilot|claude)
bypass_prefixes:
- documentation
- dependabot
Expand Down
Loading