Commit bce925df authored by dpranke@chromium.org's avatar dpranke@chromium.org

Remove the 'author_counts_as_owner' option from CheckOwners().

Way back in r185294 I added the ability to request that, when
checking owners, the patch author *should not* count (normally it does
count). We did this in order to be able to mimic the review processes
of WebKit in the Blink repo.

However, we ended up never using this feature, so I'm finally getting
around to deleting it.

R=maruel@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/851103004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293685 0039d316-1c4b-4281-b951-d872f2087c98
parent 0ebd029d
......@@ -847,8 +847,7 @@ def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings,
return []
def CheckOwners(input_api, output_api, source_file_filter=None,
author_counts_as_owner=True):
def CheckOwners(input_api, output_api, source_file_filter=None):
if input_api.is_committing:
if input_api.tbr:
return [output_api.PresubmitNotifyResult(
......@@ -873,7 +872,7 @@ def CheckOwners(input_api, output_api, source_file_filter=None,
owner_email = owner_email or input_api.change.author_email
if author_counts_as_owner and owner_email:
if owner_email:
reviewers_plus_owner = set([owner_email]).union(reviewers)
missing_files = owners_db.files_not_covered_by(affected_files,
reviewers_plus_owner)
......
......@@ -2603,7 +2603,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def AssertOwnersWorks(self, tbr=False, issue='1', approvers=None,
reviewers=None, is_committing=True, rietveld_response=None,
uncovered_files=None, expected_output='', author_counts_as_owner=True,
uncovered_files=None, expected_output='',
manually_specified_reviewers=None):
if approvers is None:
# The set of people who lgtm'ed a change.
......@@ -2654,14 +2654,9 @@ class CannedChecksUnittest(PresubmitTestsBase):
issue=int(input_api.change.issue), messages=True).AndReturn(
rietveld_response)
if author_counts_as_owner:
people.add(change.author_email)
fake_db.files_not_covered_by(set(['foo/xyz.cc']),
people).AndReturn(uncovered_files)
else:
people.discard(change.author_email)
fake_db.files_not_covered_by(set(['foo/xyz.cc']),
people).AndReturn(uncovered_files)
people.add(change.author_email)
fake_db.files_not_covered_by(set(['foo/xyz.cc']),
people).AndReturn(uncovered_files)
if not is_committing and uncovered_files:
fake_db.reviewers_for(set(['foo']),
change.author_email).AndReturn(change.author_email)
......@@ -2669,7 +2664,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
self.mox.ReplayAll()
output = presubmit.PresubmitOutput()
results = presubmit_canned_checks.CheckOwners(input_api,
presubmit.OutputApi, author_counts_as_owner=author_counts_as_owner)
presubmit.OutputApi)
if results:
results[0].handle(output)
self.assertEquals(output.getvalue(), expected_output)
......@@ -2797,18 +2792,6 @@ class CannedChecksUnittest(PresubmitTestsBase):
is_committing=False,
expected_output='')
def testCannedCheckOwners_AuthorCountsAsOwner(self):
self.AssertOwnersWorks(approvers=set(['john@example.com',
'brett@example.com']),
reviewers=set(['john@example.com',
'ben@example.com']),
uncovered_files=set(['foo/xyz.cc', 'foo/bar.cc']),
expected_output='Missing LGTM from an OWNER '
'for these files:\n'
' foo/bar.cc\n'
' foo/xyz.cc\n',
author_counts_as_owner=False)
def testCannedCheckOwners_TBR(self):
self.AssertOwnersWorks(tbr=True,
expected_output='--tbr was specified, skipping OWNERS check\n')
......
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