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
No way to configure webhooks for setting github commit statuses when multiple provider verifications are performed #273
Comments
Hi @vgrigoruk. Unfortunately, I don't think that there is any way to make the github statuses do what you want using the information that's available to the Pact Broker. In scenario 1, how is the contract_published webhook supposed to know that you have two builds being kicked off, and what the names of the provider version tags will be when they don't exist yet? What you could do is send a pending status update from the actual triggered CI build, before it starts. That way you know what the provider version tag is supposed to be, and the pending status will only be sent when there is going to be a result coming soon. In scenario 2, what underlying logic would you want to make the statuses work the way you'd want it, and how would you make it backwards compatible for existing users? |
Ok! I've had a think while I was walking to work from the station (my best thinking time!) When declarative logic is not solving a problem, it's time to move to procedural code. Let's use the right tool for the right problem. Here's what I'd do. I'd have a single You may be able to reuse this for the provider_verification_published webhook as well, and keep all the logic in one place. |
Thanks for feedback and suggestions @bethesque! |
Interested to hear how this went @vgrigoruk |
We're using a free beta of hosted pact broker at https://pact.dius.com.au/
Our delivery pipelines for consumer and provider are designed in a way that github
master
branch is automatically deployed tostaging
environment andrelease
branch deployed toproduction
. We use git commitSHA-1
for provider and consumer versioning. Also, consumer contracts are tagged withgit branch
name. Provider application versions are tagged with eitherstaging
orproduction
tag (depends on which version of provider code was used to run contract verification).Here are the webhooks we've configured:
But, every time we create commits in consumer codebase, we see that commit statuses are not working as expected.
Scenario 1
Expected result: 2 statuses are created on consumer github commit:
context: api staging
andcontext: api production
Actual result: only 1 commit status is created on consumer github commit
context: api[space]
, as${pactbroker.providerVersionTags}
is not available at this moment.master
andrelease
code branches (provider versions are tagged withstaging
andproduction
tags).Scenario 2
Expected result: 2 statuses are created on consumer github commit
context: api staging
andcontext: api production
Actual result: only 1 status is created on consumer github commit (either
context: api staging
orcontext: api production
, based on which verification was latest)The text was updated successfully, but these errors were encountered: