astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
33.32k stars 1.11k forks source link

Labeling issues and pull requests automatically #14685

Open Glyphack opened 2 days ago

Glyphack commented 2 days ago

This issue was brought up here originally. Since labeling every PR and issue could be time consuming I thought it could be helpful to automate it.

I created this issue to know if this is actually a time consuming problem that requires solving or not.

I was only thinking about red-knot right now which most of the issues and PRs are have "red-knot" in their title. So using title could help a lot and it's simple. For linter and formatter there should also be some useful strings(for example linter rule codes) to identify them.

I would be happy to work on this.

MichaReiser commented 2 days ago

Thanks for creating a space to discuss this.

Speeking just for myself.

Labelling issues and pull requests isn't what's taking a lot of my time. At least not compared to understanding and answering issues. However, I'm subscribed to all repository notifications. I could see how automatic labelling Red Knot issues could beuseful for @carljm who's not subscribed to repository notifications. But I let him speak for himself.

most of the issues and PRs are have "red-knot" in their title.

Yeah, that's something I started by mistake. I'm not sure if we actually want that haha

For linter and formatter there should also be some useful strings(for example linter rule codes) to identify them.

While possible, I'd prefer not to do that. Our current triaging is that issues without a label need triaging. Adding automatic labeling breaks this workflow (and it's not the time consuming part).

AlexWaygood commented 2 days ago

@michaReiser, you've complained to us before that we don't always remember to attach the red-knot label to red-knot contributor PRs when you're away ;)

If it's easy to do, I think it would be helpful to have a bot automatically add the red-knot label to PRs that only touch code inside of of the red-knot crates. But I do also agree that it doesn't feel like it's one of the things that takes up a lot of our time right now.

most of the issues and PRs are have "red-knot" in their title.

Yeah, that's something I started by mistake. I'm not sure if we actually want that haha

Personally I find it very useful to be able to immediately see from the commit message which commits are red-knot-related when I'm scrolling through git log!

dhruvmanila commented 8 hours ago

Labelling issues and pull requests isn't what's taking a lot of my time.

I agree although I do spend some time (not much) during the release going over the issues that we've forgotten to label.

If it's easy to do, I think it would be helpful to have a bot automatically add the red-knot label to PRs that only touch code inside of of the red-knot crates.

I like this and can be done easily using https://github.com/actions/labeler. We could configure it to label "red-knot" for PRs that touch the red_knot_* crates.

I was only thinking about red-knot right now which most of the issues and PRs are have "red-knot" in their title. So using title could help a lot and it's simple. For linter and formatter there should also be some useful strings(for example linter rule codes) to identify them.

I would prefer to just use the crate names in which the changes occur for a PR.

MichaReiser commented 6 hours ago

I like this and can be done easily using actions/labeler. We could configure it to label "red-knot" for PRs that touch the redknot* crates.

I prefer something simple to begin with. Looking at the changed code works for PRs but not for issues and we'd have to be careful not to over-label RPs as red knot PRs just because they touched some red knot crate. They should only be labelled with red knot if they don't touch any non-red-knot crate.

AlexWaygood commented 3 hours ago

Looking at the changed code works for PRs but not for issues

But I don't think we necessarily need a universal solution that removes the need for us to do any manual adding of labels. I agree with you that auto-labelling issues doesn't feel like it would add much value, but I feel like adding some labels to some PRs automatically would add value, and would be well worth it. So if a proposed solution only works for PRs, then that seems fine to me.