Treat Contracts as Pending, as Long as They Haven’t Been Verified in Default Branch #900
timvahlbrock
started this conversation in
Ideas
Replies: 1 comment
|
See https://www.linen.dev/s/pact-foundation/t/32725393/hey-there-everyone-i-have-a-question-on-the-flow-of-working-#44c39a32-166a-4984-9a27-f232ebc1e448 for previous discussion on slack. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Background
The purpose of pending pacts is to prevent newly contracts newly added by the consumer from breaking provider pipelines. However, with the current implementation the provider can break it's own pipelines, ones the contract has been verified on any branch. Currently the pact broker treats all contracts as pending, that have not yet been verified on a branch before the first contract publication on the current branch. This can lead to problems if the contracts have been verified on a feature branch, but not yet been merged. Example flow where this occurs:
Disabling verification publication on feature branches doesn't help, as that breaks can-i-merge.
Proposed Change
This behavior would ensure, that the implementation for a new contract is available on the default branch before it is released from it's pending state. It would still allow branches from breaking pending contracts by branching off before successful verification and breaking the implementation afterwards (as was possible before), but this is caught by running contract tests on the default branch, which is required anyway. In many cases, this branch would ease the branching flow, as branches don't have to verify contracts for which they don't have access to the implementation to yet. The new implementation matches the behavior of 'can-i-merge' and therefore probably what users would expect.
Required work
All reactions