New issue
Advanced search Search tips

Issue 825053 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

`git cl upload` Fails Weirdly w/ Malformed Service Manifest

Project Member Reported by khorimoto@chromium.org, Mar 23 2018

Issue description

I created a service manifest file with improperly formatted JSON (I accidentally had left a trailing comma where there should not have been one). When I tried to run `git cl upload`, the script failed but did not generate a reasonable error message.

Eventually, I looked up the _GetOwnersFilesToCheckForIpcOwners function and was able to figure out my mistake. This error message should be improved so that future developers don't get stuck here.

>git cl upload
Running presubmit upload checks ...
Traceback (most recent call last):
  File "/usr/local/google/depot_tools/git_cl.py", line 5983, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/depot_tools/git_cl.py", line 5965, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/usr/local/google/depot_tools/git_cl.py", line 5006, in CMDupload
    return cl.CMDUpload(options, args, orig_args)
  File "/usr/local/google/depot_tools/git_cl.py", line 1593, in CMDUpload
    change=change)
  File "/usr/local/google/depot_tools/git_cl.py", line 1527, in RunHook
    gerrit_obj=self._codereview_impl.GetGerritObjForPresubmit())
  File "/usr/local/google/depot_tools/presubmit_support.py", line 1423, in DoPresubmitChecks
    results += executer.ExecPresubmitScript(presubmit_script, filename)
  File "/usr/local/google/depot_tools/presubmit_support.py", line 1330, in ExecPresubmitScript
    result = eval(function_name + '(*__args)', context)
  File "<string>", line 1, in <module>
  File "<string>", line 3062, in CheckChangeOnUpload
  File "<string>", line 2682, in _CommonChecks
  File "<string>", line 1793, in _CheckIpcOwners
  File "<string>", line 1772, in _GetOwnersFilesToCheckForIpcOwners
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name enclosed in double quotes: line 9 column 6 (char 229)
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e8efd0939a59214cf714eac9c7e30951ac694c8f

commit e8efd0939a59214cf714eac9c7e30951ac694c8f
Author: Daniel Cheng <dcheng@chromium.org>
Date: Fri Mar 23 23:57:43 2018

PRESUBMIT.py: IPC owners check should not explode on invalid JSON files.

Update the IPC owners checks to skip files that don't parse. This is OK
since invalid JSON already triggers a separate presubmit error. Once the
error is fixed, subsequent presubmit runs will verify that IPC owners
are correctly set.

Bug:  825053 
Change-Id: I2295901bf706c1a62ebee3710c5d87e415bd011a
Reviewed-on: https://chromium-review.googlesource.com/978611
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545634}
[modify] https://crrev.com/e8efd0939a59214cf714eac9c7e30951ac694c8f/PRESUBMIT.py

Comment 2 by dcheng@chromium.org, Mar 24 2018

Status: Fixed (was: Assigned)

Sign in to add a comment