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

feat: support creating version with branch #371

Merged
merged 30 commits into from
Feb 3, 2021

Conversation

bethesque
Copy link
Member

Adds a branch property to the version resource. This is the first step towards providing first class "branch" and "deployment environments" as a more understandable alternative to "tags".

Next step is to support the branch property for both consumer and provider in the "pacts for verification" API.

@bethesque bethesque requested review from mefellows and uglyog January 18, 2021 05:03
@bethesque
Copy link
Member Author

Don't try and read this all - this PR contains a massive clean up of the terrible code that used to be there for the "pacts for verification" finding. It also splits out some massive files that Code Climate was rightly complaining about.

The things worth knowing:

  • There's now an endpoint to create a version with a branch and a build URL
     PUT http://broker/pacticipants/Bar/versions/1e70030c6579915e5ff56b107a0fd25cf5df7464
      {
        "branch": "main",
        "buildUrl": "http://ci.mydomain/my-job/1"
      }
    
  • Publishing pacts and verifications should now support a "branch" property, and the client libraries should all make the above call before creating the tags (I haven't made an "all in one" call for the version and the tags yet).
  • When calling the 'pacts for verification' API
    • the consumer version selectors now support branch and fallbackBranch
    • there is an extra providerVersionBranch property
    • If a provider version branch AND tags are specified, the branch is used in preference to the tags when calculating the "work in progress" pacts
    • If only provider version tags are specified, it works the way it currently does
    • When calculating which pacts are WIP, both the "latest for each tag" and "latest for branch" are considered.

@bethesque
Copy link
Member Author

bethesque commented Feb 2, 2021

Oh, there's also a pb:pacticipant-version relation in the index now which should be used:

  1. to detect whether or not the broker version supports creating a pacticipant version by PUT, and by extension, whether or not the branch property is supported
  2. to actually create the pacticipant version

@bethesque bethesque merged commit 5884a04 into master Feb 3, 2021
@bethesque bethesque deleted the feat/support-creating-version-with-branch branch February 3, 2021 21:27
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

Successfully merging this pull request may close these issues.

1 participant