Prevent issues from being closed by merging linked PRs #17308
-
Manually copied over from https://github.community/t/feature-request-prevent-issues-from-being-closed-by-merging-linked-prs/3255 (where https://github.com/akshaymankar was the original requester).
|
Beta Was this translation helpful? Give feedback.
Replies: 64 comments 110 replies
-
Assuming an issue is automatically fixed because a single merged PR mentions it seems very naive - and indeed dangerous. Validation does not stop after merging. A simple workaround is to avoid the "magic words / syntax", for instance this should avoid the problem: cc: @defunkt (https://github.blog/2013-01-22-closing-issues-via-commit-messages/) Duplicates:
|
Beta Was this translation helpful? Give feedback.
-
I'd like to see 'disable auto-close' configurable for the repo and/or 'disable auto-close for different repos'. I encountered this issue because I'm working around a limitation in dependabot where dependabot only scans the default branch. I have a project where two branches are supported, but code has diverged. Eg, This all worked fine until today where I noticed that someone used Having more flexibility with dependabot (eg, allow selecting multiple branches, not just the default one) would address this for the above use case, but I'm mentioning it because it seems like cherrypicking and forks could be affected in the general case. |
Beta Was this translation helpful? Give feedback.
-
I would love to see this as well. I often use |
Beta Was this translation helpful? Give feedback.
-
This should be treated on high priority. It breaks lot of workflows and not using magic keywords prevents issue from showing up in tracker. One should be able to switch off auto closing of the issue. I guess every large organisation has a QA team that verifies the issue and then closes it (even after merging pull request, regression test has to be executed) |
Beta Was this translation helpful? Give feedback.
-
+1. Sometimes I will have a meta-ticket requiring changes in multiple repos and it is frustrating not being able to use the typical workflow of linking the pull requests to issues. I think that a good way to improve this behaviour would be to require all of the linked pull requests must be merged for the issue to be resolved. |
Beta Was this translation helpful? Give feedback.
-
I consider this to be a bug just as much as a feature request. On an issue page in the meta data section it says:
And in the pull request it says:
The operative word there is "may", which certainly does not mean it should automatically close it by default. |
Beta Was this translation helpful? Give feedback.
-
The model Github is perplexingly enforcing does not fit well with trunk based development. I hope they take another look and make it happen. |
Beta Was this translation helpful? Give feedback.
-
Having multiple PRs and closing one does not mean issue can be closed. |
Beta Was this translation helpful? Give feedback.
-
It would be very helpful for us as well. We have projects that span two or three repositories and often need to make changes to all of them in order to implement a feature. More granular control over the interaction between pull requests and issues would really help clean up the workflow and make sure things don't fall through the cracks |
Beta Was this translation helpful? Give feedback.
-
GitHub devs, if the magic word stuff etc, is too complex, maybe just a repository level setting "Disable auto-close issues" , which can be Then wherever the logic runs post merging a PR, just also have a boolean check for this repository property, surely it can't be too hard? |
Beta Was this translation helpful? Give feedback.
-
I'd like to see that option too Another option is don't automatically close the issue if the target branch is not |
Beta Was this translation helpful? Give feedback.
-
At this point, the workarounds are either to unlink the issues, merge the PR and link the issues again, or to re-open the issues after merging PR. The first one is preferred, as the second one may trigger some workflows. But the first one is not easy if the linking was done using commit messages unless you amend the messages and force-push the amends. It's easier if the linking was done via PR description or manual selection in the sidebar. |
Beta Was this translation helpful? Give feedback.
-
Yeah, the current functionality is tragic. We have to reopen every issue and move it back out of done in its related project after the pull request is merged. |
Beta Was this translation helpful? Give feedback.
-
I'm inclined to consider this a bug. I can't understand why allow linking multiple PRs to an issue if only one is needed to close it. Having the possibility to configure this behaviour at the repository level makes perfect sense to me. |
Beta Was this translation helpful? Give feedback.
-
Kind of related but I maintain a project that is a downstream fork of another one. I just realized that one of my issues was closed because the upstream fork commit used magic word to close an issue and unfortunately that number matched an unrelated open issue in my repo and closed it as well. This automatic non-configurable setting virtually makes a downstream fork's life difficult because now I'm paranoid how many times that has happened and whether I need to scrub the commit messages every time I merge form upstream. |
Beta Was this translation helpful? Give feedback.
-
I just got an issue auto-closed because I had this in my commit message:
facepalm |
Beta Was this translation helpful? Give feedback.
-
Yes, this is a stupid feature. Please fix / provide a way to disable it. |
Beta Was this translation helpful? Give feedback.
-
I noticed that Azure DevOps also closes issues(bug or stories) that are
linked to a PR and there is no way to disable it.
Just submitting a PR doesn't even mean the code has been deployed to
testing yet.
The behaviour needs to be configurable based on your workflow and
environment.
…On Thu, 6 Feb 2025 at 22:24, Francois G. ***@***.***> wrote:
Same, this is causing quite some friction for us.
—
Reply to this email directly, view it on GitHub
<#17308 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFBBWGDRQYKJW263GZRYST2ONA7XAVCNFSM5XBFTO6KU5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCMRQHAYDONRS>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
And with the sunset of |
Beta Was this translation helpful? Give feedback.
-
+1 Bump bump bump; this is causing so many problems for my team. |
Beta Was this translation helpful? Give feedback.
-
👋 Thank you for all your feedback on this thread! As we work towards a solution, I’d love your input on a few proposed options. Please react to this comment for the option(s) that resonate with you. Bonus points if you indicate in the comments why you selected the option. 🎉 Option 1: Repository-level SettingReact 🎉 to vote for this option. Add a setting in repository settings to control whether merged PRs automatically close linked issues. This would apply at the repo level, meaning either all merged linked PRs close issues in the repo, or none do. 🚀 Option 2: Issue-level Setting (Development sidebar)React 🚀 to vote for this option. Introduce a per-issue setting in the sidebar’s "Development" section, letting you decide whether merged PRs should close the issue. Either all merged linked PRs close the issue, or none do. 👀 Option 3: PR-level Setting (New Keyword)React 👀 to vote for this option. Currently, keywords like This option introduces a new keyword (e.g., Looking forward to hearing your thoughts, and thanks for weighing in! ✨ |
Beta Was this translation helpful? Give feedback.
-
I've voted Option 1: Repo-level Setting as I believe this is the minimum viable solution, and the other options don't fix the harm if option 1 isn't implemented. However, a combination of option 1 plus others could be the best overall. A faster implementation of #1 would be better than a year-long delay to get a more complete fix, too! Workflow problems like this make GitHub Issues really difficult to use. |
Beta Was this translation helpful? Give feedback.
-
Glad to see some action finally happening here. I'm struggling to understand the preference for the first options in this discussion. Option 3 is really the limiting factor, and seems the easiest to fix:
As for the other options, it is of course an important feature. I don't mind if auto-closing is configured at repo, organisation or issue level. The only thing I think is important is that it is an opt-in feature and not enabled by default. |
Beta Was this translation helpful? Give feedback.
-
Very glad to see this finally being addressed. The only solution that i'm interested in is number 1. There has to be a way to set the behaviour for all issues and PRs. Is 2 and 3 are provided, they need to be overriden by 1 when set - i do not want it to be possible to create issues or PRs that break how we have decided things should work in our project. |
Beta Was this translation helpful? Give feedback.
-
This needs to be fixed soon. |
Beta Was this translation helpful? Give feedback.
Users can now choose whether merging linked pull requests automatically closes the issue--check out the announcement!