rust-lang / triagebot

Automation/tooling for Rust spaces
https://triage.rust-lang.org
Apache License 2.0
170 stars 75 forks source link

Manage labels in triagebot.toml #1681

Open weihanglo opened 1 year ago

weihanglo commented 1 year ago

What

Would like to define labels in triagebot.toml and make them in sync with GitHub. Maybe sync them from triagebot.toml but not the other way around.

From: https://github.com/rust-lang/cargo/pull/11679#issuecomment-1416699208

How

Given an autolabel table:

[autolabel."A-dependency-resolution"]
description = "Area: dependency resolution and the resolver"
color = "fbca04"
trigger_files = [
  "benches/benchsuite/benches/resolve.rs",
  "crates/resolver-tests/",
  "src/cargo/core/resolver/",
]

triagebot will try to create or update that label when triagebot.toml gets updates.

weihanglo commented 1 year ago

I could help the work if this feature is accepted. Thank you :)

apiraino commented 1 year ago

just to be sure I understand: this feature request is aiming at embedding into the triagebot a logic to read a list of fixed rules (such as these) from its config file in order to autolabel issues or pull requests. Changing the triagebot.toml (and restarting the bot) will apply a different set of rules to new issues/PRs thereafter. Am I reading correctly the proposal?

I can see (-ish) the point of centralizing this into the triagebot, but my instinct is that the right place for these 110 lines of configuration should be a config file. Also I'm a bit afraid of the maintenaince chore. Labelling rules change over time, moving this into the triagebot will make cargo depend on the triagebot maintainers to approve changes? How can the triagebot understand to apply autolabelling only to rust-lang/cargo and not other rust-lang/* projects?

The part about syncing labels with Github is slightly unclear to me, I don't understand the direction of the workflow. Is the triagebot supposed to update Github labels or viceversa?

Second thought (more about the implementation): how, when and how often would these labels be synced with github? where would the triagebot store these rules?

Mark-Simulacrum commented 1 year ago

I don't think creation of labels needs to be part of auto label (you might want a label but not automate tagging PRs with it).

I think the label definitions would live per repository (triagebot.toml already lives in each repository), so this seems quite reasonable - not sure I follow discussion around cargo.

weihanglo commented 1 year ago

Am I reading correctly the proposal?

I am not sure if we are on the same page. Autolabeling is already a thing. What I request here is an extension of autolabels feature: "If triagebot notices there is a [autolabel."<label-name>"], create a label if not exists, or update it."

@Mark-Simulacrum, do you suggest a new table for the defining labels? I am a bit afraid of those definitions becoming duplicated.

Mark-Simulacrum commented 1 year ago

Yes, a separate table makes sense to me. I'm not very worried about duplication, the two sections can be side by side.

apiraino commented 1 year ago

sorry I clearly had not enough context to express an opinion. Thanks for clarifying.