Skip to content

Commit

Permalink
Revert "PRESUBMIT.py: Replace checkteamtags with DIR_METADATA checks."
Browse files Browse the repository at this point in the history
This reverts commit e6d6e33.

Reason for revert: Speculatively blaming for https://crbug.com/1110100

Will reland if the revert is ineffective.

Original change's description:
> PRESUBMIT.py: Replace checkteamtags with DIR_METADATA checks.
> 
> checkteamtags is no longer necessary.
> - Add a check to validate DIR_METADATA files.
>   This obviates the need fo checkteamtags, as `dirmd` validates metadata in
>   OWNERS files, and we no longer need to enforce a unique team email for all
>   (component, OS) pair.
> - Add a check to enforce that OWNERS files contain no metadata if a
>   DIR_METADATA file is present in the same directory.
> 
> Bug: 1102997
> Change-Id: I661f7a1958824e7d20642d65534c2502d1a050e2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2317838
> Reviewed-by: Nodir Turakulov <nodir@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#791884}

TBR=dpranke@google.com,nodir@chromium.org,ehmaldonado@chromium.org

Change-Id: I483d4b50b18d1a901297801a524d79258ae9066c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1102997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321246
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#792021}
  • Loading branch information
krockot authored and Commit Bot committed Jul 27, 2020
1 parent 31ace97 commit c5ff932
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,28 @@ def _CheckFilePermissions(input_api, output_api):
long_text=error.output)]


def _CheckTeamTags(input_api, output_api):
"""Checks that OWNERS files have consistent TEAM and COMPONENT tags."""
checkteamtags_tool = input_api.os_path.join(
input_api.PresubmitLocalPath(),
'tools', 'checkteamtags', 'checkteamtags.py')
args = [input_api.python_executable, checkteamtags_tool,
'--root', input_api.change.RepositoryRoot()]
files = [f.LocalPath() for f in input_api.AffectedFiles(include_deletes=False)
if input_api.os_path.basename(f.AbsoluteLocalPath()).upper() ==
'OWNERS']
try:
if files:
warnings = input_api.subprocess.check_output(args + files).splitlines()
if warnings:
return [output_api.PresubmitPromptWarning(warnings[0], warnings[1:])]
return []
except input_api.subprocess.CalledProcessError as error:
return [output_api.PresubmitError(
'checkteamtags.py failed:',
long_text=error.output)]


def _CheckNoAuraWindowPropertyHInHeaders(input_api, output_api):
"""Makes sure we don't include ui/aura/window_property.h
in header files.
Expand Down Expand Up @@ -4405,11 +4427,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoTrinaryTrueFalse(input_api, output_api))
results.extend(_CheckUnwantedDependencies(input_api, output_api))
results.extend(_CheckFilePermissions(input_api, output_api))
results.extend(
input_api.canned_checks.CheckDirMetadataFormat(input_api, output_api))
results.extend(
input_api.canned_checks.CheckOwnersDirMetadataExclusive(
input_api, output_api))
results.extend(_CheckTeamTags(input_api, output_api))
results.extend(_CheckNoAuraWindowPropertyHInHeaders(input_api, output_api))
results.extend(_CheckForVersionControlConflicts(input_api, output_api))
results.extend(_CheckPatchFiles(input_api, output_api))
Expand Down

0 comments on commit c5ff932

Please sign in to comment.