Github should support closing issues by merging PRs to non-main branches #112224
Unanswered
xmo-odoo
asked this question in
Pull Requests
Replies: 2 comments 1 reply
-
|
Hi, I think when you open PR and close it right after it will remain in that branch without moving to main branch, or I got the question wrong? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
We need this so badly - how is it possible in the UI but not via GitHub Rest/GraphQL API?! see meta issue: https://github.com/orgs/community/discussions/186495 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For a long time now github has supported closing issues via commit messages and pull request descriptions.
However this suffers from a very frustrating limitation: it only works when the commit lands in or the PR targets the repository's default branch.
This means it's almost completely useless for projects with long running / maintenance branch, because bug fix PRs will commonly target non-main branches, and the commits might not even land in the main branch ever, depending on the project's methodology (merge v back-port v forward-port).
Example
The CPython project has yearly major releases and supports each major for about 5 (five) years, ignoring 2.7 which got 10 years of support. Their maintenance policy is to fix the latest branch in which an issue occurs, then have a bot backport the fix to older branches. So e.g. if a fix happens in 3.10 but not in 3.11 (because the subsystem was rewritten or removed), a PR will be created against 3.10 and the commit will land in 3.10, 3.9, and 3.8, but not the default branch (main), nor branches for later major releases (3.12 and 3.11).
Request
It should be possible to mark non-main branches as keyword targets / whatever. I believe the rulesets could be leveraged for that, as usually a branch protected by a ruleset would be a primary or relevant branch (rather than a development scratch branch), and thus might benefit from automatically closing issues.
Beta Was this translation helpful? Give feedback.
All reactions