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

Enable changeset when pattern comparator with fullMatch #367

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

v1v
Copy link
Member

@v1v v1v commented Dec 10, 2019

@v1v v1v changed the title :wip: Enable changeset when pattern comparator with fullMatch Enable changeset when pattern comparator with fullMatch Mar 4, 2020
@v1v v1v marked this pull request as ready for review March 4, 2020 11:39
@@ -51,5 +51,13 @@ pipeline {
echo "With regexp"
}
}
stage("Four") {
when {
changeset pattern: '(.*\\.js|Jenkinsfile)', comparator: 'regexp', shouldMatchAll: true
Copy link
Contributor

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?

Suggested change
changeset pattern: '(.*\\.js|Jenkinsfile)', comparator: 'regexp', shouldMatchAll: true
changeset pattern: '^(.*\\.js|Jenkinsfile)$', comparator: 'regexp'

Copy link
Member Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants