Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC4J-651 JirabotMerge: Allow multiple projects to be configured #762

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
23 changes: 15 additions & 8 deletions .github/workflows/JirabotMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ jobs:

releaseTagPattern = releaseTagPrefix
if major is not None:
releaseTagPattern += str(major) + '\.'
releaseTagPattern += str(major) + '\\.'
else:
releaseTagPattern += '[0-9]+\.'
releaseTagPattern += '[0-9]+\\.'

if minor is not None:
releaseTagPattern += str(minor) + '\.'
releaseTagPattern += str(minor) + '\\.'
else:
releaseTagPattern += '[0-9]+\.'
releaseTagPattern += '[0-9]+\\.'

if point is not None:
releaseTagPattern += str(point) + '(-[0-9]+)?'
Expand Down Expand Up @@ -254,14 +254,21 @@ jobs:
print('Error: PROJECT_CONFIG is missing required fields: tagPrefix and/or tagPostfix')
sys.exit(1)

project_name = projectConfig.get('projectName')
if project_name is None:
print('Error: PROJECT_CONFIG is missing required field: projectName')
project_prefixes = projectConfig.get('projectPrefixes')
if not project_prefixes:
print('Error: PROJECT_CONFIG is missing required field: projectPrefixes. Add a "projectPrefixes" JSON array of project prefix strings to the PROJECT_CONFIG.')
sys.exit(1)

if not isinstance(project_prefixes, list):
print('Error: PROJECT_CONFIG field projectPrefixes is not a valid JSON array, aborting.')
sys.exit(1)

project_list_regex = '|'.join(project_prefixes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming PROJECT_CONFIG can now be comprised of multiple project names delimited by '|' ? It might be worth explicitly defining the newly supported syntax somewhere.
Also, perhaps outside the scope of this change but the Errors regarding PROJECT_CONFIG could be more informative about what PROJECT_CONFIG is (github action variable)


result = ''
issuem = re.search("(" + project_name + ")-[0-9]+", title, re.IGNORECASE)
issuem = re.search("(" + project_list_regex + ")-[0-9]+", title, re.IGNORECASE)
if issuem:
project_name = issuem.group(1)
issue_name = issuem.group()

jira = Jira(url=jira_url, username=jirabot_user, password=jirabot_pass, cloud=True)
Expand Down
Loading