-
-
Notifications
You must be signed in to change notification settings - Fork 178
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 multiple branches per version #495
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uglyog
approved these changes
Sep 6, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of changes. Must be good.
More changes must be more better right? (Not expecting anyone to care about the code, just getting you both across the features). |
mefellows
approved these changes
Sep 6, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tl;dr support an application version being associated with multiple branches.
This keeps track of the branch head versions, so we won't have same performance issues we do with "latest for tag" (though I'm going to use the same design to fix the performance issues with tags too at some stage).
Adding branch support to the Pact clients
@uglyog to associate a version with a branch, it's pretty much the same as tagging:
Like the tagging, the resource will auto create the pacticipant, branch and version if they don't exist. Also like the tagging, it should be called before the pact is published so that the right data is set up on the version when the webhook gets kicked off.
The all-in-one contract publishing endpoint is already set up to support the branch property, but if you'd rather just add to the mess that is the existing pact publishing code for now and do a separate call, the HAL relation to create the branch version is on the pacticipant resource at
pb:branch-version
or the index atpb:pacticipant-branch-version
. Please detect the presence of that relation to determine whether or not branches are supported and show an appropriate "not supported, please upgrade" message to the user. The Ruby client says "This version of the Pact Broker does not support version branches. Please update to version 2.58.0 or later." (I'm just guessing for now that will the the version it gets released in, it'll be near enough.)I haven't created the "all in one" verification publishing endpoint yet, so for now, you'll have to use the branch version endpoint to set the branch for provider versions anyway.