DPDK CI discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, <alialnu@nvidia.com>, <aconole@redhat.com>
Cc: <ci@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [PATCH] pw_maintainers_cli: enhance tree selection
Date: Fri, 29 Sep 2023 14:04:43 +0530	[thread overview]
Message-ID: <20230929083443.9925-1-pbhagavatula@marvell.com> (raw)

From: Pavan Nikhilesh <pbhagavatula@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.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@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


             reply	other threads:[~2023-09-29  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  8:34 pbhagavatula [this message]
2023-09-29  9:21 ` Pavan Nikhilesh Bhagavatula
2023-09-29  9:40   ` David Marchand
2023-09-29 10:16     ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-09-29 10:21   ` Thomas Monjalon
2023-09-29 10:54     ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-09-29 11:09       ` Thomas Monjalon
2023-09-29 11:13         ` Jerin Jacob Kollanukkaran
2023-09-29 13:17 ` [PATCH v2] pw_maintainers_cli: enhance ci " pbhagavatula
2023-10-12 12:59   ` Aaron Conole
2023-10-13  5:55     ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-12-07 13:33       ` Pavan Nikhilesh Bhagavatula
2023-12-07 13:44         ` Aaron Conole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230929083443.9925-1-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=aconole@redhat.com \
    --cc=alialnu@nvidia.com \
    --cc=ci@dpdk.org \
    --cc=jerinj@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).