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

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