Skip to content

Workflow to comment on PRs from first time contributors - #34211

Merged
virchan merged 5 commits into
scikit-learn:mainfrom
jeremiedbb:first-time-contributor-comment
Jun 9, 2026
Merged

virchan merged 5 commits into
scikit-learn:mainfrom
jeremiedbb:first-time-contributor-comment

Conversation

@jeremiedbb

@jeremiedbb jeremiedbb commented Jun 8, 2026 •

Copy link
Copy Markdown
Member

This PR proposes a gh workflow to post a comment on PRs opened by first time contributors.

It has 2 objectives:

  • welcome new contributors
  • make sure they took the time to make it in a good enough shape so that it's reviewable

Fixes #33707

@AnneBeyer AnneBeyer 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.

Thank you for taking this up @jeremiedbb, I like the contributor introduction part and the approach with the welcome comment.
I just added two comments for discussion.


- [ ] Fill out the [PR template](https://github.com/scikit-learn/scikit-learn/blob/main/.github/PULL_REQUEST_TEMPLATE.md)

- [ ] Make sure that the PR addresses an existing issue that is ready for

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.

This is actually point 2 on the PR checklist.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I know but I really wanted to highlight this point here. It's one of the main reasons we reject many PRs these days. Contributors don't read the warning that is at the top of the issue description.

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.

I agree that this makes sense.

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.

Could we also include "Make sure your code passes the tests / CI”? (Point 3 on the PR checklist)

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.

I think it could make sense to add a general entry to make sure all CI checks pass/are green (which apart from the tests also includes linting & co., codecov, successfully building the docs) and point to the PR checklist for details?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Could we also include "Make sure your code passes the tests / CI”?

I did include that in the 3rd point

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.

See how attentive we read the checklist 🙈

...). If you are proposing a new feature, please open an issue to
discuss it first.

- [ ] Follow the [PR checklist](https://scikit-learn.org/stable/developers/contributing.html#pull-request-checklist).

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.

Should we maybe use this opportunity to also clean up the PR checklist? (We put this on a future to-do list a while ago.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree that the PR check list and contribution doc can be improved but I'd rather not couple it with this PR. It would block it for a while and I didn't plan to do that myself. I'd rather have someone else work on it on a separate PR :)

Comment thread .github/PULL_REQUEST_TEMPLATE.md Resolved

- [ ] Fill out the [PR template](https://github.com/scikit-learn/scikit-learn/blob/main/.github/PULL_REQUEST_TEMPLATE.md)

- [ ] Make sure that the PR addresses an existing issue that is ready for

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.

Could we also include "Make sure your code passes the tests / CI”? (Point 3 on the PR checklist)


post_comment:
name: welcome
if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

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.

This misses some users, because my PR to your repo actually has NONE here (though I'm not 100% sure how this differs from FIRST_TIME_CONTRIBUTER, as both seem to entail other activity on GitHub, see here), and there is also FIRST_TIMER for people who never contributed to any repo before.

We can try something like the following

Suggested change
if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
if: contains(fromJson('["FIRST_TIME_CONTRIBUTOR", "FIRST_TIMER", "NONE"]'),
github.event.pull_request.author_association)

or there is also an official gh action, if we are fine with introducing another dependency for this.

@jeremiedbb

Copy link
Copy Markdown
Member Author

The test on my fork now works (jeremiedbb#41)

@jeremiedbb

Copy link
Copy Markdown
Member Author

I'm trying to improve the rendering. Here's how it looks now:


Thank you for opening your first pull request to scikit-learn! 🎉

Here are a few things to help get your contribution reviewed:

  • Fill out the PR template
  • Make sure that the PR addresses an existing issue that is ready for
    contribution (e.g. not tagged as "Needs Triage", "Needs Decision", ...).
    If you are proposing a new feature, please open an issue to discuss it first.
  • Follow the PR checklist.
    In particular, make sure that linting and tests pass.

@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, @jeremiedbb!


Here are a few things to help get your contribution reviewed:

- Fill out the [PR template](https://github.com/scikit-learn/scikit-learn/blob/main/.github/PULL_REQUEST_TEMPLATE.md)

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.

Since the PR will already be open, maybe

Suggested change
- Fill out the [PR template](https://github.com/scikit-learn/scikit-learn/blob/main/.github/PULL_REQUEST_TEMPLATE.md)
- Make sure you used the [PR template](https://github.com/scikit-learn/scikit-learn/blob/main/.github/PULL_REQUEST_TEMPLATE.md)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are already 2 "make sure". I rephrased the whole comment to avoid this repetition.

@jeremiedbb

jeremiedbb commented Jun 9, 2026 •

Copy link
Copy Markdown
Member Author

I added a new bullet point to check that there's no other open PR for the same issue. I also rephared a bit to avoid some repetitions. The rendering is now:


Thank you for opening your first pull request to scikit-learn! 🎉

To help get your contribution reviewed, please make sure that:

  • You have filled out the pull request template
  • The pull request addresses an existing issue that is ready for
    contribution (e.g. not tagged as "Needs Triage", "Needs Decision", ...).
    If you are proposing a new feature, please open an issue to discuss it first.
  • There are no other open pull requests already targeting the same issue.
  • You have followed the pull request checklist.
    In particular, linting and tests should pass.

@AnneBeyer AnneBeyer 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.

Thank you, @jeremiedbb, a tiny nit, otherwise LGTM!

@virchan
virchan merged commit 8c1324d into scikit-learn:main Jun 9, 2026
33 checks passed
@AnneBeyer

AnneBeyer commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

I just got that comment in this PR, so NONE actually seems to have a broader scope than expected. Should we consider going with the official gh action instead?

@jeremiedbb

Copy link
Copy Markdown
Member Author

Yeah, you're listed as "member" and I've also seen it in a PR from a "contributor".
Github is able to classify contributors between into member, contributor, first-time contributor, first-time github contributor. Why can't we easily get this info ? 😄

@jeremiedbb

Copy link
Copy Markdown
Member Author

So I was trying to be smart to avoid 3 lines of code but turned out it was bugged. I should have followed your suggestion from the start :)

prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb
jeremiedbb deleted the first-time-contributor-comment branch September 3, 2026 15:25
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a contributor introduction to the PR template

3 participants