DPDK CI discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers
@ 2022-04-15 10:16 Ali Alnubani
  2022-04-15 10:16 ` [PATCH 2/2] pw_maintainers_cli: write errors to stderr Ali Alnubani
  2022-04-25 17:18 ` [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Aaron Conole
  0 siblings, 2 replies; 6+ messages in thread
From: Ali Alnubani @ 2022-04-15 10:16 UTC (permalink / raw)
  To: ci; +Cc: David Marchand

Instead of skipping patch delegation when there are no Patchwork
users associated with the email of the first maintainer, try to
delegate to other tree maintainers.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
---
 tools/pw_maintainers_cli.py | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
index fd69081..ad51e3d 100755
--- a/tools/pw_maintainers_cli.py
+++ b/tools/pw_maintainers_cli.py
@@ -112,6 +112,7 @@ class GitPW(object):
                 patch['id'], users[0]['email']))
             _ = api.update(
                     'patches', patch['id'], [('delegate', users[0]['id'])])
+        return users[0].get('email')
 
 
 class Diff(object):
@@ -366,16 +367,18 @@ if __name__ == '__main__':
             print(*maintainer_list, sep='\n')
         elif command == 'set-pw-delegate':
             if len(maintainer_list) > 0:
-                # Get the email of the first maintainer in the list.
-                try:
-                    delegate = re.match(
-                            r".*\<(?P<email>.*)\>",
-                            maintainer_list[0]).group('email')
-                except AttributeError:
-                    print("Unexpected format: '{}'".format(maintainer_list[0]))
-                    sys.exit(1)
-                _git_pw.set_delegate(
-                        patch_list, delegate,
-                        skip_delegated=skip_delegated)
+                for maintainer in maintainer_list:
+                    # Get the maintainer's email
+                    try:
+                        maintainer_email = re.match(
+                                r".*\<(?P<email>.*)\>",
+                                maintainer).group('email')
+                    except AttributeError:
+                        print("Unexpected format: '{}'".format(maintainer))
+                    delegate = _git_pw.set_delegate(
+                            patch_list, maintainer_email,
+                            skip_delegated=skip_delegated)
+                    if delegate != None:
+                        break
             else:
                 print('No maintainers found. Not setting a delegate.')
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] pw_maintainers_cli: write errors to stderr
  2022-04-15 10:16 [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Ali Alnubani
@ 2022-04-15 10:16 ` Ali Alnubani
  2022-04-25 17:18   ` Aaron Conole
  2022-04-25 17:18 ` [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Aaron Conole
  1 sibling, 1 reply; 6+ messages in thread
From: Ali Alnubani @ 2022-04-15 10:16 UTC (permalink / raw)
  To: ci

Redirect error messages to stderr instead of stdout and
reword 2 of them.

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
---
 tools/pw_maintainers_cli.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
index ad51e3d..a1d7d8e 100755
--- a/tools/pw_maintainers_cli.py
+++ b/tools/pw_maintainers_cli.py
@@ -56,7 +56,7 @@ Or if you want to use inside other scripts:
 
 MAINTAINERS_FILE_PATH = os.environ.get('MAINTAINERS_FILE_PATH')
 if not MAINTAINERS_FILE_PATH:
-    print('MAINTAINERS_FILE_PATH is not set.')
+    print('MAINTAINERS_FILE_PATH is not set.', file=sys.stderr)
     sys.exit(1)
 
 
@@ -70,8 +70,7 @@ class GitPW(object):
         for key in conf_keys:
             value = conf_obj.get('pw_{}'.format(key))
             if not value:
-                print('--pw_{} is a required git-pw configuration'.format(key))
-                sys.exit(1)
+                sys.exit('--pw_{} is a required git-pw configuration'.format(key))
             else:
                 setattr(self.CONF, key, value)
 
@@ -97,8 +96,8 @@ class GitPW(object):
         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))
+            print('Cannot choose a Patchwork user associated with {} to '
+                  'delegate to.'.format(delegate, users), file=sys.stderr)
             return
         for patch in patch_list:
             if patch['delegate'] != None and \
@@ -374,11 +373,13 @@ if __name__ == '__main__':
                                 r".*\<(?P<email>.*)\>",
                                 maintainer).group('email')
                     except AttributeError:
-                        print("Unexpected format: '{}'".format(maintainer))
+                        print("Unexpected format: '{}'".format(maintainer),
+                                file=sys.stderr)
                     delegate = _git_pw.set_delegate(
                             patch_list, maintainer_email,
                             skip_delegated=skip_delegated)
                     if delegate != None:
                         break
             else:
-                print('No maintainers found. Not setting a delegate.')
+                print('No maintainers matched. Not setting a delegate.',
+                        file=sys.stderr)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers
  2022-04-15 10:16 [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Ali Alnubani
  2022-04-15 10:16 ` [PATCH 2/2] pw_maintainers_cli: write errors to stderr Ali Alnubani
@ 2022-04-25 17:18 ` Aaron Conole
  2022-05-02 16:47   ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Aaron Conole @ 2022-04-25 17:18 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: ci, David Marchand

Ali Alnubani <alialnu@nvidia.com> writes:

> Instead of skipping patch delegation when there are no Patchwork
> users associated with the email of the first maintainer, try to
> delegate to other tree maintainers.
>
> Suggested-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] pw_maintainers_cli: write errors to stderr
  2022-04-15 10:16 ` [PATCH 2/2] pw_maintainers_cli: write errors to stderr Ali Alnubani
@ 2022-04-25 17:18   ` Aaron Conole
  2022-04-26  9:28     ` Ali Alnubani
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Conole @ 2022-04-25 17:18 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: ci

Ali Alnubani <alialnu@nvidia.com> writes:

> Redirect error messages to stderr instead of stdout and
> reword 2 of them.
>
> Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> ---

I don't see how this is related to previous patch, but it makes sense,
so:

Acked-by: Aaron Conole <aconole@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 2/2] pw_maintainers_cli: write errors to stderr
  2022-04-25 17:18   ` Aaron Conole
@ 2022-04-26  9:28     ` Ali Alnubani
  0 siblings, 0 replies; 6+ messages in thread
