From 9b2d982b912f93a042eb4c4ffff6165a9f6f3b20 Mon Sep 17 00:00:00 2001 From: smileknife Date: Sun, 7 Feb 2021 11:20:37 +0800 Subject: [PATCH 1/2] [review_tool]support file name contain whitespace characters Signed-off-by: smileknife --- advisors/review_tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advisors/review_tool.py b/advisors/review_tool.py index 4d36c259..dccb2703 100755 --- a/advisors/review_tool.py +++ b/advisors/review_tool.py @@ -361,7 +361,7 @@ def check_maintainer_changes(): sigs = {} lst_files = subprocess.getoutput("git diff --name-status remotes/origin/master..") for line in lst_files.splitlines(): - status, item = line.split() + status, item = line.split(maxsplit=1) if status != "M": continue if item.startswith("sig/") and item.endswith("/OWNERS"): @@ -383,7 +383,7 @@ def check_sig_information_changes(): sigs = {} lst_files = subprocess.getoutput("git diff --name-status remotes/origin/master..") for line in lst_files.splitlines(): - status, item = line.split() + status, item = line.split(maxsplit=1) if status != "M": continue if item == "sig/sigs.yaml": -- Gitee From 22ebb488b9284b046eb7628b8c24b7d500850a3b Mon Sep 17 00:00:00 2001 From: smileknife Date: Sun, 7 Feb 2021 17:20:01 +0800 Subject: [PATCH 2/2] prow_review_tool:only process source update event Signed-off-by: smileknife --- prow/prow_review_tool | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prow/prow_review_tool b/prow/prow_review_tool index e2a25d0d..53344087 100755 --- a/prow/prow_review_tool +++ b/prow/prow_review_tool @@ -52,8 +52,8 @@ if __name__ == '__main__': return_code = 0 if args.payload: data = json.loads(args.payload) - if args.event == 'Merge Request Hook' and data['action'] == 'open' \ - or data['action'] == 'update': + if args.event == 'Merge Request Hook' and data['action'] == 'open'\ + or (data['action'] == 'update' and data['action_desc'] == "source_branch_changed"): subp = subprocess.run(["python3", get_cmd(), "-u", data['pull_request']['html_url'], "-w", "/tmp/review_dir", "-c"], stdout=subprocess.PIPE, @@ -77,7 +77,7 @@ if __name__ == '__main__': check=False) return_code = subp.returncode else: - print("Event type: %s not support." % args.event) + print("prow_review_tool: this action type not need to process.") if return_code != 0: print(subp.stdout) sys.exit(return_code) -- Gitee