RFR: 2591: Improve auto labeler
Zhao Song
zsong at openjdk.org
Tue Sep 23 17:59:30 UTC 2025
On Tue, 23 Sep 2025 17:48:16 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> After [SKARA-2588](https://bugs.openjdk.org/browse/SKARA-2588) is deployed, users are complaining about the behavior of auto labeler.
>>
>> After discussion with Erik, we propose the following behavior for the auto labeler:
>> 1. The auto labeler will never remove labels that have already been added.
>> 2. The only case in which the auto labeler upgrades labels to group labels is when it detects a bunch of new labels to add. In this case, it will attempt to update the labels to group labels.
>> 3. Users can add any labels they want.
>>
>> Example:
>> 1. In the initial labeling, the auto labeler adds “hotspot-runtime” to the PR.
>> (Current labels: “hotspot-runtime”)
>> 2. The user pushes three commits that touch “hotspot-gc” and “hotspot-jfr”. The auto labeler upgrades these to the group label “hotspot” and adds it to the PR.
>> (Current labels: “hotspot-runtime”, “hotspot”)
>> 3. Later, the user pushes a new commit touches only “hotspot-gc”. The auto labeler will not add “hotspot-gc” to the PR since “hotspot” label is already there.
>> (Current labels: “hotspot-runtime”, “hotspot”)
>
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/LabelerWorkItem.java line 160:
>
>> 158: newLabels.add(label);
>> 159: }
>> 160: }
>
> I think this check needs to be applied on the initial run of the auto labeler as well. The user may have manually added labels already (which previously would disable the auto labeler), but now since we run it anyway, I think it needs to check for existing group labels.
>
> I also think we are missing the case when an existing label would pair up with a new label to match a group. Then the new label should be upgraded to the group.
Yes, you're right. I need to add the check for initial run as well.
> I also think we are missing the case when an existing label would pair up with a new label to match a group. Then the new label should be upgraded to the group.
In this case, do you mean we just add the group label and keep the old labels?
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1741#discussion_r2373073642
More information about the skara-dev
mailing list