From: Ali Alnubani @ 2022-04-26  9:28 UTC (permalink / raw)
  To: Aaron Conole; +Cc: ci

> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Monday, April 25, 2022 8:19 PM
> To: Ali Alnubani <alialnu@nvidia.com>
> Cc: ci@dpdk.org
> Subject: Re: [PATCH 2/2] pw_maintainers_cli: write errors to stderr
> 
> Ali Alnubani <alialnu@nvidia.com> writes:
> 
> > Redirect error messages to stderr instead of stdout and
> > reword 2 of them.
> >
> > Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> > ---
> 
> I don't see how this is related to previous patch, but it makes sense,
> so:
> 
> Acked-by: Aaron Conole <aconole@redhat.com>

They aren't related, I should have sent them unnumbered.

Thanks,
Ali

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers
  2022-04-25 17:18 ` [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Aaron Conole
@ 2022-05-02 16:47   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2022-05-02 16:47 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: ci, David Marchand, Aaron Conole

> > Instead of skipping patch delegation when there are no Patchwork
> > users associated with the email of the first maintainer, try to
> > delegate to other tree maintainers.
> >
> > Suggested-by: David Marchand <david.marchand@redhat.com>
> > Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> 
> Acked-by: Aaron Conole <aconole@redhat.com>

Series applied, thanks.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-02 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 10:16 [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Ali Alnubani
2022-04-15 10:16 ` [PATCH 2/2] pw_maintainers_cli: write errors to stderr Ali Alnubani
2022-04-25 17:18   ` Aaron Conole
2022-04-26  9:28     ` Ali Alnubani
2022-04-25 17:18 ` [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Aaron Conole
2022-05-02 16:47   ` Thomas Monjalon

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).