Reland "presubmit: Skip owners checks if code-owners plugin is enabled."

This is a reland of 2cf835a9ba

URL-encoded repo path, so chromium/src becomes chromium%2Fsrc
as Gerrit expects

Original change's description:
> presubmit: Skip owners checks if code-owners plugin is enabled.
>
> If code-owners plugin is enable for the repo, skip owners check on
> commit, and skip checking owners format, as that will be done by
> the plugin.
>
> Change-Id: I1663baef4f0f27b00423071343fe740f6da50ce7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2727131
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

Change-Id: I3038590f3a92cbf7b6dc0ba6eb47f72593a2ccf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2775840
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Edward Lesmes
2021-03-19 20:04:43 +00:00
committed by LUCI CQ
parent dc11c6bd18
commit 8170c29fd1
7 changed files with 58 additions and 19 deletions

View File

@@ -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."""
if gerrit_util.IsCodeOwnersEnabled(host):
if gerrit_util.IsCodeOwnersEnabledOnHost(host):
return GerritClient(host, project, branch)
return DepotToolsClient(root, upstream)