Hi folks! Is there any way to get a version of the...
# pact-broker
а
Hi folks! Is there any way to get a version of the provider that deployed in different environments? I'm trying to get rid of tags. And previously I used 'describe the version' to do this. But I don't see any option for 'environments'. Or is there any other way to verify the new pact with different versions of provider?
m
May I ask why you need the info? I think it’s doable via APIs, but just wondering why you want to get the provider version from the environment?
а
We have different version deployed. And when new pact uploaded -> webhook triggered -> getting deployed versions -> checkout to these versions -> do verification to satisfy can-i-deploy
m
This is awesome, well done!
(or rather - “good answer” 😆 )
usually, this would map to a branch (e.g.
main
) but I’m guessing you can’t always be sure so it’s a fair point
A feature request at https://pact.canny.io/ would be great (if it’s not already there)
In the meantime, hit the
/
path of the API and then follow the environments resource. I believe you can get to the deployed resource via those relations
t
I thought the matrix had this info?
I'm sure I've used it to determine this before
At least, I keep telling people that one of the nice side benefits of Pact is now you know what is deployed everywhere. Have I been lying to them?
m
Yes the matrix definitely does, but that’s not super helpful for automation. You could obviously call the API but I think alexsandr is wanting a CLI command to get it (which I think is reasonable)
💯 1
b
There is an endpoint that can be used until we add it to the cli.
m
Thanks, I thought it might have been
b
the endpoints are
/environments/:environment_uuid/deployed-versions/currently-deployed
and
/environments/:environment_uuid/released-versions/currently-supported
thankyou 2
а
How can I contribute to pactfoundation/pact-cli? Is there only pact_broker-client to add new features?
thankyou 1
b
if everything you need is in the endpoints i’ve listed, it’s just a matter of adding the CLI commands to call them
if you’d like to raise an issue in that repo, we can discuss how it could be implemented there.
t
🌮 for @Александр Аврамчик for "so we don't have this, let me contribute it" 🙌 Very much appreciated!
а
m
🎉