Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to verify only the first tag in list #946

Open
PLT875 opened this issue Oct 1, 2019 · 7 comments
Open

Option to verify only the first tag in list #946

PLT875 opened this issue Oct 1, 2019 · 7 comments

Comments

@PLT875
Copy link

PLT875 commented Oct 1, 2019

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?

@PLT875 PLT875 changed the title Option to verify first tag in list Option to verify only first tag in list Oct 1, 2019
@PLT875 PLT875 changed the title Option to verify only first tag in list Option to verify only the first tag in list Oct 1, 2019
@uglyog
Copy link
Member

uglyog commented Oct 12, 2019

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 pact-foundation/pact_broker#307

@PLT875
Copy link
Author

PLT875 commented Oct 16, 2019

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

@bethesque
Copy link
Member

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?

@PLT875
Copy link
Author

PLT875 commented Dec 27, 2019

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

@bethesque
Copy link
Member

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!)

@tinexw
Copy link
Contributor

tinexw commented Oct 18, 2020

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.

@uglyog
Copy link
Member

uglyog commented Nov 6, 2020

@tinexw version 4.1.10 has the fallback tag implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants