<#635 feat: add branch endpoint supporting GET and...
# pact-broker
g
#635 feat: add branch endpoint supporting GET and DELETE Pull request opened by bethesque 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. pact-foundation/pact_broker GitHub Actions: bundle-audit GitHub Actions: pact-verify GitHub Actions: postgres (9.6) GitHub Actions: postgres (14) GitHub Actions: postgres (15) GitHub Actions: sqlite (3.2) GitHub Actions: sqlite (2.7) GitHub Actions: mysql GitHub Actions: rubocop ✅ 10 other checks have passed 10/19 successful checks