code-owners: Use Gerrit code-owners if available

Problems interpreting OWNERS files have been fixed upstream.

Bug: 1183447
Change-Id: Ifd065d87b4244fc3ce2f27291b603acfedbb5d39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2753447
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edwin Kempin <ekempin@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/47/2753447/3
Edward Lesmes 5 years ago committed by LUCI CQ
parent e7dc8c3a86
commit 88f712e012

@ -201,6 +201,6 @@ def GetCodeOwnersClient(root, upstream, host, project, branch):
Defaults to GerritClient, and falls back to DepotToolsClient if code-owners
plugin is not available."""
# TODO(crbug.com/1183447): Use code-owners plugin if available on host once
# code-owners plugin issues have been fixed.
if gerrit_util.IsCodeOwnersEnabled(host):
return GerritClient(host, project, branch)
return DepotToolsClient(root, upstream)

@ -296,9 +296,10 @@ class GetCodeOwnersClientTest(unittest.TestCase):
self.addCleanup(mock.patch.stopall)
def testGetCodeOwnersClient_GerritClient(self):
# TODO(crbug.com/1183447): Check that code-owners is used if available once
# code-owners plugin issues have been fixed.
pass
gerrit_util.IsCodeOwnersEnabled.return_value = True
self.assertIsInstance(
owners_client.GetCodeOwnersClient('', '', 'host', 'project', 'branch'),
owners_client.GerritClient)
def testGetCodeOwnersClient_DepotToolsClient(self):
gerrit_util.IsCodeOwnersEnabled.return_value = False

Loading…
Cancel
Save