Ability to tell the broker whether a missing consumer or missing provider is safe for a particular contract
Tim Jones
At the moment, can-i-deploy returns false if you're trying to deploy a consumer without a provider, but true if you're trying to deploy a provider without a consumer.
This is appropriate behaviour if the consumer is an HTTP client, and the provider is an HTTP server.
In some contract types (eg SQS messages), both sides can safely deploy without the other one there.
With websockets, an HTTP client might be the producer.
A common scenario for websockets is two contracts - one between the client(consumer) and the servir (producer), and the other between the server (consumer) and the client(producer). The current behaviour of the broker will make it impossible to deploy a websocket server without a client, and impossible to deploy the client without the server.
All these problems could be fixed if it was possible to specify at a contract level which of the consumer / provider need to be present (or not) in order to deploy.
Yousaf Nabi
>pact-broker can-i-deploy --pacticipant provider-foo --version foo
Pacticipant provider-foo not found
How does your Pact Broker know about the provider at the point of calling can-i-deploy?
Tim Jones
Yousaf Nabi: You have to tell it beforehand. This is about deploying into an environment that does not yet contain a consumer / provider (etc), but when you still have published contracts.
Yousaf Nabi
>but true if you're trying to deploy a provider without a consumer.
Is this the case? I thought that can-i-deploy would fail with no consumer, as there are no verifications published for the provider version
Ran Abitbul
Yousaf Nabi: True, it fails for a provider with no consumers
Matt Fellows
Ran Abitbul: Not true, only if the version doesn't exist in the broker. See https://docs.pact.io/pact_nirvana/notes_1
Matt Fellows
Yep, it's worth us looking further into this scenario. I'm surprised this hasn't been requested officially before.