Skip to content

Commit

Permalink
Don't require Fuchsia security review for Crashpad
Browse files Browse the repository at this point in the history
Change-Id: I6743453668b1db418d7e6c043bcc3c48d6fe865d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575721
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834467}
  • Loading branch information
Joshua Peraza authored and Chromium LUCI CQ committed Dec 8, 2020
1 parent aedd4f9 commit 1ca6d39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -2971,6 +2976,13 @@ def AddPatternToCheck(input_file, pattern):
# 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):
Expand Down
12 changes: 12 additions & 0 deletions PRESUBMIT_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,18 @@ def testComponentManifestV2NeedsSecurityOwner(self):
'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 = [
Expand Down

0 comments on commit 1ca6d39

Please sign in to comment.