Commit 1ca6d396 authored by Joshua Peraza's avatar Joshua Peraza Committed by Chromium LUCI CQ

Don't require Fuchsia security review for Crashpad

Change-Id: I6743453668b1db418d7e6c043bcc3c48d6fe865d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575721
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834467}
parent aedd4f9a
......@@ -2952,6 +2952,11 @@ def _AddOwnersFilesToCheckForFuchsiaSecurityOwners(input_api, to_check):
'*.fidl',
]
# Don't check for owners files for changes in these directories.
exclude_paths = [
'third_party/crashpad/*',
]
def AddPatternToCheck(input_file, pattern):
owners_file = input_api.os_path.join(
input_api.os_path.dirname(input_file.LocalPath()), 'OWNERS')
......@@ -2971,6 +2976,13 @@ def _AddOwnersFilesToCheckForFuchsiaSecurityOwners(input_api, to_check):
# for. We should only nag patch authors about per-file rules if a file in that
# directory would match that pattern.
for f in input_api.AffectedFiles(include_deletes=False):
skip = False
for exclude in exclude_paths:
if input_api.fnmatch.fnmatch(f.LocalPath(), exclude):
skip = True
if skip:
continue
for pattern in file_patterns:
if input_api.fnmatch.fnmatch(
input_api.os_path.basename(f.LocalPath()), pattern):
......
......@@ -2157,6 +2157,18 @@ class FuchsiaSecurityOwnerTest(unittest.TestCase):
'Found OWNERS files that need to be updated for IPC security review ' +
'coverage.\nPlease update the OWNERS files below:', errors[0].message)
def testThirdPartyTestsDoNotRequireSecurityOwner(self):
mock_input_api = MockInputApi()
mock_input_api.files = [
MockAffectedFile('third_party/crashpad/test/tests.cmx',
[
'const char kNoEnforcement[] = "Security?!? Pah!";',
])]
mock_output_api = MockOutputApi()
errors = PRESUBMIT.CheckSecurityOwners(
mock_input_api, mock_output_api)
self.assertEqual([], errors)
def testOtherFuchsiaChangesDoNotRequireSecurityOwner(self):
mock_input_api = MockInputApi()
mock_input_api.files = [
......
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