Automatically selecting pacts to verify when requesting pacts for verification #391
Replies: 4 comments 7 replies
-
Thinking about it more, I'm leaning towards the matching feature branch config being separate. I want the "autoSelect" feature to be what Pact beginners should just enable by default when they don't really understand what they're doing. The matching feature branch thing is a bit more of an advanced workflow, when everyone knows what they're doing. |
Beta Was this translation helpful? Give feedback.
-
I'm not quite sure what is the purpose of In our setup
We treat feature branches of consumers as WIP because otherwise the contracts verifications are missing in the broker if the provider is released. It happens because the contract content doesn't change and we don't trigger the verification job for a single contract. The only thing that changed is a production version of the provider. Keeping such contracts WIP is our way to keep
We are happy with the current workflow, so contract is pending for main branch of provider until it is verified on that main branch. |
Beta Was this translation helpful? Give feedback.
-
As an example of how this would change the configuration, this is the existing recommended configuration:
That would be replaced by:
(or whatever we decide to call the option). The rest of the current configuration would then go under an "advanced" section, for people who really knew what they were doing and wanted a customised selection of pacts. |
Beta Was this translation helpful? Give feedback.
-
This feature would work well for us. I also think it would be great for new users, as you said, to implement best practices currently there is quite a lot of cognitive overhead.
There is the potential benefit of getting faster feedback on WIP consumer changes to pacts when you enable WIP support for provider feature branches, however, in practice if you have WIP enabled on the provider feature branches along with pending pacts, it makes it difficult for the provider team to ensure they are implementing a new pact correctly (because even if they explicitly select the consumer pact tag they want to verify, it will be pending and so will not cause the build to fail if it fails -- we discovered this the hard way). It's also easy to just run the provider build against a development branch (e.g.
This would allow for the "matching consumer/provider tag" verification pattern. Because you have to opt-in to that, it seems fine to include. Previously I may have been opposed to this because of #432 -- but now that it is fixed, I don't see any problem with having this behavior enabled by default as teams can still use explicit configuration if they want to.
Intuitively, I would expect those pacts to not be pending (e.g. if consumer and provider both use Some other thoughts:
|
Beta Was this translation helpful? Give feedback.
-
AKA: Making consumer version selectors unnecessary
Proposal:
autoSelectPacts: true
)release
orhotfix
branches, would get pacts from the consumer'srelease
orhotfix
branches)Basically, implementing the "best practice" recommended configuration without having the provider team having to understand it in the detail they do today.
The
autoSelectPacts
feature will make the configuration of the consumer version selectors unnecessary for most providers, as this is the list of pacts that we currently recommend to be verified at the moment, abstracted via the "tags". If a user has non-standard requirements, they can fall back to the current approach of specifying the consumer versions explicitly. This should reduce the cognitive load in implementing Pact in a CI/CD pipeline.Thoughts welcome.
Beta Was this translation helpful? Give feedback.
All reactions