[PATCH] pw_maintainers_cli: enhance tree selection
Pavan Nikhilesh Bhagavatula
pbhagavatula at marvell.com
Fri Sep 29 11:21:16 CEST 2023
> -----Original Message-----
> From: pbhagavatula at marvell.com <pbhagavatula at marvell.com>
> Sent: Friday, September 29, 2023 2:05 PM
> To: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; alialnu at nvidia.com;
> aconole at redhat.com
> Cc: ci at dpdk.org; Pavan Nikhilesh Bhagavatula <pbhagavatula at marvell.com>
> Subject: [PATCH] pw_maintainers_cli: enhance tree selection
>
> From: Pavan Nikhilesh <pbhagavatula at marvell.com>
>
> When longest prefix match doesnt find a suitable tree, pick the
> tree which has the highest modified file count instead of defauting
> to main tree.
>
This change is need to find the correct branch when a patch has a specification
Change followed by a implementation of driver layer example:
https://patches.dpdk.org/project/dpdk/list/?series=29675
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
> ---
> tools/pw_maintainers_cli.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
> index c7b5ba0..4aa46ae 100755
> --- a/tools/pw_maintainers_cli.py
> +++ b/tools/pw_maintainers_cli.py
> @@ -46,6 +46,7 @@ import re
> import argparse
> import fnmatch
>
> +from collections import Counter
> from requests.exceptions import HTTPError
>
> from git_pw import config
> @@ -276,6 +277,7 @@ class Maintainers(object):
> dpdk-next-crypto + dpdk-next-virtio = dpdk
> dpdk-next-net-intel + dpdk-next-net-mlx = dpdk-next-net
> """
> + highest_tree = Counter(tree_list).most_common(1)[0][0]
> # Make sure the list is unique.
> tree_list = list(set(tree_list))
>
> @@ -287,7 +289,9 @@ class Maintainers(object):
> os.path.commonprefix(_tree_list).rstrip('-').replace(
> 'dpdk-next-net-virtio', 'dpdk-next-virtio')
> # There is no 'dpdk-next' named tree.
> - if common_prefix.endswith('dpdk-next') or
> common_prefix.endswith('/'):
> + if common_prefix.endswith('dpdk-next'):
> + common_prefix = highest_tree
> + elif common_prefix.endswith('/'):
> common_prefix = 'git://dpdk.org/dpdk'
> return common_prefix
>
> --
> 2.25.1
More information about the ci
mailing list