James Bourne
04/26/2024, 10:27 AMPACT_URL
through to pactUrls
e.g.
const getWebhookConfig: () => Partial<VerifierOptions> = () => ({
...(process.env.PACT_URL ? { pactUrls: [process.env.PACT_URL] } : {}),
});
I’m not passing any consumerVersionSelectors
through to the verifier, but I’m still seeing additional pacts being verified e.g.
The pact at /pacts/provider/OrderApi/consumer/OrderWeb/pact-version/a35bc17d448c90799f325b3f25bf79ab5e52a1b7 is being verified because the pact content belongs to the consumer version matching the following criterion:
* consumer version(s) currently deployed to test (73f8b19456b2deb6d041c4363f583c03156dd469)
and
The pact at /pacts/provider/OrderApi/consumer/OrderWeb/pact-version/5acaf2b2f1201889a93d933f4782de68a571533f is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version of OrderWeb from the main branch 'main' (18a22a96bed11ce6a612b1f02eb702649de95036)
Is this expected behaviour to still verify pacts from main when I’m only passing pactUrls
through?Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
/for-verification
endpointJames Bourne
04/26/2024, 11:00 AMPact Verification Options {
provider: 'OrderApi',
publishVerificationResult: false,
providerVersion: 'dev',
providerVersionBranch: 'main',
logLevel: 'error',
providerBaseUrl: '<http://localhost:60905>',
pactUrls: [
'<https://contentful.pactflow.io/pacts/provider/OrderApi/consumer/OrderWeb/pact-version/07fac56c66697041bf18268587336c6cdf4ea418/metadata/Y3ZuPWY0NDkyNjgyZWY1NDQ0YWVmYTZmOGY3YmNlOWI0Y2IwZWFiNzBiNDkmdz10cnVl>'
]
}
James Bourne
04/26/2024, 11:03 AM[13:02:12.291] DEBUG (24492): pact-core@14.3.3: checking source type of given pactUrl: <https://contentful.pactflow.io/pacts/provider/OrderApi/consumer/OrderWeb/pact-version/07fac56c66697041bf18268587336c6cdf4ea418/metadata/Y3ZuPWY0NDkyNjgyZWY1NDQ0YWVmYTZmOGY3YmNlOWI0Y2IwZWFiNzBiNDkmdz10cnVl>
[13:02:12.292] DEBUG (24492): pact-core@14.3.3: adding <https://contentful.pactflow.io/pacts/provider/OrderApi/consumer/OrderWeb/pact-version/07fac56c66697041bf18268587336c6cdf4ea418/metadata/Y3ZuPWY0NDkyNjgyZWY1NDQ0YWVmYTZmOGY3YmNlOWI0Y2IwZWFiNzBiNDkmdz10cnVl> as a Url source
James Bourne
04/26/2024, 11:05 AM2024-04-26T11:02:15.632168Z DEBUG ThreadId(02) pact_verifier::pact_broker: final URL = <https://contentful.pactflow.io/pacts/provider/OrderApi/for-verification>
2024-04-26T11:02:15.632233Z DEBUG ThreadId(02) pact_verifier::pact_broker: Sending JSON to <https://contentful.pactflow.io/pacts/provider/OrderApi/for-verification> using POST: {"includePendingStatus":false,"consumerVersionSelectors":[],"providerVersionBranch":"main"}
James Bourne
04/26/2024, 11:11 AM$ http '<https://contentful.pactflow.io/pacts/provider/OrderApi/for-verification>' "Authorization: Bearer $PACT_BROKER_TOKEN" includePendingStatus:=false consumerVersionSelectors:=[] providerVersionBranch=main
and this is the response I get back:James Bourne
04/26/2024, 11:17 AMconsumerVersionSelectors:='[{"mainBranch": true}]'
, I get back only a single verification latest from main branch
James Bourne
04/26/2024, 11:18 AMconsumerVersionSelectors
is defaulting to something like [{"mainBranch": true}, {"deployedOrReleased": true}]
if I pass it as []
Yousaf Nabi (pactflow.io)
provider
It seems to the only difference I can gather between my setup here, for splitting our consumer changes (by pact url) and provider changes (by consumer version selectors)
• https://github.com/pactflow/example-provider/blob/master/src/product/product.consumerChange.pact.test.js
• https://github.com/pactflow/example-provider/blob/master/src/product/product.providerChange.pact.test.js
• https://github.com/pactflow/example-provider/blob/master/src/product/pact.setup.jsYousaf Nabi (pactflow.io)
provider
is set, it is using that, without any consumer version selectors, to grab the pacts for verification by name without any selectors bar the providerVersionBranch (which would be relevant if you had say matchingBranch as a consumer version selector)James Bourne
04/26/2024, 12:59 PMYousaf Nabi (pactflow.io)
James Bourne
04/26/2024, 1:31 PMMatt (pactflow.io / pact-js / pact-go)