Ability to ensure compatibility with multiple versions of a consumer in production at the same time.
complete
Beth
complete
Beth
Moving this to complete as it will sit here forever waiting for all the client libraries to implement the feature.
Matt Fellows
What is currently outstanding on this feature to mark it as closed? The verification support by all languages?
Beth
Matt Fellows: support for the "all pacts for given tag" selectors in each language. Though, if we wait for every language, we may never end up marking any feature as finished!
Matt Fellows
Beth: Cool thanks, yes I suspected so. It would be nice if there was a way to track this per project - perhaps the tags? We could remove the tag each time a project supported it? (or vice versa)
Beth
Matt Fellows: that's a good idea, let's try it.
s
sabil
Beth: how can I follow this tag for my very case? https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-provider-junit
thanks for keeping me posted!
edit:
subscribed to https://github.com/DiUS/pact-jvm/issues/942 so as to be updated on progress here
Beth
sabil: This has been released in pact-jvm now.
s
sabil
Beth: thanks for keeping me posted on that one & kudos to the entire team for working so hard on improving everything.
I hope we can tryout and adopt that brand new 'ConsumerVersionSelector' pretty soon.
Beth
This is supported in the 'pacts for verification' API in the Pact Broker. It's now up to each client library to make use of the new API.
Beth
The can-i-deploy part of this is done. The verification part will be finished when we release the new 'pacts for verification' API changes.
Beth
in progress
Beth
I have a theory that it might work if you make sure you are compatible with both the first and latest prod version (rather than checking all prod pacts every time), if you have used pact for every release of both.
Antonello Caboni
Beth: I know you that this feature request is specifically for the broker, but in order to make sure that the provider remains compatible with a range of consumer versions, wouldn’t you also need to make it possible to run provider verification for multiple prod versions of the consumer? Something that is not possible, AFAIK, with the jvm implementation for example.
Beth
Antonello Caboni: It will be when this is implemented: https://github.com/DiUS/pact-jvm/issues/942 (follow it through to the master issue). Someone has volunteered to do this work, so hopefully it will be available soon.
Balys V
Beth:
I don't believe the theory holds in all cases. A problematic one is when you are phasing in and out a property in the consumer:
Consumer DTO fields by released version:
v1:
Int a;
v2 (property
b
optional):Int a; Optional<Int> b
v3 (property
b
mandatory):Int a; Int b;
v4 (property
b
optional again):Int a; Optional<Int> b;
v5 (property
b
removed):Int a;
Provider DTO fields by version (released just before the corresponding consumer version):
v1-v4:
Int a; Int b;
v5 (remove property
b
):Int a;
When we release provider
v5
, we are compatible with consumer v1
and v5
but break consumer v3
. Hope this is clear enough to illustrate my point.
Beth
Balys V: Thank you for thinking that through! We'll stick with the "all" then.
s
sabil
Beth & Ronald Holshausen:
I'm a bit confused here: is the feature described here available as support for 'pending pacts' is already released? I understand they're different and I'm wondering how a JVM provider can ensure compatibility for a tag 'production' with multiple versions published.
It would be great if you can let me know if we already can do that and if so, how.
Thanks a million!
Beth
So, you can already tag as many versions as you like with the same tag, but what I think you mean is the ability to retrieve all pacts for a given tag during verification, and check if all tags are compatible with a provider when using can-i-deploy. Is that correct?
Tim Jones
Beth: Yes, that would work. I probably specified the problem poorly - I'd like to be able to easily tell can-i-deploy that multiple versions of a pacticipant are in "production".
One way that could work is having the ability to retrieve all versions tagged prod, along with the ability to remove tags from obsolete versions - which is what I meant above (yes, you are correct).
However, there are probably other ways to achieve the feature of "ability to easily run can-i-deploy (or run pact-verify) when multiple versions of the same pacticipant are in prod"
(which is probably what I should have called this card)
Beth
For future reference, can-i-deploy >= 1.23 supports
--all TAG
in the version selectors.