Hey there. I have a general question regarding bra...
# general
t
Hey there. I have a general question regarding branching and CI/CD with Pact. The pact nirvana gold diagram describes that the consumer will publish its contract on main. But this would mean that the main branch contains a state that is not deployable, because no provider implementation has existed yet? Consequently I wouldn't be able to deploy as well. Additionally, this newly added contract would be included in the providers verification job which would fail, because no implementation has yet been performed, eventhough nothing is wrong with the provider build. Up to like half an hour I thought that the consumer branch is supposed to be merged AFTER the provider has verified on main (somewhat like in the attached image) and thought that I read this somewhere in the documentation.
Also this means that at some point, the consumer will need to stop merging new contracts into main and hope the provider will implement the pacts before the next time it wants to release.
Edit: provider build breaking seems to be avoidable by using pending pacts
1
I mean, the problems mentioned above similarly exist for projects without contract testing, but for whatever reason I thought that the branching shown above was used and therefore made the main branches always somewhat mergabel.
Oh man. I think I got a little confused. Needing to verify the consumer before merging is level platinum of pact nirvana, right?
m
yes!
In the gold step it states: > However, it does not prevent you from merging or deploying a change incompatible with the consumers or providers in a particular environment. That comes at the next level, when you add can-i-deploy support. > One of the complications introduced by the “consumer driven” nature of the workflow is that new interactions are usually added to the contract before the functionality has been implemented in the provider.
It still shows that you should publish your branch name for branches, but once the code is in mainline you need to set the branch correctly to (so the system knows the current state). Later on, with webhooks and the other bits, most times you have merged into mainline it should be deployable
t
What confuses me a little is that the platinum diagram runs can-i-deploy for an environment. Shouldn't this be against main/latest?