-
Notifications
You must be signed in to change notification settings - Fork 248
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
Enable changeset when pattern comparator with fullMatch #367
base: master
Are you sure you want to change the base?
Conversation
@@ -51,5 +51,13 @@ pipeline { | |||
echo "With regexp" | |||
} | |||
} | |||
stage("Four") { | |||
when { | |||
changeset pattern: '(.*\\.js|Jenkinsfile)', comparator: 'regexp', shouldMatchAll: true |
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.
If we need this, it looks good. But could the same behavior be achieved like this?
changeset pattern: '(.*\\.js|Jenkinsfile)', comparator: 'regexp', shouldMatchAll: true | |
changeset pattern: '^(.*\\.js|Jenkinsfile)$', comparator: 'regexp' |
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.
If this is related to the test example, probably it could be improved, if it's related to this PR, then I've got some doubts if the regex could help since the current pattern is searched with anyMatch
https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/367/files#diff-cbce163a23e232096d8a5d0ef5bddf31L113
For instance, one particular use case could be when changes are not related to the source code but some markdown files or files in the docs folder, therefore the pattern (.*\\.md|docs/.*)
could help, but what if the changeset contains docs and source code, then this particular feature could help to enable stages for compiling/testing the project.
Please let me know if I misunderstood your question, thanks
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.
+1 -- I'm looking for exactly this feature. @bitwiseman -- this is for matching all files in the changeset and not about matching the entire filename
shouldMatchAll
argument to match all the elements with the given pattern.help-*.html
.