pact-jvm
pact-jvm copied to clipboard
Option to verify only the first tag in list
Have a process of verifying tags in PR before merge to master branch
Say we provide a list of tags for contracts we need to verify e.g. [feature, master]
Say if feature tag is a new contract, then we would want to skip master (as it would fail)
Is there option to check first tag in list only?
How would you know when to only verify the first tag, and when to verify all of them? Maybe a better option is to only pass the tags you want to verify from the command line?
There is a current feature being implemented to support feature branches in the pact broker. See https://github.com/pact-foundation/pact_broker/issues/307
So if contract found for first tag then stop there.
Have a process where contracts should be verified as part of PRs.
So if a feature branch has a new contract (will publish and tag as the feature branch name)
Our CI will then trigger the provider tests - by checking out the corresponding branch of the provider repo (then run verification tests) - if not found fall back to master branch.
In first instance if feature tag not found its an indication of no contract changes. However if feature branch found then we do not wish to verify the master tag in list
This is semi supported in the Ruby impl. We have a concept of a "fallback" tag, for doing a "pact feature branch workflow".
See https://dius.com.au/2018/05/04/pact-testing-git-workflow-and-continuous-integration/
I'm thinking of adding this into the new API. As I understand it, you want to say "if a pact with X tag exists, verify that, otherwise, fall back to the master pact". The "feat-x" tag name would be dynamically determined based on the provider's current branch. Yes?
This is semi supported in the Ruby impl. We have a concept of a "fallback" tag, for doing a "pact feature branch workflow".
See https://dius.com.au/2018/05/04/pact-testing-git-workflow-and-continuous-integration/
I'm thinking of adding this into the new API. As I understand it, you want to say "if a pact with X tag exists, verify that, otherwise, fall back to the master pact". The "feat-x" tag name would be dynamically determined based on the provider's current branch. Yes?
Yes thats right
You can vote for this feature here: https://pact.canny.io/feature-requests/p/support-a-fallback-tag-for-coordinated-branch-based-development (just started using this fancy new feature prioritisation tool!)
The "fallback" tag feature was implemented in the broker now. We can implement support for it in pact-jvm now. Please also update the Consumer Version Selectors docs.
@tinexw version 4.1.10 has the fallback tag implemented