diff --git a/owners_client.py b/owners_client.py index 51c1763eba..e70225c5bc 100644 --- a/owners_client.py +++ b/owners_client.py @@ -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) diff --git a/tests/owners_client_test.py b/tests/owners_client_test.py index 37c5fa389b..701627e385 100644 --- a/tests/owners_client_test.py +++ b/tests/owners_client_test.py @@ -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