Prevent issues from being closed by merging linked PRs #17308
Replies: 48 comments 61 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/) |
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 want a simpler solution -- please remove this auto-close feature entirely. Assuming intent with very common English words that people would use in a good PR description is, well, assumption. And assuming things is never a very good idea. |
Beta Was this translation helpful? Give feedback.
-
I'm not entirely sure whether it was brought here as well, but github will close issues cross different organizations if the user who merged the PR has maintainer access in both. This is completely unexpected, because the repositories are not even under the same org. An example where it happened. A simple toggle to not auto-close when the repo where PR was merged is not the same where the issue is could be really great addition and probably be really simple given that the URL and the check is likely nearly at the same place, given that it uses org settings when doing so, because when I wasn't an org maintainer it was not doing so IIRC. Right now it took me 10 minutes to figure out what happened, since I clearly remembered that the issue was opened. |
Beta Was this translation helpful? Give feedback.
-
+1 - please do it ASAP, it is really painful to re-open everything and restore issues in the projects |
Beta Was this translation helpful? Give feedback.
-
I'm having the problem that the issues are being closed when I do a commit with fix tag, but, this did't happened two weeks ago |
Beta Was this translation helpful? Give feedback.
-
I just found out that if you link the issue in PR comment it won't close. Only tagging it in PR title closes the issue. |
Beta Was this translation helpful? Give feedback.
-
Why isn't this "feature" just an Action? They could add it as a default if they have this as a strong opinion. |
Beta Was this translation helpful? Give feedback.
-
It makes me wonder if Microsoft uses this tool to manage complex projects. How would they be linking issues to PRs? Eat your own dogfood etc. |
Beta Was this translation helpful? Give feedback.
-
This really needs to be resolved soon. Makes linking PRs to issues completely impossible because as soon as you have an issue that is slightly more complex than one PR, you have to keep re-openning it. |
Beta Was this translation helpful? Give feedback.
-
Sometimes I like creating different branches on the same issue because of some reasons. Merging one should NOT close the issue. For now I constantly need to reopen it manually and set my project status back to "in progress". |
Beta Was this translation helpful? Give feedback.
-
So @monitora-media, we've actually gone the extra length of automating reopening issues which still have a linked open PR. I assume it's not an easy task internally, considering the GH API contains properties like |
Beta Was this translation helpful? Give feedback.
-
+1 This is preventing out enterprise from leveraging the care convenient feature of creating branch from issue and working on an issue that may span multiple different repos across our frameworks. We also have automation that generates summary audit of an issue once closed so close/reopen is just annoying and we may need to refactor any automation we have for closing. Please make it a priority to fix this asap. Thank you! :) |
Beta Was this translation helpful? Give feedback.
-
Not being able to configure this yet is embarrassing. There must be a more appropriate channel of communication since I don't see any official response regarding the status of this issue. Is there another area where someone has at least acknowledged that this has been triaged or looked into? |
Beta Was this translation helpful? Give feedback.
-
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.
All reactions