Issues

Unable to decline a pull request I made from a deleted fork (BB-15376)

I should be able to decline a pull request that I made. We don't seem to be able to do this. I ran into the same odd thing when I first started working with pull requests. A tutorial user brought it up again just recently.

I echo what Jacek Pakulski has expressed; when working on repositories which use git flow this can be quite annoying! (Although, attempting to merge it using the Pull Request UI doesn't seem to do any harm as per se, it does (at the very least) force you to deviate from your usual workflow.)

I find this quite surprising considering the Git Flow integration provided by Atlassian's SourceTree application! (Which is a pretty good app.)

I also would like the ability to cancel a pull request. I created a pull request the other day but realized I had a bug in my code after creating the pull request, I had no way to cancel it while I worked on fixing the bug. My coworkers are complaining that the code wasn't ready to be pushed to production when I made the pull request.

Me too. I don't understand why this hasn't been resolved yet. I submitted a problem report but was told that it was by design:

We do not implement deleting pull requests. While we do not intend for the Pull Request to be
deletable as it is part of the permanent record of the repository, there exist work-arounds to
accomplish many of the same goals that deleting a Pull Request would accomplish.

I understand what they want to tell us with "it is part of the permanent record of the repository", and I agree on that. But this should only be the case for approved and merged or declined PRs. What if you accidentially created a PR set to the wrong destination? Or the improvement/fix you did on your branch has already been checked out into another branch and that other branch was merged before yours?

Likewise. I created a pull request for a change I thought I wanted to make in a third-party module, realised that there were other problems that made my pull request rather pointless (and had to not use that third-party module as a result, since fixing these problems was too time-consuming), and deleted the forked repo, only to find that I still have an outstanding pull request (with a deleted repo) against that third-party project. It would be nice to be able to tidy it up somehow…

I sense a reluctance from devs to create a useful feature. Functionality should match user experience. PRs should be allowed to be created, accepted, canceled, rejected, and put on hold. Not that none of these imply deleting the PR in the repo records.

Zachary Davis I'm a bit confused by your change of this to "Decline" versus "Delete". Others can weigh in, but I think what people want here is some way for the to remove a Pull Request from history permanently, as if it was never created (probably because they made a mistake in creating it, or decided it wasn't necessary). And besides you can already "Decline" a pull request whether or not you're the creator of said pull request. I still think this should be "Delete"...

If you want to add some limitations to when a PR can / cannot be deleted: ie: if comments were made, then you can't delete it, or perhaps some sort of delay delete, or require some project level "admin"/"owner" approval for completing a delete... then I think most would probably consider that acceptable. But the end result should be the complete elimination of the PR.

I changed the title in an attempt to avoid exactly this sort of confusion going forward. I was certainly confused at first.

As noted, another issue (#8089) is about deleting a pull request. This issue is, or at least was originally, about not being able to properly decline a pull request in some situations (namely when you're the author of the pull request from a fork that has been deleted). I suggest everyone who is interested in deleting a pull request watch issue #8089 instead of this one.