Tatiana
01/26/2023, 6:26 PM--consumer-version-tags="main"
for provider verification job but then the first scenario won’t work, the provider will always take the contract with main
tag which is assigned after merge to the main branch.
Also, I can create two verification jobs for provider, one will be triggered by webhook only, another one will run when merge request is opened from provider. But it doesn’t look great.
Do you have any ideas how I can achieve my desired result described above? Maybe I can play with tags somehow or pass something to my webhook? Please advice 🙂Tatiana
01/26/2023, 6:47 PMTatiana
01/26/2023, 6:48 PMverify contracts:
stage: validate
image:
name: pactfoundation/pact-ref-verifier:latest
script:
- >-
/usr/local/bin/pact_verifier_cli
--hostname="app"
--broker-url="$PACT_BROKER_BASE_URL"
--token="$PACT_BROKER_TOKEN"
--loglevel="info"
--provider-branch="$CI_COMMIT_REF_SLUG"
--provider-version="$CI_COMMIT_SHA"
--provider-tags="$CI_COMMIT_REF_NAME"
--consumer-version-tags="main"
--provider-name="dummy-microservice-provider"
--publish
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_MERGE_REQUEST_ID
- if: $CI_PIPELINE_SOURCE == "trigger"
Tatiana
01/26/2023, 7:11 PMlatest
published contract version when a webhook triggers the verification.
And I’d like to take the contract published from main
branch only in other cases.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Tatiana
01/26/2023, 11:36 PM--consumer-version-tags
?Tatiana
01/27/2023, 12:44 AM--consumer-version-selectors="{\"mainBranch\": true}"
.
1. I provided the link to the latest contract. See screenshot. It works just fine and the latest published contract is taken until I provided selectorsTatiana
01/27/2023, 12:46 AM--consumer-version-selectors="{\"mainBranch\": true}"
for my gitLab verification job. But now contracts posted from the main branch are taken only by webhook despite the fact that I specifically provided the url to the latest published contract in webhook.Tatiana
01/27/2023, 12:50 AMTatiana
01/27/2023, 12:51 AMTatiana
01/27/2023, 2:35 AMYousaf Nabi (pactflow.io)
Tatiana
01/27/2023, 1:01 PMYousaf Nabi (pactflow.io)