Zhaopeng XUAN
06/13/2023, 8:39 AMTimothy Jones
06/13/2023, 8:47 AMTimothy Jones
06/13/2023, 8:47 AMTimothy Jones
06/13/2023, 8:47 AMTimothy Jones
06/13/2023, 8:48 AMTimothy Jones
06/13/2023, 8:49 AMTimothy Jones
06/13/2023, 8:50 AMTimothy Jones
06/13/2023, 8:50 AMTimothy Jones
06/13/2023, 8:50 AMTimothy Jones
06/13/2023, 8:51 AMZhaopeng XUAN
06/13/2023, 8:51 AMTimothy Jones
06/13/2023, 8:51 AMTimothy Jones
06/13/2023, 8:52 AMTimothy Jones
06/13/2023, 8:53 AMZhaopeng XUAN
06/13/2023, 8:53 AMZhaopeng XUAN
06/13/2023, 8:54 AMZhaopeng XUAN
06/13/2023, 8:54 AMTimothy Jones
06/13/2023, 8:54 AMwe maybe have API-First driven approach,This is very common. I also think it’s an industry wide anti-pattern (for the same reason - do you have a shop where the shopkeeper decides what the customers want? No, it would be better to ask the customers first, then buy those things)
Timothy Jones
06/13/2023, 8:55 AMmanage the schema creation, and build up the “contract”I wouldn’t call this a contract, at least from the perspective of contract testing
Timothy Jones
06/13/2023, 8:55 AMTimothy Jones
06/13/2023, 8:56 AMTimothy Jones
06/13/2023, 8:56 AMTimothy Jones
06/13/2023, 8:56 AMTimothy Jones
06/13/2023, 8:57 AMZhaopeng XUAN
06/13/2023, 8:59 AMI realise most teams wouldn’t want to do that)That's correct, in a big scale projects, the challenge is not technical, but the communication between consumers and providers. In terms of
ContractCase
, will it support Provider-driven contract test? if yes, may I ask what's the difference between Schema validation(imagine we ensure all API changes detect break schema changes) and ContractCase
Timothy Jones
06/13/2023, 9:02 AMTimothy Jones
06/13/2023, 9:02 AMTimothy Jones
06/13/2023, 9:02 AM(imagine we ensure all API changes detect break schema changes)I am imagining this and wondering how you do it
Timothy Jones
06/13/2023, 9:03 AMTimothy Jones
06/13/2023, 9:04 AMTimothy Jones
06/13/2023, 9:04 AMTimothy Jones
06/13/2023, 9:05 AMTimothy Jones
06/13/2023, 9:06 AMTimothy Jones
06/13/2023, 9:06 AMZhaopeng XUAN
06/13/2023, 9:08 AMForwards and backwards compatibility is not enforced: While forwards and backwards compatibility is a promise of Protobuf, actually maintaining backwards-compatible Protobuf APIs isn't widely practiced, and is hard to enforce.
Timothy Jones
06/13/2023, 9:12 AMmessage UserTypeResponse {
string userType = 1;
}
If a provider is updated to emit "User"
, "Admin"
and "Moderator"
, but the consumer expects "User"
and "Admin"
that is a breaking communication change, but not a breaking protobuf change. Any automated tooling aimed at detecting breaking changes in protobuf will not see thisTimothy Jones
06/13/2023, 9:12 AMuser
moderator
and admin
Timothy Jones
06/13/2023, 9:14 AMZhaopeng XUAN
06/13/2023, 9:19 AMuser
, admin
, but not moderator
, in this case, we maybe just miss a unit test/integration test to cover else
status to check if there is a unknown type.
but however if producer decided only to emit admin
and moderator
, but remove user
, schema validation is passed, and it won't impact the consumer's functionality, but maybe a feature is gone completely.
in this case, more or less, Contract test seems is protecting the "data" between the consumer and producer.Timothy Jones
06/13/2023, 9:20 AMTimothy Jones
06/13/2023, 9:21 AMTimothy Jones
06/13/2023, 9:21 AMTimothy Jones
06/13/2023, 9:22 AMschema validation is passed, and it won’t impact the consumer’s functionality, but maybe a feature is gone completely.You can’t tell whether it will or won’t impact the consumer’s functionality from the schema alone
Timothy Jones
06/13/2023, 9:22 AMTimothy Jones
06/13/2023, 9:22 AMZhaopeng XUAN
06/13/2023, 9:28 AMMatt (pactflow.io / pact-js / pact-go)
Boris
06/13/2023, 11:32 AMTimothy Jones
06/13/2023, 11:58 AMMatt (pactflow.io / pact-js / pact-go)