-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(3143): Add regex for stage setup or teardown job names #574
feat(3143): Add regex for stage setup or teardown job names #574
Conversation
config/regex.js
Outdated
STAGE_SETUP_PATTERN: /^stage@([\w-]+):setup$/ | ||
STAGE_SETUP_PATTERN: /^stage@([\w-]+):setup$/, | ||
// Stage setup pattern. Can be stage@stage-name:setup or stage@stage-name:teardown | ||
STAGE_SETUP_TEARDOWN_PATTERN: /^stage@([\w-]+):(setup|teardown)$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets move this where the regex related to job names are declared.
May be after PR_JOB_NAME
STAGE_SETUP_TEARDOWN_PATTERN: /^stage@([\w-]+):(setup|teardown)$/ | |
STAGE_SETUP_TEARDOWN_JOB_NAME: /^stage@([\w-]+):(setup|teardown)$/ |
test/config/regex.test.js
Outdated
}); | ||
|
||
it('does not match invalid stage setup or teardown jobs', () => { | ||
['stage@alpha', 'alpha-deploy', 'alpha:setup', 'stage@setup'].forEach(trigger => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more samples stage@alpha:deploy
, stage@teardown
, sd@1234:stage@alpha:setup
, sd@1234:stage@alpha:teardown
config/regex.js
Outdated
@@ -45,6 +45,8 @@ module.exports = { | |||
JOB_NAME: /^(([\w-]+)|(?:stage@([\w-]+):(setup|teardown)))$/, | |||
// PR JOB Name can only be PR-1 or PR-1:main, group1: PR-prNum, group2: jobName | |||
PR_JOB_NAME: /^(PR-\d+)(?::([\w-]+))?$/, | |||
// Stage setup pattern. Can be stage@stage-name:setup or stage@stage-name:teardown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Stage setup pattern. Can be stage@stage-name:setup or stage@stage-name:teardown | |
// Stage setup or teardown job name. Can be stage@stage-name:setup or stage@stage-name:teardown |
🎉 This PR is included in version 23.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
No regex exists to check if a job is one of stage setup or teardown
Objective
Add regex to check if a job is a stage setup or teardown
References
screwdriver-cd/screwdriver#3143
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.