Ran Abitbul
06/12/2023, 11:14 AMcan-i-deploy for a provider, who has no consumers and therefore no verifications were made yet?
I receive the No pacts or verifications have been published for service-A error.
If there are no instances of service-A in the pact-matrix, shouldn't it be as if it is safe to deploy?
Important to point out that the verification tests do pass, as there is no pacts to verify.
Thanks :)Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Ran Abitbul
06/12/2023, 12:09 PMRan Abitbul
06/12/2023, 12:14 PMie, it doesn't make sense to call can-i-deploy for a provider who has not verified any contracts
As a platform engineer, it makes perfect sense 🙂
I would like to provide my company's developers the best UX possible, a part of that is providing a whole solution out of the box.
If there are no instances of a service in the Pact Matrix, I would expect the can-i-deploy call to succeed, sense there is nothing blocking me from recording a new deployment (no contract has been broken).
Instead of having it succeed in such case as stated above, I would have to ask them to do a manual record-deployment for each new service, and for a company that is transitioning from a monolith to microservices - this will occur many times.Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
--pass-if-no-consumers flag or something similar work on a can-i-deploy rather than it being a default behaviour.
The premise being that can-i-deploy offers guarantees about the compat of an application prior to deployment. As the Pact framework does nothing, in Consumer driven contract testing (with zero consumers), we have zero guarantee or basis to tell you your application is safe to deploy.
At least that is my take on the current behaviour.Yousaf Nabi (pactflow.io)
Ran Abitbul
06/12/2023, 1:14 PM--pass-if-no-consumers would absolutely work.
I get what you are saying, but if you look at it from an infrastructural point of view, meaning the platform is my product and the developers are my clients - I need to provide a fluent way for their CI to pass for each service, regardless of their rule (provider/consumer).
Every new provider needs to perform a record-deployment for the first time, that does not mean that the provider does not have any consumers. It only means that it does not have a deployed version in which the consumers could push that pacts and verify against.
The notion that a provider must have consumers that have already published pacts is a bit problematic..
I guess I would have to call list-pacticipants and check whether the service is listed or not. In case it is not I would need to use the can-i-deploy dry-runMatt (pactflow.io / pact-js / pact-go)
So I believe Ran has added that Matt, which is why the provider exists but doesn’t return a valid can-i-deploy as there are no verifications associated with itIt should work without that. You need to both create the application and create an application version