Commit Graph

20 Commits

Author SHA1 Message Date
Anas Nashif 913426e585 ci: set_assignee: pick next area when submitter = assignee
Address the cases where submitter is also the maintainer of the code
changed and other areas are being changed. In this case, assign to the
next area maintainers instead of assigning to submitter.

Example: maintainer of component A introduced significant changes to
area A but also makes changes to other areas B and C. Right now
maintainers of B and C are added as reviewers.

This change will assign to the next area after A, i.e. B in cases where the
submitter is also the maintainer of area A.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-10 19:14:17 -04:00
Anas Nashif 1a46b7ed0e ci: assignees: set multiple assignees of same area
Noticing many PRs that wait too long in the queue although once of the
maintainers approved with asignees set to other maintainers.

This changes the current behavior of picking the first maintainer in the
list and assigning to them only, instead we assign to all maintainers of
the main area being changed.

Who ends up driving the PR to a mergeable state is then to the
maintainers and they can unassign/assign based on availability.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-18 14:39:22 -04:00
Martin Jäger c1a3bfb5f4 scripts: set_assignees.py: Use "size: XS" label for one-liners
Previously, one-line changes were tagged as "Trivial".

The description of the "Trivial" label states:
"Changes that can be reviewed by anyone, i.e. doc changes, minor build
system tweaks, etc.".

Just because a change only affects a single line of code, it does not
mean that it is a trivial change. It may have difficult to understand
implications which require approval of the responsible maintainer.

For this reason, change the label to "size: XS" and let humans judge
if a PR is trivial or not.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-06-06 20:06:47 -04:00
Fabio Baltieri fec3cee0bb scripts: set_maintainer: add log messages for skipped collabs
Refactor the skip collaborator logic to add log messages when a
collaborator is skipped because they self removed of not part of the
org.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-04-04 11:14:42 +01:00
Fabio Baltieri 49e8e11a77 scripts: set_maintainer: fix author == maintainer fallback logic
The "Submitter is same as Assignee" is comparing strings to <Area> and
always failing the condition, fix it by dropping the ".name".

Tested with ./scripts/set_assignees.py -v -y -P 67526 (now falls back to
the other maintainer as it should).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-16 14:24:05 -05:00
Anas Nashif 0d7d39d441 scripts: set_maintainer: do not re-add self-removed reviewers
If a collaborator removes themselves from the reviewer list, do not
attempt to re-add them on changes to the PR.

Fixes #67214

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-11 15:46:20 -06:00
Anas Nashif debe7fefe6 ci: assignees: do not set trivial on manifest changes
manifest changes are often a oneliner change, but they are not
necessarily trivial.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-06 12:11:58 -05:00
Anas Nashif d9a300e4ae ci: various set_assignee fixes
Cleanup of script and change how we assign PR in general:

Make sure that when multiple areas are changed, including platform or
driver changes, we set assignee of the general areas and not the
platform maintainers. For example, if I change 100 SoC files and touch
the kernel file, the assignee is set to the kernel maintainer.

First, we should as much possible try and split such changes and not
have common area changes with platform changes at the same time. Second,
it is important that such changes which affect everyone are reviewed and
approved by the maintainer of the general areas rather than leave them
to the platform maintainer.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:10:11 +02:00
Fabio Baltieri cf6bb282e2 scripts: set_assignee: set reviewers for modules
Add support for setting reviewers as well for module PRs, in addition to
the assignees.

Note that this still only works on repositories with an assignee on
record since it does not seem to be possible to query for PRs that have
no reviewers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-27 15:27:19 +02:00
Fabio Baltieri 5e78660715 ci: assigner: fix the main operation selector check
Fix an "if" that should have been an "elif". This is currently causing
the script to fallback into the "do all unassigned PRs of the day" path
when a PR is specified.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-25 15:31:53 +01:00
Fabio Baltieri b6cbcbaa5b ci: assigner: add a function to assign issues
Add a -I option to process an issue and, if it's not assigned already,
add assignees based on the labels, matching the ones set in the
MAINTAINERS file areas.

Suggested-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-25 10:33:06 +02:00
Fabio Baltieri 9a1f4abd59 scripts: set_assignee: add an option to assign module PRs
Add a -m option to set_assignees to have the script find all unassigned
module PRs for areas that have an assignee and set the assignee on those
PRs.

This should help avoiding forgotten PRs on modules. It's implemented as
a search and meant to run periodically, so we don't have to add a
workflow for this on every individual module.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-25 10:33:06 +02:00
Fabio Baltieri 16d723ee1b scripts: set_assignee: don't skip assignment on too many labels
The set assignee script currently exits if there's too many labels
associated with a PR. Change that to just skip the label assignment, but
continue on to assign a maintainer based on the most relevant area.

Tested with:

  ./scripts/set_assignees.py -v --dry-run -P 52716

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-26 14:57:29 -05:00
Jamie McCrae ec7044437e treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 20:12:36 +09:00
Stephanos Ioannidis faf4208295 scripts: set_assignee: Make review requests more deterministic
When there are more than 15 reviewers, the `set_assignee` script was
adding the reviewers more or less on a random basis because the input
set was arbitrarily ordered (thanks to how Python "set" works), and the
attempt to add any reviewers beyond the count of 15 results in the
previoulsy added reviewer being removed.

This commit updates the `set_assignee` script such that:

1. The collaborator list (input for generating the reviewer list) is
   ordered by the area match, such that the collaborators of the most
   relevant area come first.

2. The reviewers of the relevant areas are added first, until the total
   reviewer count is 15. The script does not attempt to add more than
   15 reviewers because that can result in the previously added
   reviewers being removed from the list.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-10-20 23:52:49 +09:00
Fabio Baltieri 279ab43bdd scripts: set_assignees: move misplaced log entry
The log refers to Platform taking precedence but the loop handles
Documentation as well. Move it under the proper section, drop "Drivers"
as that is not handle in any special way.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-10-04 15:14:27 +00:00
Fabio Baltieri d06450b055 scripts: set_assignees: handle the documentation + unmaintained case
The script right now assumes that all the areas have a maintainer and
that the second area in particular has one in case of Documentation,
that results in a ValueError when it's not the case. Handle that by
checking the lists before using them.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-10-04 15:14:27 +00:00
Anas Nashif 6027152408 scripts: set_assignee: handle exceptions
Deal with exceptions that happen when a user does not exist on GH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-18 21:41:22 -04:00
Anas Nashif d63c2c44b5 ci: do not add assignees if already set
If PR already has an assignee, do not add additional assignees to the
PR. Each PR should only have one assignee (in most cases)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-17 11:56:07 -04:00
Anas Nashif 20483161b2 scripts: introduce script to set labels, assignees and reviewers
Use MAINTAINERS.yml file to set lables, assignees and reviewers for
specific PRs or all unassigned PRs since a given date.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-08 22:49:13 +09:00