DPDK CI discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
	Aaron Conole <aconole@redhat.com>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"alialnu@nvidia.com" <alialnu@nvidia.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"ci@dpdk.org" <ci@dpdk.org>
Subject: RE: [EXT] Re: [PATCH v2] pw_maintainers_cli: enhance ci tree selection
Date: Thu, 7 Dec 2023 13:33:58 +0000	[thread overview]
Message-ID: <PH0PR18MB4086430C5372F361DE991D0FDE8BA@PH0PR18MB4086.namprd18.prod.outlook.com> (raw)
In-Reply-To: <PH0PR18MB4086D217A464FC3948CDD67BDED2A@PH0PR18MB4086.namprd18.prod.outlook.com>



> -----Original Message-----
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Sent: Friday, October 13, 2023 11:25 AM
> To: Aaron Conole <aconole@redhat.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; alialnu@nvidia.com;
> thomas@monjalon.net; david.marchand@redhat.com; ci@dpdk.org
> Subject: RE: [EXT] Re: [PATCH v2] pw_maintainers_cli: enhance ci tree
> selection
> 
> > > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > >
> > > When longest prefix match doesnt find a suitable tree, remove the
> > > trees of files belonging to 'drivers/common' and check if there
> > > is any unique tree for the patchset.
> > >
> > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > > ---
> > >  v2 Chnages:
> > >  - Find tree by removing 'drivers/common' instead of count based
> > >  approach.
> > >
> > >  tools/pw_maintainers_cli.py | 31 ++++++++++++++++++++++++++-----
> > >  1 file changed, 26 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
> > > index c7b5ba0..ef60df8 100755
> > > --- a/tools/pw_maintainers_cli.py
> > > +++ b/tools/pw_maintainers_cli.py
> > > @@ -203,13 +203,15 @@ class Maintainers(object):
> > >          """
> > >          Return a git tree that matches a list of files."""
> > >          tree_list = []
> > > +        file_tree_map = {}
> > >          for _file in files:
> > >              _tree = self._get_tree(_file)
> > >              # Having no tree means that we accept those changes going
> through
> > a
> > >              # subtree (e.g. release notes).
> > >              if _tree:
> > >                  tree_list.append(_tree)
> > > -        tree = self.get_common_denominator(tree_list)
> > > +                file_tree_map[_file] = _tree
> > > +        tree = self.get_common_denominator(tree_list, file_tree_map)
> > >          if not tree:
> > >              tree = 'git://dpdk.org/dpdk'
> > >          return tree
> > > @@ -268,7 +270,7 @@ class Maintainers(object):
> > >          self.matched[matching_pattern] = tree
> > >          return tree
> > >
> > > -    def get_common_denominator(self, tree_list):
> > > +    def get_common_denominator(self, tree_list, file_tree_map):
> > >          """Finds a common tree by finding the longest common prefix.
> > >          Examples for expected output:
> > >            dpdk-next-virtio + dpdk = dpdk
> > > @@ -278,7 +280,6 @@ class Maintainers(object):
> > >          """
> > >          # Make sure the list is unique.
> > >          tree_list = list(set(tree_list))
> > > -
> > >          # Rename dpdk-next-virtio internally to match dpdk-next-net
> > >          _tree_list = [
> > >                  tree.replace('dpdk-next-virtio', 'dpdk-next-net-virtio')
> >
> > Any reason why this whitespace is dropped here?  Otherwise, the patch
> > looks okay - but I don't think this line should be dropped.
> 
> The new line removal can be ignored.
> 
> >
> > If you agree, I can correct when I merge it.
> >
> 
> Yes, please.
> 

Ping

> Thanks,
> Pavan.
> 
> > > @@ -286,11 +287,31 @@ class Maintainers(object):
> > >          common_prefix = \
> > >              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('/'):
> > > +        # There is no 'dpdk-next' named tree, remove files that belong
> > > +        # to 'drivers/common' and see if we find a tree.
> > > +        if common_prefix.endswith('dpdk-next'):
> > > +            common_prefix = self.get_filtered_tree(file_tree_map)
> > > +        elif common_prefix.endswith('/'):
> > >              common_prefix = 'git://dpdk.org/dpdk'
> > >          return common_prefix
> > >
> > > +    def get_common_files(self, files):
> > > +        match_list = []
> > > +        for f in files:
> > > +            if re.match(r"drivers\/common", f) is not None:
> > > +                match_list.append(f)
> > > +        return match_list
> > > +
> > > +    def get_filtered_tree(self, file_tree_map):
> > > +        # Get list of files that are in 'drivers/common'
> > > +        common_list = self.get_common_files(file_tree_map.keys())
> > > +        for c in common_list:
> > > +            file_tree_map.pop(c, None)
> > > +        tree_list = list(set(file_tree_map.values()))
> > > +        if len(tree_list) == 1:
> > > +            return tree_list[0]
> > > +        return None
> > > +
> > >
> > >  if __name__ == '__main__':
> > >      """Main procedure."""
> > > --
> > > 2.25.1


  reply	other threads:[~2023-12-07 13:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  8:34 [PATCH] pw_maintainers_cli: enhance " pbhagavatula
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 [this message]
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=PH0PR18MB4086430C5372F361DE991D0FDE8BA@PH0PR18MB4086.namprd18.prod.outlook.com \
    --to=pbhagavatula@marvell.com \
    --cc=aconole@redhat.com \
    --cc=alialnu@nvidia.com \
    --cc=ci@dpdk.org \
    --cc=david.marchand@redhat.com \
    --cc=jerinj@marvell.com \
    --cc=thomas@monjalon.net \
    /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).