[dpdk-ci] [PATCH v2 05/10] tools: add functionality for setting pw delegates
Thomas Monjalon
thomas at monjalon.net
Thu Sep 30 11:15:29 CEST 2021
21/09/2021 16:35, alialnu at nvidia.com:
> From: Ali Alnubani <alialnu at nvidia.com>
>
> A new command was added to set patch delegates in Patchwork
> based on the emails found in DPDK's MAINTAINERS file.
>
> Example usage:
> $ export MAINTAINERS_FILE_PATH=/path/to/dpdk/MAINTAINERS
> $ ./pw_maintainers_cli.py --type series set_pw_delegate SERIES_ID
>
> Signed-off-by: Ali Alnubani <alialnu at nvidia.com>
> ---
> + def set_delegate(self, patch_list, delegate):
> + """Set the delegate for a patch.
> + Only tries to set a delegate for patches that don't have
> + one set already.
I'm not sure we should skip patches which are already delegated.
If we use the command to explicitly delegate the patch,
we should do it, right?
The skip logic may be implemented at a higher level in the CI.
> + Reference:
> + https://github.com/getpatchwork/git-pw/blob/76b79097dc0a57c89b45dd53d9cacb7ff7b31bb2/git_pw/patch.py#L167
> + """
> + users = api.index('users', [('q', delegate)])
> + if len(users) != 1:
> + # Zero or multiple users found
> + print('Cannot choose a Patchwork user to delegate to from '
> + 'user list ({}). Skipping..'.format(users))
> + return
> + for patch in patch_list:
> + if patch['delegate']:
> + print('Patch {} is already delegated to {}. '
> + 'Skipping..'.format(
> + patch['id'], patch['delegate']['email']))
> + continue
> + print("Delegating patch {} to {}.".format(
> + patch['id'], users[0]['email']))
> + _ = api.update(
> + 'patches', patch['id'], [('delegate', users[0]['id'])])
More information about the ci
mailing list