Hello, I used the pact-broker cli `delete-branch` ...
# pact-broker
d
Hello, I used the pact-broker cli
delete-branch
as documented in https://docs.pact.io/blog/2024/02/21/deleting-branches-automatically. It did delete the branches, but it does not delete the published verifications. My matrix is still full with all verifications; just the branch names do not appear. Is this normal? If it i, what is the rational? Is there a way to delete the verifications as well?
I have already checked the documentation about deleting resources: https://docs.pact.io/pact_broker/administration/deleting_resources. The routes:
/pacts/provider/{provider}/consumer/{consumer}/branch/{branch}
do not exist.
I have also found out that the CLI help notes:
Copy code
Deletes a pacticipant branch. Does not delete the versions or pacts/verifications associated with the branch, but does make the pacts inaccessible for verification via consumer versions selectors or WIP pacts.
So, I guess this is the "expected" behavior. Still, what do we do with all these pacts and verifications in the matrix from branches that do not exist any more?
m
Yes, this is “expected” but probably not expected by the end users. There is this endpoint which I noticed has a bug the other day, I believe this is intended to delete the associated resources: https://github.com/pact-foundation/pact_broker/issues/628 We’ll be adding it to our backlog for review.
May I ask, what’s the actual problem that you’re seeing with the additional pacts/verifications hanging around - is it just making it harder to see what’s happening in the UI? By deleting the branch resources, it actually improves the performance of other queries, but the associated versions are still around. What I think most people want, is to delete the branch, and also any associated versions that are not associated with other branches etc. Also, if an associated version was deployed, we’d need to think about that - what would be the right thing to do?
d
Apart from the UI clutter I don't see any other problem with having the pacts/verifications hanging around. I was curious if there is any "use case" for their existence?
👍 1
Concerning the released pacts, I would guess that these are usually merged into main/master, but there might be other use cases as well.
👍 1
m
Yep. I'd like to address the issue, I'll report back on the above linked issue as we work through it