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

Ability to remove branch after PR merged #98

Closed
ViachaslauKabak opened this issue May 4, 2018 · 2 comments
Closed

Ability to remove branch after PR merged #98

ViachaslauKabak opened this issue May 4, 2018 · 2 comments

Comments

@ViachaslauKabak
Copy link

I cannot find an option to remove branch for merge() procedure
please add it

@dchevell
Copy link

dchevell commented Jul 9, 2018

Bitbucket Server doesn't provide an option for this in its merge endpoint:

/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge

If you look at Bitbucket Server's own access logs to see what rest endpoints are called internally when you merge a PR with "Delete source branch after merging" ticked, you'll see that a second endpoint receives a POST:

rest/pull-request-cleanup/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
JSON payload:

{deleteSourceRef: true, retargetDependents: true}

This pull-request-cleanup resource is undocumented and is therefore considered an internal implementation detail. In other words, it can't be relied upon to be supported in future and may be subject to undocumented changes at any time. That being the case it seems unwise for this library to provide support for an undocumented, internal API.

As it happens I work for Atlassian support, and this seems like a reasonable request so I've raised BSERV-10976 to request adding a supported way to do this via the API. If that gets implemented then the equivalent option can be added to this library.

Until then, I'd suggest marking this one as Blocked (or Closed) until the above issue gets some movement.

@cosmin
Copy link
Owner

cosmin commented Jul 9, 2018

Closing until BitBucket Server adds a way to do this

@cosmin cosmin closed this as completed Jul 9, 2018
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

No branches or pull requests

3 participants