-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deleting a branch breaks all PRs with this branch as target #19190
Comments
This is an enhancement rather than a bug imo. |
I'd absolutely say that this is a bug since no one expects that it will be forever impossible to reopen a PR. |
What's the behaviors of Github or GitLab? |
I just have tested. Github also will not support change a closed PR's target branch. So I think this should not be a bug but a proposal. |
Another solution is to not allow merging a PR for a branch which is the target branch for other PRs. For me that would be the most correct and explicit option since it seems weird that you can merge PR that others depend on. If it would work like this then people would first need to change the target branch for other PRs before they can merge the PR which was the target for them. That way PRs aren't closed automatically anymore, and it's clear what is happening for everyone. |
Gitlab preserves PRs if the original branch (to which we are targeting this PR) is merged. You have an option to retarget dependent branch into develop. When you work within big team with multiple branches started from unmerged one and targeted to this one, You will got into the situation when all dependent PRs are closed, review comments are in the closed PRs. It's just a good reason to switch to gitlab. |
Gitea is autoclosing PRs if target branch is deleted (original PR is merged). This auto operation has to be avoided. |
Yes, maybe we need a confirmation dialogue and list all pull requests which target branch is it. |
To allow stacked PRs, if the target branch A is deleted due to being merged into another branch B, then the stacked PR should get automatically retargeted to B. GitHub has been doing this since 2020. Stacking PRs is a pretty common use case, and it would resolve many instances of running into this problem. I'm guessing the vast majority of cases. |
Is this resolved by #28686? |
We close issues that need feedback from the author if there were no new comments for a month. 🍵 |
Description
Currently, when you delete a branch, all PRs still targeting this branch will be closed forever, breaking them completely if you intend to merge them into another branch, i.e. the target branch of a PR that deleted the branch.
The result of this bug is that even if you attempt to reopen such a PR, you simply won't be able to:
The PR cannot be reopened because the branch does not exist, and the branch can't be changed because the PR is closed.
Reproduction Steps
Reproduction PR: https://try.gitea.io/delvh/kanban-test/pulls/23
Possible Solutions
Gitea Version
1.16.4 to 1.17.0+dev-327-gf7883a6ae
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
(The red box in this case comes from trying to edit the target branch to reopen the PR)
Git Version
No response
Operating System
No response
How are you running Gitea?
try.gitea.io
Database
No response
The text was updated successfully, but these errors were encountered: