Commit 9b9f451a authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

Let git cl presubmit work with no network

Bug: 1309977
Change-Id: Ifca6e60c1fb2ff76f6a8dee9129d4d661ba196a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3606733Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 06b18e4b
......@@ -1388,13 +1388,16 @@ def PanProjectChecks(input_api, output_api,
snapshot_memory[:] = (dt2, msg)
snapshot("checking owners files format")
results.extend(input_api.canned_checks.CheckOwnersFormat(
input_api, output_api))
try:
results.extend(input_api.canned_checks.CheckOwnersFormat(
input_api, output_api))
if owners_check:
snapshot("checking owners")
results.extend(input_api.canned_checks.CheckOwners(
input_api, output_api, source_file_filter=None))
if owners_check:
snapshot("checking owners")
results.extend(input_api.canned_checks.CheckOwners(
input_api, output_api, source_file_filter=None))
except Exception as e:
print('Failed to check owners - %s' % str(e))
snapshot("checking long lines")
results.extend(input_api.canned_checks.CheckLongLines(
......
......@@ -665,12 +665,15 @@ class InputApi(object):
self.owners_client = None
if self.gerrit:
self.owners_client = owners_client.GetCodeOwnersClient(
root=change.RepositoryRoot(),
upstream=change.UpstreamBranch(),
host=self.gerrit.host,
project=self.gerrit.project,
branch=self.gerrit.branch)
try:
self.owners_client = owners_client.GetCodeOwnersClient(
root=change.RepositoryRoot(),
upstream=change.UpstreamBranch(),
host=self.gerrit.host,
project=self.gerrit.project,
branch=self.gerrit.branch)
except Exception as e:
print('Failed to set owners_client - %s' % str(e))
self.owners_db = owners_db.Database(
change.RepositoryRoot(), fopen=open, os_path=self.os_path)
self.owners_finder = owners_finder.OwnersFinder
......
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