You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RFC Automatically close pull requests linked to issues that are not ready for contributions #34252
Disclosure: I used LLM to proofread earlier drafts of this issue. All mistakes are due to me.
TL;DR: This RFC discusses whether pull requests linked to issues not yet ready for contributions should be automatically closed to reduce repetitive reviewer workload.
The Situation
In the current review workflow, reviewers typically start with the following steps before inspecting the changes:
Manually check whether the pull request is linked to an issue that is ready for contributions (e.g., not labelled "Needs Triage").
If the linked issue is not yet ready for a pull request, reviewers need to explain this to the author and then close the pull request.
While this process is straightforward and the decision-making is usually quick, it can become repetitive over time and contribute to reviewer fatigue, increasing the maintenance burden.
#33521 reduces the time needed for step 1. However, explaining to contributors why a pull request is being closed because the linked issue is not ready (including wording and tone) is still time-consuming, and is often repeated in very similar forms. See #32951 (review), #33455 (review), and #33695 (review) for examples.
Proposed Solution
During the 2026 sprint, we (@AnneBeyer, @StefanieSenger, and myself) discussed mitigating step 2 by introducing a bot that automatically closes pull requests linked to issues that are not yet ready for contributions. This builds on #33521, and is relatively straightforward from a technical standpoint.
However, the proposed approach has at least two potential concerns:
+1, but for a slightly more restricted version that limits this action to new contributors (at least in a first iteration), which will likely resolve the first concern.
+1, I'd be happy about having this tool just as described.
It may close pull requests that are intended as PoC for issues still under discussion,
A way around having our PoCs closed is to describe everything in the PR description and not use an issue, or not link to it (which new contributors are discouraged from doing).
+1 for closing a bit more aggressively. I think that we can handle the PoC Pars with a label. I think the number of false positive closing will not be that harmful.
In regards with Anne's comment, could we get a quick statistics to see how many of those noisy PR are from new contributor and from returning contributor.
If we have vast majority (>80%), I would be inclined with Anne's proposal and it will even reduce false positive.
yeah I like this, and also making sure we leave a scary sounding message as the bot closes them. It'd be also nice to keep track of how many of such PRs from each contributor are closed, so that we ban the ones who reach a certain number semi-automatically.
also making sure we leave a scary sounding message as the bot closes them.
I would think the opposite: have a friendly message explaining the problem, so that we don't create adverse reactions from contributors with goodwill but incorrect understanding.
I don't think it would be healthy for the project in the long term to discourage contributions with a "scary" message. That can also hurt how real humans perceive us, even before contributing.
What if the issue's OP doesn't mark it as ready for contributions for whatever reason (partial consensus or simply by omission) and then a valuable contribution gets closed with absolute no attention from reviewers?
But what worries me the most is that bots may just learn that not linking the related issue at all leads to better chances for the PR?
a valuable contribution gets closed with absolute no attention from reviewers?
They can reopen their PR once the corresponding issue got triaged. Valuable contributions always have human beings behind that have skin in the game and will therefore care about this.
But what worries me the most is that bots may just learn that not linking the related issue at all leads to better chances for the PR?
+1: the whole note should be as polite as possible.
a valuable contribution gets closed with absolute no attention from reviewers?
They can reopen their PR once the corresponding issue got triaged. Valuable contributions always have human beings behind that have skin in the game and will therefore care about this.
Could we add a note explicitly stating that they can reopen the PR if they address the requested feedback (e.g., if x, y, and z are done)? Someone who doesn't use scikit-learn, but wants to contribute anyway, may not have "skin in the game". Having their PR closed could discourage them from ever trying again.
As context: I started contributing through "good first issues", and there wasn't anything specific that I wanted to fix.
It's a bit sad to read in other discussions that those kinds of contributions are not considered valuable. Or that truly "valuable contributors" are expected to come with specific things they want to fix.
I understand that AI-generated contributions have made things more difficult for maintainers, but what about new contributors? it's becoming harder for them as well. They may get lost in the sea of noise, or feel like they're knocking on closed doors.
I may sound touchy-feely, but let's try to maintain the welcoming and inclusive image that this project has built over the years.
I understand your reservations @DeaMariaLeon and I used R more when I started contributing too.
We have tried to be fairly clear, e.g. bot comment, pleading to not open a PR to issues that have not been triaged yet. Why would a person who genuinely wants to contribute ignore such a request? Since it comments in the issue, even the small group of people that do not use scikit learn but are genuinely keen to contribute should see it. Further, we've tried to give advice to new contributors in the docs, e.g. starting by reviewing PRs to gain more of an understanding of the project and norm. Non code contributions are still valuable.
(Edit: I agree the comment should be nice and encouraging, but I don't think closing this type of PR will happen to genuine contributors)
With regard to restricting to first time contributors, I know opinions will vary on this but some maintainers have become more cautious about merging small typo fix PRs to take care about who gains the contributor status. Just wanted to raise the notion
Regarding the message, I would follow @virchan's answer template and keep it rather neutral. We can still start with a "thank you" and basically copy the text from the warning note into the closing comment, that contains enough pointers for what they could do instead (if they bother to click on the links).
what about new contributors? it's becoming harder for them as well. They may get lost in the sea of noise, or feel like they're knocking on closed doors.
Your point is very appreciated and important.
My hope is that being stricter enforcing rules of communication and netiquettes will help us focus more on the new contributors that are genuine. I know how much resource I have available for triage and reviewing work and if I spend 90% of it evaluating PRs that aren't based on conscious decisions (but rather on an AI agent's best guess), comparing it with the issue and check if there are other PRs doing the same, then the new contributors that actually put in thought and effort are invisible to me.
I like the suggestion. I think the message from the bot needs to be polite and state facts. No opinion/value judgement. It can conclude with "sometimes this automation gets it wrong, for example for requested proof-of-concepts. Apologies if this happened to you" - maybe we need to add that people should post in the original issue that they made a POC PR?? But maybe people would figure this out by themselves??
I think limiting the bot to new contributors is the way to go. It will reduce a lot of the workload and reduce the false positives.
Can we set it up as a pull_request workflow instead of the more powerful pull_request_target? The latter has many warnings and is a popular way for attacks, so avoiding it would be great as it reduces the number of ways we can make a mistake and then get hacked.
+1 to this proposal, and I strongly agree with @AnneBeyer's suggestion to restrict it to new contributors initially. That solves the concern about blocking PoC PRs from regular contributors
Coming from the contributor side, I wanted to mention that this would be extremely helpful for issue authors. As stated, Right now there is a race condition where automated PRs are being opened the second an issue goes live.
For example, I recently opened a minor doc issue (#34315). Before the Needs Triage label could even be evaluated, a premature PR was opened against it, where i saw @virchan step in and mark it as SPAM / purely AI generated content.
Having an auto-close mechanism that immediately leaves a polite 'Please wait for triage' message would be a huge win. It saves the maintainers' time, stops the race condition, and keeps the issue thread clean so actual triage can happen.
Activity
AnneBeyer commentedon Jun 11, 2026
+1, but for a slightly more restricted version that limits this action to new contributors (at least in a first iteration), which will likely resolve the first concern.
StefanieSenger commentedon Jun 12, 2026
+1, I'd be happy about having this tool just as described.
A way around having our PoCs closed is to describe everything in the PR description and not use an issue, or not link to it (which new contributors are discouraged from doing).
StefanieSenger commentedon Jun 12, 2026
What do other people think, @scikit-learn/documentation-team, @scikit-learn/core-devs, @scikit-learn/contributor-experience-team?
glemaitre commentedon Jun 12, 2026
+1 for closing a bit more aggressively. I think that we can handle the PoC Pars with a label. I think the number of false positive closing will not be that harmful.
glemaitre commentedon Jun 12, 2026
In regards with Anne's comment, could we get a quick statistics to see how many of those noisy PR are from new contributor and from returning contributor.
If we have vast majority (>80%), I would be inclined with Anne's proposal and it will even reduce false positive.
lucyleeow commentedon Jun 12, 2026
+1 for bot closing - only concern is security - what permissions would the bot need to have?
StefanieSenger commentedon Jun 12, 2026
Probably the
pull_request_targetone: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_targetThe security warning reads intimidating, though I cannot really evaluate this. In the past we have introduced a few of these.
adrinjalali commentedon Jun 12, 2026
yeah I like this, and also making sure we leave a scary sounding message as the bot closes them. It'd be also nice to keep track of how many of such PRs from each contributor are closed, so that we ban the ones who reach a certain number semi-automatically.
GaelVaroquaux commentedon Jun 12, 2026
ArturoAmorQ commentedon Jun 12, 2026
I don't think it would be healthy for the project in the long term to discourage contributions with a "scary" message. That can also hurt how real humans perceive us, even before contributing.
What if the issue's OP doesn't mark it as ready for contributions for whatever reason (partial consensus or simply by omission) and then a valuable contribution gets closed with absolute no attention from reviewers?
But what worries me the most is that bots may just learn that not linking the related issue at all leads to better chances for the PR?
StefanieSenger commentedon Jun 12, 2026
They can reopen their PR once the corresponding issue got triaged. Valuable contributions always have human beings behind that have skin in the game and will therefore care about this.
Then we close these as well.
glemaitre commentedon Jun 12, 2026
From the proposal, I read:
So the important thing here is the "Need Triage" part which means that linking is not enough and the criterion is the issue needs to be ready.
3 remaining items
jeremiedbb commentedon Jun 12, 2026
That's a good point, sometimes it's desirable to have the PR before taking a decision on the issue because it helps take that decision.
DeaMariaLeon commentedon Jun 13, 2026
Thank you for working on this @virchan, @AnneBeyer, and @StefanieSenger!
+1: the whole note should be as polite as possible.
Could we add a note explicitly stating that they can reopen the PR if they address the requested feedback (e.g., if x, y, and z are done)? Someone who doesn't use scikit-learn, but wants to contribute anyway, may not have "skin in the game". Having their PR closed could discourage them from ever trying again.
As context: I started contributing through "good first issues", and there wasn't anything specific that I wanted to fix.
It's a bit sad to read in other discussions that those kinds of contributions are not considered valuable. Or that truly "valuable contributors" are expected to come with specific things they want to fix.
I understand that AI-generated contributions have made things more difficult for maintainers, but what about new contributors? it's becoming harder for them as well. They may get lost in the sea of noise, or feel like they're knocking on closed doors.
I may sound touchy-feely, but let's try to maintain the welcoming and inclusive image that this project has built over the years.
lucyleeow commentedon Jun 13, 2026
I understand your reservations @DeaMariaLeon and I used R more when I started contributing too.
We have tried to be fairly clear, e.g. bot comment, pleading to not open a PR to issues that have not been triaged yet. Why would a person who genuinely wants to contribute ignore such a request? Since it comments in the issue, even the small group of people that do not use scikit learn but are genuinely keen to contribute should see it. Further, we've tried to give advice to new contributors in the docs, e.g. starting by reviewing PRs to gain more of an understanding of the project and norm. Non code contributions are still valuable.
(Edit: I agree the comment should be nice and encouraging, but I don't think closing this type of PR will happen to genuine contributors)
With regard to restricting to first time contributors, I know opinions will vary on this but some maintainers have become more cautious about merging small typo fix PRs to take care about who gains the contributor status. Just wanted to raise the notion
DeaMariaLeon commentedon Jun 13, 2026
Good point. :)
AnneBeyer commentedon Jun 13, 2026
Regarding the message, I would follow @virchan's answer template and keep it rather neutral. We can still start with a "thank you" and basically copy the text from the warning note into the closing comment, that contains enough pointers for what they could do instead (if they bother to click on the links).
StefanieSenger commentedon Jun 15, 2026
Your point is very appreciated and important.
My hope is that being stricter enforcing rules of communication and netiquettes will help us focus more on the new contributors that are genuine. I know how much resource I have available for triage and reviewing work and if I spend 90% of it evaluating PRs that aren't based on conscious decisions (but rather on an AI agent's best guess), comparing it with the issue and check if there are other PRs doing the same, then the new contributors that actually put in thought and effort are invisible to me.
betatim commentedon Jun 15, 2026
I like the suggestion. I think the message from the bot needs to be polite and state facts. No opinion/value judgement. It can conclude with "sometimes this automation gets it wrong, for example for requested proof-of-concepts. Apologies if this happened to you" - maybe we need to add that people should post in the original issue that they made a POC PR?? But maybe people would figure this out by themselves??
I think limiting the bot to new contributors is the way to go. It will reduce a lot of the workload and reduce the false positives.
Can we set it up as a
pull_requestworkflow instead of the more powerfulpull_request_target? The latter has many warnings and is a popular way for attacks, so avoiding it would be great as it reduces the number of ways we can make a mistake and then get hacked.lucyleeow commentedon Jun 19, 2026
Fyi
pull_request_targetis being made saferhttps://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/
shipitdev commentedon Jun 21, 2026
+1 to this proposal, and I strongly agree with @AnneBeyer's suggestion to restrict it to new contributors initially. That solves the concern about blocking PoC PRs from regular contributors
Coming from the contributor side, I wanted to mention that this would be extremely helpful for issue authors. As stated, Right now there is a race condition where automated PRs are being opened the second an issue goes live.
For example, I recently opened a minor doc issue (#34315). Before the Needs Triage label could even be evaluated, a premature PR was opened against it, where i saw @virchan step in and mark it as SPAM / purely AI generated content.
Having an auto-close mechanism that immediately leaves a polite 'Please wait for triage' message would be a huge win. It saves the maintainers' time, stops the race condition, and keeps the issue thread clean so actual triage can happen.
webdevpraveen commentedon Jul 5, 2026
virchan commentedon Jul 15, 2026
Thanks, everyone, for your input!
It looks like there is consensus around the proposed solution, so I'll remove the RFC label and start working on it.
StefanieSenger commentedon Jul 18, 2026
Removing the sprint label so people don't confuse it with the
EuroPythonsprint label.