feat: allow webhooks to specify consumer version matchers for when they are triggered #403
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.
Having done the "support triggering a verification build for each deployed version of the provider when the pact changes" the other day, I realised that we only want to do that for change to the master pact. Feature branch changes are irrelevant, and will just result in tying up build nodes that could be doing better things. I've been meaning to add better support specifying when a webhook should run for years, so now I've finally done it.
This PR adds support for
consumerVersionMatchers
in a webhook, that let you specify which branches or tags a webhook should be triggered for. One thing I'm not sure of - should they be calledconsumerVersionMatchers
orconsumerVersionFilters
. I don't want to override the "matchers" term, given we already have that in the pact terminology.I'll eventually add
providerVersionMatchers/Filters
too, but this is currently just solving my own problem 😆 Allowing both consumer version and provider version matchers will allow us to do things like "only do something when a master verification for a master pact comes in". I envisage people wanting "not" filters and regex filters too.