Rubén Pérez
09/02/2022, 6:26 AMWebhook triggering. Reading the documentation here, I can see this:
If the relevant consumer version has any tags, then for each tag, check if the content is different from the previous latest version for that tag. It is 'changed' if any of the checks are true. One side effect of this is that brand new tags will trigger a pact changed event, even if the content is the same as a previous version.Reading this, some questions come to my mind: 1. Does it work for
branches that way? I mean, if we used branches instead of tags, it would still trigger an execution for every new branch even if there are no changes to the contract? (Currently we are using both branch and tags)
2. Would it happen that way too with the contract_requiring_verification_published event? We are still using the old contract_content_changed 🙂
3. Is there a way to "disable" those "side-effect" executions? I would like to avoid them if the contract does not include actual changes.
4. I'm pretty sure there is a reason why every new branch triggers an execution, but I'm struggling at understanding it 😅, because that new branch may or may not introduce actual contract changes. Could anyone help me understand that?
Thank you! 🙂Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
I’m pretty sure there is a reason why every new branch triggers an execution, but I’m struggling at understanding itYou may have random data in your pacts.
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
• It only triggers if there is a verification result missing for one of the critical provider versions, reducing the number of unnessary builds triggered.
Rubén Pérez
09/02/2022, 6:47 AMIt only triggers if there is a verification result missing for one of the critical provider versions, reducing the number of unnessary builds triggered.So moving to the newer event should solve our current "issue". As far as your other comments, I checked the diff to see what changed and why the webhook triggered, but in this case what I saw was pretty confusing to me. I will try to explain it. We have an issue with random data previously that we caught using that diff (you folks helped me with that previously 🙂 ), but in this case what I see in the diff doesn't make a lot of sense to me. It shows changes in the contract (real changes, no random data), but those changes are not between the code versions I'm trying to compare. It shows differences that are not actual differences in the code... so maybe I did the wrong comparison, or maybe the comparison doesn't work so smoothly when new branch/tags appear
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/02/2022, 6:51 AMRubén Pérez
09/02/2022, 6:52 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/02/2022, 6:55 AMGithub - publish commit status and the slack notifications.
As I see, the Travis - trigger build is still documented using the old event... so I think now I see what you meant 🙂Rubén Pérez
09/02/2022, 6:56 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/02/2022, 6:56 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/07/2022, 6:47 AMRubén Pérez
09/07/2022, 1:55 PMUpdate the webhook body to pass in theWhy do I need to send that information? I mean, what I understand is that we should check the new contract with our "main branch" version of the provider, and with the versions deployed in our defined environments (for example, production). But I'm not sure if those parameters will do the trick (not all of them are documented here)as the commit and${pactbroker.providerVersionNumber}as the branch${pactbroker.providerVersionBranch}
Rubén Pérez
09/07/2022, 4:18 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/08/2022, 7:01 AMmaster branch and one for our production environment (we don't have any other defined environment at the moment, as we don't think we need it).
So the Pact Broker will trigger both builds (assuming both provider versions are different), and for each one it will replace those placeholders (${pactbroker.providerVersionNumber} and ${pactbroker.providerVersionBranch}) for the value they should have for those 2 different cases.
Is that right?Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/08/2022, 7:09 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Rubén Pérez
09/14/2022, 7:18 AMRubén Pérez
09/15/2022, 2:08 PMRubén Pérez
09/15/2022, 2:08 PM{
"events": [{
"name": "contract_requiring_verification_published"
}],
"request": {
"method": "POST",
"url": "<https://api.travis-ci.org/repo/><organization>%2F${pactbroker.providerName}/requests",
"headers": {
"Content-Type": "application/json",
"Travis-API-Version": "3",
"Authorization": "token TOKEN"
},
"body": {
"request": {
"message": "Triggered by changed pact for ${pactbroker.consumerName} version ${pactbroker.consumerVersionNumber}",
"branch": "\${pactbroker.providerVersionBranch}",
"sha": "\${pactbroker.providerVersionNumber}",
"config": {
"env": {
"global": [
"PACT_URL=\${pactbroker.pactUrl}"
]
}
}
}
}
}
}Rubén Pérez
09/15/2022, 2:09 PMRubén Pérez
09/15/2022, 2:25 PM