0

add CheckNewDEPSHookReviewers presubmit check

It will make sure any new hooks added to the DEPS are reviewed by
people in OWNERS tagged with `For new DEPS hook`.

Change-Id: I2fc8d606a92f0b4d87a5b9dc5daa819e3f47012e
Bug: 396736534
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6313602
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Gary Tong <gatong@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1435490}
This commit is contained in:
Yiwei Zhang 2025-03-20 09:34:13 -07:00 committed by Chromium LUCI CQ
parent e54d0eaa6f
commit 5341bf062e
2 changed files with 12 additions and 4 deletions

5
OWNERS

@ -28,6 +28,11 @@ per-file CODE_OF_CONDUCT.md=dpranke@google.com
per-file CODE_OF_CONDUCT.md=ellyjones@chromium.org
per-file CPPLINT.cfg=file://styleguide/c++/OWNERS
per-file DEPS=*
per-file DEPS=bryner@google.com # For new DEPS hook
per-file DEPS=dpranke@google.com # For new DEPS hook
per-file DEPS=gatong@chromium.org # For new DEPS hook
per-file DEPS=guterman@google.com # For new DEPS hook
per-file DEPS=treilly@google.com # For new DEPS hook
per-file PRESUBMIT*.py=agrieve@chromium.org # For .pydeps changes
per-file PRESUBMIT*.py=dcheng@chromium.org
per-file PRESUBMIT*.py=dpranke@google.com

@ -6130,6 +6130,9 @@ def ChecksCommon(input_api, output_api):
'infra', 'inclusive_language_presubmit_exempt_dirs.txt'
],
non_inclusive_terms=_NON_INCLUSIVE_TERMS))
results.extend(
input_api.canned_checks.CheckNewDEPSHooksHasRequiredReviewers(
input_api, output_api))
presubmit_py_filter = lambda f: input_api.FilterSourceFile(
f, files_to_check=[r'.*PRESUBMIT\.py$'])
@ -7518,10 +7521,10 @@ def CheckAndroidTestAnnotations(input_api, output_api):
if m := robolectric_test.search(line):
is_instrumentation_test = False
if m.group(1) == '' and not has_base_robolectric_rule:
path = str(f.LocalPath())
# These two spots cannot use it.
if 'webapk' not in path and 'build' not in path:
wrong_robolectric_test_runner_errors.append(path)
path = str(f.LocalPath())
# These two spots cannot use it.
if 'webapk' not in path and 'build' not in path:
wrong_robolectric_test_runner_errors.append(path)
break
if uiautomator_test.search(line):
is_instrumentation_test = False