For HTTP consumers with no (deployed) providers, c...
# pact-broker
t
For HTTP consumers with no (deployed) providers, can-i-deploy returns no For HTTP providers with no (deployed) consumers, can-i-deploy would return yes (I believe) With message consumer / providers with no deployed counterpart, can-i-deploy could return yes for either - does it? And a followup question - if I had a consumer that could deploy without its provider, could I model that with the pact broker? What about a provider that cannot deploy without its consumer?
One scenario here is server-driven HTTP contracts - in Pact, consumer is kind of a synonym for client. But, generally, it might not be - for example, a consumer of http requests
b
@Timothy Jones yes, I’ve wondered about that too. The PB does not treat async any different from HTTP. But nobody has jumped up and down about it, so I’ve never done any work on the logic.
t
I have a challenge that might be worth some discussion - in Case (the name for the alternative contract suite that I’ve been working on), everything is “consumer driven”, but not in the same way as Pact - You might consume an HTTP response. Or, you might consume an HTTP request.
This is a departure from the way that pact does it, where “consumer” is kind of a synonym for client, and “provider” -> server. With this slight change to the model, you’re defining (and testing) what you consume, and describing what you expect to provide: HTTP client-defined test: • I will provide this request • I can consume this response HTTP server test:: • I can consume this request • I will provide this response SQS message receiver test • I provide a poll to get a message • I can consume this message SQS message sender test • I provide this message • I consume nothing (or, I consume a “sent successfully” SQS API response- but this wouldn’t be in the client)
I think it’s best-practice to do client-driven tests, but with this model you can trivially do server-driven tests
I’d like for it to play nicely (and natively) with the Pact broker. What I was planning to do was say that the system that wrote the contract is the “consumer” and the system that reads/verifies the contract is the “provider”. But, if I do that, I’m concerned I’ll run up against this deployment-zero problem, where the “provider” can always deploy without the consumer - but that might be a broken state.
Even if I hadn’t changed the definition of consumer/provider (slightly), I think this problem still exists - as above, it exists with messages (where a consumer will be blocked when it shouldn’t be), and I think it will also exist with gRPC (depending on the types of gRPC supported)
Is it worth raising a feature request for this? During contract definition, you would always know if either end could deploy without the other - so it could be recorded in the contract. But this wouldn’t work for providers that have never run verification (because they don’t have any contracts yet)