Move "pacts for verification" configuration into the Pact Broker #479
Replies: 4 comments 4 replies
-
What will the default value of |
Beta Was this translation helpful? Give feedback.
-
Love it. Moving the intricacies takes this burden off the provider teams. When the provider specifies selectors, it would almost always lead into questions about what they were doing and why, which would lead into nitty gritty details of how pact was working behind the scenes. Good stuff to understand, but it's overwhelming for new adopters/teams just dipping their toes in.
I might have missed it, but how will this be addressed with the proposal. |
Beta Was this translation helpful? Give feedback.
-
Updated thoughts on this configuration. When doing the configuration in the client, different configurations can be set dynamically based on the information that the client has (eg. branch). The serverside configuration would need to be able to support this also. Proposing a set of "rules" rather than a single configuration. Same configuration for every branch. Can be configured via command line.
Different configuration for feature branches - allow a provider version matcher to be specified that Rules checked in order of declaration until a matching one is found.
pact-broker configure-verification --pacticipant my-provider --file "myconfig.json" |
Beta Was this translation helpful? Give feedback.
-
love this feature! |
Beta Was this translation helpful? Give feedback.
-
Background
Currently, the configuration for which pacts to verify lives in the provider test code. eg.
When branches and environments/deployments/releases support is out, the need for each provider project to be individually configured will mostly go away. The pacts that should be verified will be
{ mainBranch: true }, { deployedOrReleased: true }
. If no pacts are specified in the consumer version selectors, these will now the the pacts returned, meaning that users do not need to understand selectors to get started with Pact.The only thing that is likely to change between companies is how teams coordinate the development of features between the consumer and provider. Some teams use matching branch names so that the
feat/x
pact gets implemented on thefeat/x
branch. Other teams have branch names specified for them via a development process (eg. feat/jira-1234), and so need to use another method of selecting the relevant pact(s) for a provider feature branch. This can result in the consumer version selectors being modified and committed on a feature branch, and then reset back to base after being merged.Proposal
Move the 'pacts for verification' configuration into the Broker and out of the provider code.
Why?
contract_requiring_verification
webhook to target the correct feature branch when the pact content changes on a consumer feature branch (currently it can only target the main branch and the deployed/released versions).Cons
Considerations
Proposed design
{ mainBranch: true }, { deployedOrReleased: true }, { matchingBranch: true }, { matchingTag: true }
will be used.Configuration endpoint
Configuration CLI
Beta Was this translation helpful? Give feedback.
All reactions