Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add automatic labeling of PR types from package lists #1884

Closed
slava77 opened this issue Nov 17, 2022 · 12 comments · Fixed by #1914
Closed

add automatic labeling of PR types from package lists #1884

slava77 opened this issue Nov 17, 2022 · 12 comments · Fixed by #1914

Comments

@slava77
Copy link
Contributor

slava77 commented Nov 17, 2022

to simplify searching/monitoring a list of relevant PRs, I'd like to introduce possibility to add lists of packages which, if modified in a PR will trigger a label for the PR.
This is instead of manual type xyz.

Opt-in strategy is probably OK.
This can start with a map file connecting type label with a list of packages.
Relevant @cms-sw/xyz-{pog,dpg}-l2 would then be able to propose or signoff (if someone else decides to propose) on the acceptable lists.

@cmsbuild
Copy link
Contributor

A new Issue was created by @slava77 Slava Krutelyov.

@Dr15Jones, @perrotta, @dpiparo, @rappoccio, @makortel, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@smuzaffar
Copy link
Contributor

@slava77 , so basically we extend https://github.com/cms-sw/cms-bot/blob/master/categories_map.py and add also a mapping for labels/packages e.g. something like [a]? And I guess the label in categories_map.py should have a matching pog|dpg entry in https://github.com/cms-sw/cms-bot/blob/master/categories.py ... right?

[a]

CMSSW_LABELS = {
  "label": [
    "packages",
  ]
}

@slava77
Copy link
Contributor Author

slava77 commented Nov 25, 2022

@slava77 , so basically we extend https://github.com/cms-sw/cms-bot/blob/master/categories_map.py and add also a mapping for labels/packages e.g. something like [a]? And I guess the label in categories_map.py should have a matching pog|dpg entry in https://github.com/cms-sw/cms-bot/blob/master/categories.py ... right?

[a]

CMSSW_LABELS = {
  "label": [
    "packages",
  ]
}

not exactly, or at least not at the level it's done in categories_map/categories py files.
I'm asking for a non-blocking label, while the examples you take are for blocking labels (e.g. reconstruction-pending).

As an example for tracking, I'd like to see for PRs touching packages in e.g. RecoTracking to be labeled with tracking (the same that I get now with type tracking). This is to simplify monitoring the relevant list of PRs. I would still rather have the blocking signatures like assign tracking-pog to remain manual.

The syntax can indeed be similar to what you quoted. One wish item, even for the current categories_map.py file is to accept wildcards or matching based on subsystem alone (not a full subsystem/package name).

@smuzaffar
Copy link
Contributor

Blocking labels are defined via CMSSW_CATEGORIES (https://github.com/cms-sw/cms-bot/blob/master/categories_map.py#L1 ) . I have suggested to add new CMSSW_LABELS to keep track of these non-blocking labels. We can add it in to a different file but I suggest to keep it in categories_map.py so that one just need to update single file for cmssw packages.

One wish item, even for the current categories_map.py file is to accept wildcards or matching based on subsystem alone (not a full subsystem/package name)

though doable but not allowing the wildcard helps bot finding out new packages. It has helped in past to avoid creation of new packages and including the changes in existing packages :-) So I would like to keep it as it is

@slava77
Copy link
Contributor Author

slava77 commented Nov 25, 2022

Blocking labels are defined via CMSSW_CATEGORIES (https://github.com/cms-sw/cms-bot/blob/master/categories_map.py#L1 ) . I have suggested to add new CMSSW_LABELS to keep track of these non-blocking labels. We can add it in to a different file but I suggest to keep it in categories_map.py so that one just need to update single file for cmssw packages.

CMSSW_LABELS sounds good.

One wish item, even for the current categories_map.py file is to accept wildcards or matching based on subsystem alone (not a full subsystem/package name)

though doable but not allowing the wildcard helps bot finding out new packages. It has helped in past to avoid creation of new packages and including the changes in existing packages :-) So I would like to keep it as it is

Good point, but still this seems more appropriate for blocking labels.
Would it be possible to have wildcards for non-blocking labels?

@smuzaffar
Copy link
Contributor

Would it be possible to have wildcards for non-blocking labels?

yes we can support that for non-blocking labels.

@smuzaffar
Copy link
Contributor

@slava77 , #1914 should allow to create a mapping for dpg/pog non-blocking labels and cmssw packages. As this code runs for every change on pull request (comment/update of pr/change of label etc.), so instead of supporting regexp, it matches only the start of package name e.g. SubsystemX should match SubsystemX* and SubsystemX/Package should match all SubsystemX/Package* packages.

@slava77
Copy link
Contributor Author

slava77 commented Jan 19, 2023

As a follow up to #1916 we also expect a functionality to label a PR based on file name (regexp, possibly).
Should this be reopened or is it worth to make a new issue?

@smuzaffar smuzaffar reopened this Jan 19, 2023
@smuzaffar
Copy link
Contributor

@slava77 , I am updating bot to allow file name level match. I will alos add regexp support

@slava77
Copy link
Contributor Author

slava77 commented Jan 19, 2023

just to be sure, will this labeling be an OR with the manual labeling?

I'm thinking specifically of when in a change 1 in cms-bot repo a package matches the label and then in a later change 2 it does not.
In absence of a manual labeling I'd expect that the label will be removed after change 2,
while with manual labeling I'd expect that the label will stay all the time.
Is that the case?

@smuzaffar
Copy link
Contributor

just to be sure, will this labeling be an OR with the manual labeling?

yes , you get union of automatic and manual labels. Bot will first calculate the automatic labels and then add/remove any manual labels. you should be able to comment type -label to remove an automatic label.

@smuzaffar
Copy link
Contributor

closing it as this has been complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants