DPDK CI discussions
 help / color / mirror / Atom feed
From: ohilyard@iol.unh.edu
To: ci@dpdk.org, alialnu@nvidia.com
Cc: Owen Hilyard <ohilyard@iol.unh.edu>
Subject: [PATCH v4 4/4] pw_maintainers_cli: fix crash caused by empty diff
Date: Mon,  7 Feb 2022 09:19:43 -0500
Message-ID: <20220207141943.11673-4-ohilyard@iol.unh.edu> (raw)
In-Reply-To: <20220207141943.11673-1-ohilyard@iol.unh.edu>

From: Owen Hilyard <ohilyard@iol.unh.edu>

A sanity check has been added to find_filenames. Occasionally, due to
how the community lab internally handles getting patches from
patchworks, a patch will result in no diff. This patch adds handling for
this case.

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
---
 tools/pw_maintainers_cli.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
index 0705eee..975b62b 100755
--- a/tools/pw_maintainers_cli.py
+++ b/tools/pw_maintainers_cli.py
@@ -124,6 +124,11 @@ class Diff(object):
             - Moved _filename_re into the method.
             - Reduced newlines.
         """
+        # sanity check diff
+        # for patches without any diff, it will try to run diff.replace
+        # while diff is None. just return an empty list
+        if diff is None:
+            return []
         _filename_re = re.compile(r'^(---|\+\+\+) (\S+)')
         # normalise spaces
         diff = diff.replace('\r', '')
-- 
2.30.2


  parent reply	other threads:[~2022-02-07 14:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 14:00 [dpdk-ci] [PATCH v2 1/4] create_new_execution_file_from_tags: change tag argument ohilyard
2021-10-13 14:00 ` [dpdk-ci] [PATCH v2 2/4] create_new_execution_file_from_tags: add test argument ohilyard
2021-10-13 14:00 ` [dpdk-ci] [PATCH v2 3/4] guess_git_tree: module doc comment moved ohilyard
2021-10-13 14:00 ` [dpdk-ci] [PATCH v2 4/4] guess_git_tree: fix crash caused by empty diff ohilyard
2022-01-24 11:22 ` [PATCH v2 1/4] create_new_execution_file_from_tags: change tag argument Ali Alnubani
2022-02-01 21:35   ` [PATCH v3 " ohilyard
2022-02-03 13:14     ` Ali Alnubani
2022-02-07 14:19       ` [PATCH v4 " ohilyard
2022-02-07 14:19         ` [PATCH v4 2/4] create_new_execution_file_from_tags: add test argument ohilyard
2022-02-07 14:19         ` [PATCH v4 3/4] pw_maintainers_cli: move module doc comment ohilyard
2022-02-07 14:19         ` ohilyard [this message]
2022-02-07 14:20         ` [PATCH v4 1/4] create_new_execution_file_from_tags: change tag argument Owen Hilyard
2022-02-07 15:08           ` [PATCH v5 1/3] " ohilyard
2022-02-07 15:08             ` [PATCH v5 2/3] pw_maintainers_cli: move module doc comment ohilyard
2022-02-07 15:56               ` Ali Alnubani
2022-02-07 15:08             ` [PATCH v5 3/3] pw_maintainers_cli: fix crash caused by empty diff ohilyard
2022-02-07 15:56               ` Ali Alnubani
2022-02-07 15:56             ` [PATCH v5 1/3] create_new_execution_file_from_tags: change tag argument Ali Alnubani
2022-02-01 21:35   ` [PATCH v3 2/4] create_new_execution_file_from_tags: add test argument ohilyard
2022-02-01 21:35   ` [PATCH v3 3/4] pw_maintainers_cli: module doc comment moved ohilyard
2022-02-03 13:14     ` Ali Alnubani
2022-02-01 21:35   ` [PATCH v3 4/4] guess_git_tree: fix crash caused by empty diff ohilyard
2022-02-03 13:14     ` Ali Alnubani

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=20220207141943.11673-4-ohilyard@iol.unh.edu \
    --to=ohilyard@iol.unh.edu \
    --cc=alialnu@nvidia.com \
    --cc=ci@dpdk.org \
    /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

DPDK CI discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/ci/0 ci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ci ci/ http://inbox.dpdk.org/ci \
		ci@dpdk.org
	public-inbox-index ci

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.ci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git