Skip to content

CI Close PR fixing an unready issue for early contributors - #35071

Merged
lesteve merged 3 commits into
scikit-learn:mainfrom
lesteve:close-issue-not-ready-early-contributors
Oct 10, 2026
Merged

lesteve merged 3 commits into
scikit-learn:mainfrom
lesteve:close-issue-not-ready-early-contributors

Conversation

@lesteve

@lesteve lesteve commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

#34506 added the logic to close a PR from a first-time contributor when it fixes an issue that is not ready, e.g. has a "Needs Triage" or "Needs Investigation" label.

I think it makes sense to extend this rule to early contributors. The easiest thing to do is to have a threshold on the numbers of PR merged. 10 merged PRs kind of feels right to me and it's also the definition chosen by the JupyterHub triage board 1.

Why do we need this?

As a maintainer, I sometimes hesitate to merge a PR fixing a typo or link when I think the associated account is likely mostly automated. If I merged the PR, the associated account will escape the "close PR if issue not ready" rule, and I am not sure I want to take this "gamble".

Extending the rule to more than 10 PRs merged would make me more comfortable merging the PR.

Testing

I tested the workflow and script in the separate https://github.com/lesteve/scikit-learn-on-pr-created-or-edited-tests repo and it works, see lesteve/scikit-learn-on-pr-created-or-edited-tests#26 for a summary of what was tested. The testing was done with an agent as you can guess 😉.

cc @virchan who created the rule originally and @jeremiedbb whom I chatted quickly with about this.

Additional comments

I added some logic so that you don't get the welcome message when your PR gets closed automatically, which is the current behaviour I think, not 100% sure.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Research and understanding
  • Testing the workflow in a separate repo

Footnotes

  1. see "Scaling “Maintainer Intuition” with Pull Request Triage Boards" blog post if you are curious about the context 😉 ↩

@cakedev0

cakedev0 commented Oct 5, 2026

Copy link
Copy Markdown
Member

I sometimes hesitate to merge a PR fixing a typo or link when I think the associated account is likely mostly automated. If I merged the PR, the associated account will escape the "close PR if issue not ready" rule, and I am not sure I want to take this "gamble".

I had the same hesitations several times already, so +1 for this PR.

5 merged PRs feels like enough to me, but 10 is fine too.

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks, @lesteve!

I definitely agree that a contributor knows what they are doing by their 11th PR. However, from my own experience, I was still getting familiar with the contribution workflow when I opened my 6th PR 😅.

So, I think 10 is a good starting point. We can always revisit the merged PR threshold if necessary.

@cakedev0 , could you approve this before I merge?

@lesteve

lesteve commented Oct 10, 2026 •

Copy link
Copy Markdown
Member Author

There is one approval from @virchan and a +1 in @cakedev0's #35071 (comment), let's self-merge this
one then!

I will be on Triage next Monday (October 12), so I'll keep an eye on this to make sure it works as intended.

In general, my personal rule is that one approval is enough for CI stuff (and PRs that don't affect users directly), unless there is something possibly controversial in it, which I think there isn't in this PR. IIRC we have some kind of wording somewhere that one approval is enough for "simple" PRs. There were even discussions that one approval + self-review after having waited a bit was OKish. The idea of waiting a bit (IMO one week is acceptable order of magnitude) delay is to make sure you have waited a bit for feed-back and that you have a fresh look at your own PR.

And yes the threshold 10 is a bit arbitrary, and I am open to tweak it if we notice this is too annoying in practice.

@lesteve
lesteve merged commit 737c0ac into scikit-learn:main Oct 10, 2026
39 checks passed
@lesteve
lesteve deleted the close-issue-not-ready-early-contributors branch October 10, 2026 04:40
@github-project-automation github-project-automation Bot moved this from Todo to Done in Labs Oct 10, 2026
@test-lesteve test-lesteve mentioned this pull request Oct 10, 2026
2 tasks done
@lesteve

lesteve commented Oct 10, 2026 •

Copy link
Copy Markdown
Member Author

Just to double-check 1, I did a quick test with my test-lesteve account see #35117 and it seems to work fine.

worfklow logs that run on PR opened or edited are here if that helps: . They seem to take 15-20s which is OK I think. There are more workflows that I was expecting maybe because "edited" triggers on more things than I thought 🤔, not a big deal anyway.

Any unintended side-effects, let me know 😉!

Footnotes

  1. sure, this PR was tested "seriously" in a test repo, but with CI you never know 😅 ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants