feat: add branch endpoint supporting GET and DELETE #635
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.
Adds a branch resource
/pacticipants/{pacticipant}/branches/{branch}
that supports GET and DELETE.Branches and versions exist independently of each other, and deleting one does not cause the other to be deleted. The branch_version resource is the association of a branch with a version (branches and versions have a many to many relationship via branch_versions).
Deleting a branch_version resource does not delete the version, but just removes the version from the branch.
Deleting a pacticipant version deletes all the associated branch_versions, but does not cause any branches to be deleted.
To be consistent with existing behaviour, a DELETE to the branch resource should delete the branch, and all the associated branch versions, but leave the pacticipant versions.
This is not very useful though. The main usecase for deleting a branch is to do a clean up after a merge, and remove all the associated pacticipant versions and their pacts/verifications. Perhaps we could support a query parameter or header that indicated whether or not to do delete all the versions or not.
Perhaps I'm thinking too fine grained, and there should be a post merge callback endpoint that does multiple things.
Would love some thoughts on this.