Repository navigation
Description
Following up on the discussion in #31679 about low-effort contributions (like ai-generated with low human supervision), @lucyleeow and me worked out an idea: We would like to propose introducing an autoclose option for PRs that gets triggered when setting an "autoclose" label that can be removed if the PR is improved.
The idea is to provide a structured way to handle PRs that don't yet meet our contribution standards and facilitate the reviewing process. This will be transparent and fair for new contributors.
Suggested process
- A contributor opens a PR that looks low-effort, fly-by, not supervised ai-generated, or otherwise not yet ready for review.
- A reviewer sets an "autoclose" label. This would automatically add a polite, standardised comment explaining:
- The PR will be autoclosed after n weeks (e.g. 4).
- A list of common quality issues (similar to what we used in Add FAQ entry about the spam label #31822) that outlines what the contributor needs to address in order to avoid the PR being autoclosed (can contain links to the docs and the FAQs where we explain those things in detail).
- An encouragement to comment on the PR and ping the person who set the "autoclose" once they believe they have met the quality standards and addressed the issues, or when they struggle or need clarification in a specific point.
- A note that reviewer time is limited and we cannot provide detailed guidance.
- Possible outcomes:
- If the author doesn't respond or pushes commits that don't address the issues → PR is autoclosed after the timeout.
- If the author states problems → reviewers can offer guidance at their discretion, based on capacity and fit.
- If the author makes the required improvements:
- ideally either the reviewer who set the label or the person on triage removes the label, which stops the autoclose action, and the PR can be reviewed and move forward as usual
- in some cases (hopefully not too often) we might miss the deadline and the author would need to open a new PR (that's a downside on applying an the autoclose policy)
Benefits
- For maintainers: avoids the implicit obligation to fully review low-quality PRs and allows to focus on genuine contributions.
- For contributors: sets clear expectations from the start, and thoughtful contributors benefit because reviewers have more time for their PRs.
- For the project: helps keep the PR queue manageable and signals that quality and preparation are expected.
The key point is that this wouldn't reduce our support for new contributors. It only shifts the expectation: authors are responsible for bringing their PRs to a reviewable state, and reviewers can decide how much help to give along the way.
Technical feasibility
This should be achievable with a GitHub Action, similar to those used in many open source projects to autoclose stale issues or PRs, but triggered by a label instead of inactivity.
Activity
lucyleeow commentedon Sep 18, 2025
ping @scikit-learn/core-devs @scikit-learn/documentation-team for visibility
GaelVaroquaux commentedon Sep 18, 2025
I think that something in this direction is great, with a well-written message explaining why we do it and apologizing for the inconvenience, and explaining simply how humans can avoid automatic closure.
Thanks!!
lucyleeow commentedon Sep 18, 2025
I forgot to ping @scikit-learn/communication-team sorry 😬
adrinjalali commentedon Sep 18, 2025
Sounds good to me. We can also re-open PRs, sos autoclosing is not that big of a deal.
ArturoAmorQ commentedon Sep 18, 2025
Sounds quite reasonable. My only concern being the second part in:
because that still requires a follow-up from our side, but by whom? The reviewer who added the tag or any other reviewer?
Also the
spamandautocloselabels should be equivalent, right?lucyleeow commentedon Sep 18, 2025
I think if the author does not follow up the PR is automatically closed (after x amount of time) and no effort is required by the maintainer in this case except adding the label at the start.
Good point. I would propose this auto-close supersede the spam label.
betatim commentedon Sep 19, 2025
I think I understand the general idea. And I like it as an extension of the "spam" label.
One question about how the "don't close this" mechanism will work: will it be enough for the PR creator to push more commits after it being labelled? Or how will that work?
Having to decide "close or not?" after the timeout seems tricky. Which makes me think: do we have to bother? Assuming that most of these PRs/Issues won't see any activity after getting labelled, can we just leave them as is? They are labelled, have a message explaining what has happened ... so we can just leave it open and it will end up at the bottom of the already endless list of open issues/PRs?
GaelVaroquaux commentedon Sep 19, 2025
ArturoAmorQ commentedon Sep 19, 2025
Letting spammy PRs accumulate is even worst when they are linked to a particular issue. Closing them helps reviewers focus their energy on genuine PRs without having to open each linked PR to see whether they've been labeled as spam. Example from issue #27159:
adrinjalali commentedon Sep 19, 2025
Having an endless list of open PRs means we can't manage to have a handle on making sure contributors receive timely response from maintainers, since we can't have an overview of all open PRs. Ideally, we'd have in the order of <200 open PRs and we would be able to have meetings where we review everything which is open and happening, and make sure nobody's ignored.
I find this effort certainly a step towards that goal.
betatim commentedon Sep 19, 2025
Can someone explain how the autoclosing mechanism will work then? Alternatively, can people keep pushing commits to a closed PR? If yes, we could label, comment and close PRs all in one go
4 remaining items
StefanieSenger commentedon Sep 19, 2025
I fully agree. Pinging the whole team is something we should avoid at all costs. Pinging the person who set the label maybe as well. We could only ask the contributor to comment on the PR (not mention to ping, though many will do anyways), but then how to make sure their update is seen and reviewed? Does setting a label subscribe you to this PR? If the time is ticking for this PR, there should be a fair chance to have it checked by us a second time if the author reacts to our request to fix the quality.
This is why I was stressing that we should communicate that we are unfortunately short in reviewing time and there might be no possibilty for us to lead people through the process of making their PR reviewable. And the obligation of the person who put the label would be only to decide whether to remove the label, without any obligation to write down all the reasons of why this PR is still not meeting the standards. And without the obligation to review it in case it meets the standards, of cause.
Cool, I'm super happy to work on that, if this is how the discussion turns out.
lucyleeow commentedon Sep 19, 2025
I don't think there will be a perfect solution to this. Here are some options:
(I numbered these just so we can refer to them more easily, they are not in any order)
From my talks with (or reading about) other maintainers about experiences in this realm seem like, they have had to take more assertive action.
StefanieSenger commentedon Sep 19, 2025
That would be one possibility, but I would rather wait for this, since the easier the labeling, the more accepted it will become and the more it gets used by all team members.
I would rather wait and see how many autoclose-marked PRs will there be and when it becomes too tedious to filter for them (because there are too many) then would be the right time to implement another label
adrinjalali commentedon Sep 20, 2025
We can also consider using these tools: https://github.com/github/ai-assessment-comment-labeler
lucyleeow commentedon Sep 20, 2025
This looks like it is only for issues, not PRs?
adrinjalali commentedon Sep 20, 2025
True, but it's easy to configure bots interacting with GH models at this point. This gave me the idea that we when we apply that label, we can also ask copilot to leave a review for instance, with a prompt where we tell it exactly what kind of review we want.
I'm not sure how much we'd like the reviews left there, since some of our previous experiments didn't give us high quality reviews on good PRs. But on bad PRs, the review might actually be good enough?
I think we just need to experiment and see what we get.
lucyleeow commentedon Sep 20, 2025
Would it be easy to configure it if it's designed to assess issues instead of PRs?
But also happy if you want to give it try!
StefanieSenger commentedon Sep 30, 2025
I've seen some thumbs up, but is there any hard veto against implementing an
"autoclose"github action, that can be activated via setting a label? @scikit-learn/core-devs @scikit-learn/communication-team @scikit-learn/documentation-teamGaelVaroquaux commentedon Sep 30, 2025
I'm 👍 .
People in favor, do not hesitate to 👍 this
lesteve commentedon Oct 1, 2025
I am in favour of trying the simplest thing we can think of (for example, no AI-based action) and iterate on it to try to make it useful for us.
Rough plan would be something like this:
For security considerations, I would try to use official Github actions like
actions/staleas much as possible rather than third-party GitHub actions. If we think in terms of worst outcome, the token would likely needissue: writeandpull-request: write. It would need to be double-checked to be 100% sure, but if you steal such a token you would be able to cause havoc in our GitHub issues/PR, by closing issues, editing commments, probably deleting comments as well.lucyleeow commentedon Oct 1, 2025
@lesteve, if we are planning on adding a label that will automatically close a PR in e.g., 2 weeks, unless the label is removed; is your suggestion that we test it in a test repo to make sure it works?
I didn't follow why we need:
?
StefanieSenger commentedon Oct 1, 2025
Thanks for giving me some hints on security, @lesteve. I am not yet sure which permissions need to be set in order for it to work. I hope I can find out on the play repo.
@lucyleeow Since we cannot test this on the branch before merging it into main, there has to be an additional implementation of it in a play repo, as a proof of concept. If first needs to work there before we can merge this into main in scikit-learn. I will probably open these in parallel.
lesteve commentedon Oct 1, 2025
This will need a GHA workflow and in my experience, it's very easy to get something wrong with CI so iterating in a test repo seems like the first thing I would do. It can be done it in your scikit-learn fork which sometimes is easier.
Edit: as mentioned by @StefanieSenger some workflows need to be in
mainbefore they are actually used. The PR is not testing anything. I forgot to mention this explicitly 😅.StefanieSenger commentedon Oct 13, 2025
TL;DR: We're proposing a Github Actions workflow, that closes a PR after a delay when an "autoclose" label is set, unless a scikit-learn member removes this label in time. In addition, the author of the PR gets a helpful comment when the label is set explaining how to get a PR into shape to make it more reviewable.
Of cause nobody needs to use the new label and some PRs will still need to be closed right away and marked as
spam.If this sounds good to everyone, I’ll go ahead and open a PR for it. 🚀