Skip to content

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
}
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

@v1v v1v closed this Nov 22, 2025
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