Skip to content

Commit

Permalink
Revert 255357 "Change the user action file format from .txt to ...."
Browse files Browse the repository at this point in the history
Believed to be behind the failures in the Linux builder:

http://build.chromium.org/p/chromium/builders/Linux/builds/47996

Errors in the log:

.../actions/print_style.py: Has executable bit but not shebang or ELF header
.../histograms/print_style.py: Has executable bit but not shebang or ELF header

Refers to files in the CL.

> Change the user action file format from .txt to .xml.
>
> In this way, more information can be added (currently added 'description' and 'owner' for each action)
>
> A few functions are moved from tools/metrics/histograms to tools/metrics/common to be shared by tools/metrics and tools/histograms.
>
> BUG=340735
> NOTRY=true
>
> Review URL: https://codereview.chromium.org/149503005

TBR=yiyaoliu@chromium.org

Review URL: https://codereview.chromium.org/188793003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255404 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dcaiafa@google.com committed Mar 6, 2014
1 parent 287140e commit 32ce6d8
Show file tree
Hide file tree
Showing 14 changed files with 2,192 additions and 10,474 deletions.
24 changes: 10 additions & 14 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,32 +1014,28 @@ def _CheckCygwinShell(input_api, output_api):

def _CheckUserActionUpdate(input_api, output_api):
"""Checks if any new user action has been added."""
if any('actions.xml' == input_api.os_path.basename(f) for f in
if any('chromeactions.txt' == input_api.os_path.basename(f) for f in
input_api.LocalPaths()):
# If actions.xml is already included in the changelist, the PRESUBMIT
# for actions.xml will do a more complete presubmit check.
# If chromeactions.txt is already included in the changelist, the PRESUBMIT
# for chromeactions.txt will do a more complete presubmit check.
return []

with open('tools/metrics/actions/chromeactions.txt') as f:
current_actions = f.read()

file_filter = lambda f: f.LocalPath().endswith(('.cc', '.mm'))
action_re = r'[^a-zA-Z]UserMetricsAction\("([^"]*)'
current_actions = None
for f in input_api.AffectedFiles(file_filter=file_filter):
for line_num, line in f.ChangedContents():
match = input_api.re.search(action_re, line)
if match:
# Loads contents in tools/metrics/actions/actions.xml to memory. It's
# loaded only once.
if not current_actions:
with open('tools/metrics/actions/actions.xml') as actions_f:
current_actions = actions_f.read()
# Search for the matched user action name in |current_actions|.
for action_name in match.groups():
action = 'name="{0}"'.format(action_name)
if action not in current_actions:
name_pattern = r'\t%s\n' % action_name
if name_pattern not in current_actions:
return [output_api.PresubmitPromptWarning(
'File %s line %d: %s is missing in '
'tools/metrics/actions/actions.xml. Please run '
'tools/metrics/actions/extract_actions.py to update.'
'tools/metrics/actions/chromeactions.txt. Please run '
'tools/metrics/actions/extract_actions.py --hash to update.'
% (f.LocalPath(), line_num, action_name))]
return []

Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/actions/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# per-file rules:
per-file chromeactions.txt=*
33 changes: 0 additions & 33 deletions tools/metrics/actions/PRESUBMIT.py

This file was deleted.

Loading

0 comments on commit 32ce6d8

Please sign in to comment.