From e342fb16f98530bc8efd0abfedc5986a2c58478c Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Fri, 5 Feb 2021 00:35:54 +0000 Subject: [PATCH] Don't suggest change author as reviewer. Change-Id: Ie34fc34883b2c86fc134f10ded24b26a631886ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2676835 Reviewed-by: Josip Sokcevic Commit-Queue: Edward Lesmes --- git_cl.py | 5 +++-- presubmit_canned_checks.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/git_cl.py b/git_cl.py index efcf429c2..0369f16fc 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1382,7 +1382,7 @@ class Changelist(object): f for f in files if status[f] == owners_client.OwnersClient.INSUFFICIENT_REVIEWERS ] - owners = client.SuggestOwners(missing_files) + owners = client.SuggestOwners(missing_files, exclude=[self.GetAuthor()]) if options.add_owners_to == 'TBR': assert isinstance(options.tbrs, list), options.tbrs options.tbrs.extend(owners) @@ -4806,7 +4806,8 @@ def CMDowners(parser, args): if options.batch: client = owners_client.DepotToolsClient(root, base_branch) - print('\n'.join(client.SuggestOwners(affected_files))) + print('\n'.join( + client.SuggestOwners(affected_files, exclude=[cl.GetAuthor()]))) return 0 owner_files = [f for f in affected_files if 'OWNERS' in os.path.basename(f)] diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index bda8cc716..b5db7ca0d 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1182,7 +1182,8 @@ def CheckOwners( if tbr and affects_owners: output_list.append(output_fn('TBR for OWNERS files are ignored.')) if not input_api.is_committing: - suggested_owners = input_api.owners_client.SuggestOwners(missing_files) + suggested_owners = input_api.owners_client.SuggestOwners( + missing_files, exclude=[owner_email]) output_list.append(output_fn('Suggested OWNERS: ' + '(Use "git-cl owners" to interactively select owners.)\n %s' % ('\n '.join(suggested_owners))))