#1427: Prevent job triggering for non-matching webhooks #1720
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
8ec69c7 introduced a change that does not handle jobs created using Jenkins DSL properly, as DSL jobs that do not specify
triggerOpenMergeRequestOnPush
have thetriggerOpenMergeRequest
value passed intoMergeRequestHookTriggerHandlerFactory
asnull
, with the above change causing the value not to be handled asnever
where the plugin previously treatednull
asnever
. This results in webhooks triggering builds for DSL-created jobs even where the job is doing actions that aren't valid for a Merge Request in that state (e.g. triggering release builds even though the Merge Request hasn't been merged). This change returns to handling an unspecifiedtriggerOpenMergeRequest
value as being equivalent to specifying it asnever
.Testing done
Automated test to cover failing scenario.
Submitter checklist