Ana Osorio
03/05/2024, 3:42 AMcontract_content_changed. In the webhook's body, I send the necessary information to initiate the provider build.
See the webhook in the đź§µ.
Is there a way to obtain not only the consumerVersionBranch but also the consumer's base branch? Something like: "consumerBaseBranch": "${pactbroker.consumerVersionBaseBranch}" . Any ideas? Thanks in advance.Ana Osorio
03/05/2024, 3:43 AM{
"description": "Trigger provider verification when contract content changes",
"events": [
{
"name": "contract_content_changed"
}
],
"request": {
"method": "POST",
"url": "<https://jenkins.something.org>",
"headers": {
"content-type": "application/json"
},
"body": {
"pactUrl": "${pactbroker.pactUrl}",
"consumerName": "${pactbroker.consumerName}",
"consumerVersion": "${pactbroker.consumerVersionNumber}",
"consumerBranch": "${pactbroker.consumerVersionBranch}",
"consumerTags": "${pactbroker.consumerVersionTags}",
"providerName": "${pactbroker.providerName}",
"providerVersion": "${pactbroker.providerVersionNumber}",
"providerBranch": "${pactbroker.providerVersionBranch}",
"providerTags": "${pactbroker.providerVersionTags}",
}
}
}Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
main or master?Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Ana Osorio
03/05/2024, 4:41 AMdevelop. Suppose a create a feature branch from there feat-1. So the base branch of feat-1 is develop.
But sometimes the base branch is a different branch than the default branch and we verify the contract there.
In the Jenkins pipeline that publish the contract I can obtain both the feature branch and the base branch. When publishing the contract I can send the name of the feature branch and access it in the webhook. But I also need the base branch and I don't know how to send it. Can the --branch flag accept a list of branches?
To publish the contracts we do something similar to this in the consumer pipeline:
def branchName = env.BRANCH_NAME
def baseBranchName = env.CHANGE_TARGET
"""
docker run --rm \
pactfoundation/pact-cli:latest \
publish \
pacts \
--consumer-app-version ${gitCommit} \
--broker-base-url=${brokerUrl} \
--tag=${tag} \
--branch=${branchName} \
"""Ana Osorio
03/05/2024, 4:50 AMMatt (pactflow.io / pact-js / pact-go)
But I also need the base branch and I don’t know how to send it. Can theNo, we don’t support that sorry. I don’t think we ought to build something like that either. What do you need the base branch for?flag accept a list of branches?--branch