Commit c08c71be authored by Anthony Polito's avatar Anthony Polito Committed by LUCI CQ

don't let 'anyone' be a reviewer

Bug: 1120999
Change-Id: I8190a9d37f8dfcb59d9d51966fc67719592c2c8a
R=sokcevic@google.com
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2378453Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Anthony Polito <apolito@google.com>
parent 8cdf0528
......@@ -82,6 +82,9 @@ BASIC_EMAIL_REGEXP = r'^[\w\-\+\%\.]+\@[\w\-\+\%\.]+$'
# pathname.
GLOBAL_STATUS = '*'
# Returned if there is no owner and anyone +1
ANYONE='<anyone>'
def _assert_is_collection(obj):
assert not isinstance(obj, str)
......@@ -184,7 +187,7 @@ class Database(object):
if len(suggested_owners) > 1:
suggested_owners.remove(EVERYONE)
else:
suggested_owners = set(['<anyone>'])
suggested_owners = set([ANYONE])
return suggested_owners
def files_not_covered_by(self, files, reviewers):
......
......@@ -126,7 +126,9 @@ def UploadCl(refactor_branch, refactor_branch_upstream, directory, files,
git.run('commit', '-F', tmp_file)
# Upload a CL.
upload_args = ['-f', '-r', ','.join(reviewers)]
upload_args = ['-f']
if reviewers:
upload_args.extend(['-r', ','.join(reviewers)])
if cq_dry_run:
upload_args.append('--cq-dry-run')
if not comment:
......@@ -245,7 +247,7 @@ def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
directory = directory.replace(os.path.sep, '/')
file_paths = [f for _, f in files]
reviewers = owners_database.reviewers_for(file_paths, author)
reviewers.discard(owners.ANYONE)
if dry_run:
PrintClInfo(cl_index, num_cls, directory, file_paths, description,
reviewers)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment