Only once it's uploaded. The Pact URL should be st...
# pact-broker
m
Only once it's uploaded. The Pact URL should be stable
j
How can I find it in the broker?
m
So the inputs to the URL should be known in advance
Why do you want to do this though? As soon as it gets to the broker, the webhook will trigger within a few seconds anyway?
j
There are instances where can-i-deploy fails in higher environments due to missing verifications between versions. In those instances, we use a combination of provider version, consumer name/tag to trigger a custom verification so that we dont block pipelines but are validating the correct interaction. I wondered rather than capturing this information, if we can just pass a pact url for this verification but I've no idea where it comes from/how I would be able to generate a url for say Consumer A needs to verify against Provider X, there is no pre-verified pact so here is a URL, trigger the webhook (or at least give a url that we can pass into our pipeline to fulfil the missing verification
👍 1
m
rightyo. I’m assuming you’re checking out the various provider versions (i.e. different verification targets) when the webhook fires, and not just testing against mainline each time?
j
Correct
m
So I think you could Run the
can-i-deploy
command with the
--json
output, and then grab the version of the failing consumers. From there, you could construct the Pact URLs
Alternatively, you could also just run a verification build with specific selectors (e.g. the environment you want to check against) - it will pull down any pacts you need to verify, and then you can re-run
can-i-deploy
j
So if I choose option one (getting the json from can-i-deploy), the url I'm looking to build looks like this
<base_url>/pacts/provider/<provider_name>/consumer/<consumer_name>/pact-version/<pact_version>/metadata/<metadata_encoded>
Assuming I can get the pact version from the can-i-deploy output How do I get the metadata encoded part?