Now that tags are being deprecated, what’s the bes...
# pact-broker
b
Now that tags are being deprecated, what’s the best way to handle pr merge pipeline can-i-deploy checks? Previously it made sense to can-i-deploy -to=master, but master isn’t an environment? Would adding a can-i-deploy method to pact-broker to deploy to a branch make sense? Should we continue using tags for that use case?
m
can-i-deploy --to-environment <environment>
is the replacement
b
So would you recommend creating an environment to represent the main branch?
Even though it’s not deployed yet?
m
no, branches are meant to represent work in progress / feature work
you deploy to an environment
But there is an option to check if you’re compatible with a branch:
Copy code
[--branch=BRANCH]                    # The branch of the version for which you want to check the verification results
so that might be useful for merge checks, where the
--to-environment
for deploy checks
b
👍
Awesome
👍 1
Looks like that branch parameter specifies the source consumer branch rather than the target consumer/provider branches?
m
right, sorry my wording above might have been confusing
What are you trying to compare it to? I guess what you’re probably looking for is the equivalent of
can-i-merge --branch feat/xyz --with main
of the target provider. This does of course assume the providers all use the same branch name.
Usually, it’s the
environment
that matters here. i.e. once something has been merged it would be deployed to e.g.
staging
, so that would be the target
b
Yeah, that’s correct. We don’t have automatic deployment from master branches to our dev environments.
I suppose the assumption of all providers using the same branch name could be circumvented by allowing it to check the mainBranch of providers
👍 2
m
might be a good feature request (pact.canny.io)
b
b
@Ben Pilgrim I know exactly what you are asking for and the underlying code supports it, but it's not currently exposed. It will be straightforward to add.
I'd been considering this yesterday actually because of the work on the new can-I-deploy page we're working on.
🎉 1
👍 1
b
@Beth (pactflow.io/Pact Broker/pact-ruby) Any chance of cutting a release now that this is merged?
b
yes, but the client isn't udpated yet
you'd need to call the api directly
b
👍
We were planning to use the API directly for this anyway, so that’s fine
b
@Ben Pilgrim are you on the oss broker or pactflow?
b
OSS
b
ok. I'll start the rube goldberg release machine
👍 1
😆 1
b
Where do I have to drop a marble? 😅
b
you post it to github and a little person puts it in a machine for you ✉️
ok, the docker image is out
👀 1
b
Deployed to our test environment and it seems to be working! Thanks @Beth (pactflow.io/Pact Broker/pact-ruby)
🙌 1
b
Great! Love me some quick feedback.