Skip to content

MNT Periodic adds labels based on module#16596

Merged
adrinjalali merged 10 commits intoscikit-learn:masterfrom
thomasjpfan:periodic_update_github_actions
Mar 2, 2020
Merged

MNT Periodic adds labels based on module#16596
adrinjalali merged 10 commits intoscikit-learn:masterfrom
thomasjpfan:periodic_update_github_actions

Conversation

@thomasjpfan
Copy link
Copy Markdown
Member

Since PRs do not have permissions to label itself, this new version will run every 10 minutes to label all the PRs (if they are not already labeled).

This would label every PR based on the modules changed. If more than 3 modules are changed, then no labels will be added.

@thomasjpfan
Copy link
Copy Markdown
Member Author

I've been testing this on my fork to make sure this works: https://github.com/thomasjpfan/scikit-learn/pulls

The bot goes through every 10 minutes and checks to see if the labels needs updating.

@jnothman
Copy link
Copy Markdown
Member

jnothman commented Feb 29, 2020 via email

@thomasjpfan
Copy link
Copy Markdown
Member Author

Currently, it does not remove labels. It does make sense to remove labels to keep the up to date with the PR.

The interesting case is when updates to the PR causes the number of modules change to go above max-labels. In this case, should we remove all the labels or leave the current labels alone? I am +0.5 on removing all the labels in this case.

@jnothman
Copy link
Copy Markdown
Member

jnothman commented Mar 1, 2020 via email

@thomasjpfan
Copy link
Copy Markdown
Member Author

Personally, I would use them to make reviewing the PRs more manageable. For example, after reviewing a PR on trees, it would be more efficient for me to look at another PR on trees, since it is already on my mind.

Maybe @caioaao or @adrinjalali can speak more about the purpose of the labels.

Side note: maybe a "this touchs alot of modules" labels, i.e. "modules:many"?

@rth
Copy link
Copy Markdown
Member

rth commented Mar 1, 2020

Personally, I would use them to make reviewing the PRs more manageable. For example, after reviewing a PR on trees, it would be more efficient for me to look at another PR on trees, since it is already on my mind.

I agree, also useful to find stalled PR the same topic etc.

So assume we change module labels in some PR because the auto-labeling got it wrong, does it mean that this manual change would be overwritten by the auto-labeler in 10min? Ideally PRs with existing module labels should not be relabeled.

@thomasjpfan
Copy link
Copy Markdown
Member Author

So assume we change module labels in some PR because the auto-labeling got it wrong, does it mean that this manual change would be overwritten by the auto-labeler in 10min?

I would want to fix the labeler in this case. Currently the label should only match based on the module.

Ideally PRs with existing module labels should not be relabeled.

This is the current behavior. The labeler will not remove any labels and will only add up to max-labels.

I think the concern is that a label can go stale. If a PR changes a module and then removes the changes, the old label will not apply.

@thomasjpfan thomasjpfan changed the title MNT: Periodic adds labels based on module [WIP] MNT: Periodic adds labels based on module Mar 2, 2020
@thomasjpfan thomasjpfan changed the title [WIP] MNT: Periodic adds labels based on module MNT Periodic adds labels based on module Mar 2, 2020
@adrinjalali
Copy link
Copy Markdown
Member

Yeah. as @thomasjpfan says, it makes it easier for people to focus on one module for reviews (and to submit PRs, when labels are applied to issues).

It also makes it easier to have an overall idea of what's being done on which module, which ones are active, etc.

Copy link
Copy Markdown
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

So what happens if we label a PR which touches an example or a user guide, to have that label? I guess this PR doesn't touch those labels, am I correct?

triage:
runs-on: ubuntu-latest
steps:
- uses: thomasjpfan/labeler@v2.4.3
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'd really be happy to move this to scikit-learn at some point.

@thomasjpfan
Copy link
Copy Markdown
Member Author

So what happens if we label a PR which touches an example or a user guide, to have that label? I guess this PR doesn't touch those labels, am I correct?

If a PR touches the user guide or examples, this PR doesn't do anything with them. Currently, this PR is fairly conservative. It never removes labels and only adds labels that it understands (up to maxLabels). By "understand", I mean the labels that are configured in .github/labeler.yml.

@adrinjalali adrinjalali merged commit 0e4f85f into scikit-learn:master Mar 2, 2020
@adrinjalali
Copy link
Copy Markdown
Member

then let see how it works :)

@thomasjpfan
Copy link
Copy Markdown
Member Author

I am a little nervous. lol

@thomasjpfan
Copy link
Copy Markdown
Member Author

@thomasjpfan
Copy link
Copy Markdown
Member Author

On the second run, it should go much quicker since they were labeled by this run.

@adrinjalali
Copy link
Copy Markdown
Member

woohoo, seems working, exciting!

@thomasjpfan
Copy link
Copy Markdown
Member Author

Hmm so it errored in the middle of adding labels. Looking into it.

@rth
Copy link
Copy Markdown
Member

rth commented Mar 2, 2020

Hmm so it errored in the middle of adding labels. Looking into it.

Label overflow? )

@rth
Copy link
Copy Markdown
Member

rth commented Mar 2, 2020

More seriously, I don't fully understand the error but wouldn't this still be limited by Github API restriction? In which several tries might be needed to label it the first time given the amount of PRs.

@thomasjpfan
Copy link
Copy Markdown
Member Author

Yea, it is hitting the github api limit. This would most likely fix itself after waiting.

@thomasjpfan
Copy link
Copy Markdown
Member Author

yea it resolved itself: https://github.com/scikit-learn/scikit-learn/runs/480601102?check_suite_focus=true

I will make one more update to use per_page=100 when requesting for the list of PRs to limit the number of API calls.

@rth
Copy link
Copy Markdown
Member

rth commented Mar 3, 2020

This really helps reviewing PRs by topic. Thanks @thomasjpfan !

gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
* MNT Users pull request labeler

* MNT Fix

* labeler fix

* MNT Update

* MNT Uses single quotes

* BUG Uses number

* MN Removes Build / CI auto labeling

* MNT Updates to labeler v2.4.1

* ENH Updates version to include logs
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.

4 participants