-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add exclude_strict_matching
configuration
#77
Conversation
Added a new feature named `exclude_strict_matching` which actually allows projects to exclude jobs based on partially matching values. Examples: ```json { "additional_checks": [ { "name": "Do whatever", "job": { "php": "*", "dependencies": "*", "command": "some command" } } ], "exclude": [ { "name": "Do whatever on PHP 8." } ], "exclude_strict_matching": false, } ``` In projects with multiple PHP versions supported, starting from PHP 7.4, every job on PHP 8.0+ will be excluded. Prior to this change, one had to add multiple excludes with all combinations of PHP version + dependencies. Signed-off-by: Maximilian Bösing <[email protected]>
Signed-off-by: Maximilian Bösing <[email protected]>
4c8cd4d
to
67f979a
Compare
@@ -271,7 +282,7 @@ export default function (config) { | |||
.filter(function (job) { | |||
let keep = true; | |||
config.exclude.forEach(function (exclusion) { | |||
keep = keep && ! excludeJob(job, exclusion); | |||
keep = keep && ! excludeJob(job, exclusion, config.exclude_strict_matching); |
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.
I think you want a !
on the config.exclude_strict_matching
here as if set to true, it sets strict_comparison
to true inside excludeJob
, which is the opposite of the intent.
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.
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.
Looking at around line 254 of your version of this file, if the 3rd argument is true, then it will return early and won't allow loser matchings. Unless I've missed something (very possible) this appears to be the inverse of the intent.
Closing this in favor of the idea of #93 |
Description
Added a new feature named
exclude_strict_matching
which actually allows projects to exclude jobs based on partially matching values.Examples:
In projects with multiple PHP versions supported, starting from PHP 7.4, every job on PHP 8.0+ will be excluded.
Prior to this change, one had to add multiple excludes with all combinations of PHP version + dependencies.
Will add additional changes to address ideas posted by @Ocramius in #76 (comment)