Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Issue 2633133002: [devil] Upgrade parser/serializer for command line flags (Closed)

Created:
3 years, 11 months ago by perezju
Modified:
3 years, 11 months ago
CC:
catapult-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

[devil] Upgrade parser/serializer for command line flags Upgrade the code to parse/serialize flags in the command line file. Internally flags are now stored unquoted (to match the behaviour of desktop flags) and only parded/serialized when reading/writing from the file system. The algorithms now match the behaviour of Chrome's own command line parsing code. API changes: - Clients should now supply flags unquoted (but to ease the transition flags that appear to be quoted are not double-quoted). - There is a new GetCurrentFlags method to read the current flags stored on the device. - All methods to set/update flags now return the final set of flags stored on the device. BUG=catapult:#3112 Review-Url: https://codereview.chromium.org/2633133002 Committed: https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/c4ea5aba503c326e243e7b35a110a35fa5d47cd6

Patch Set 1 #

Total comments: 1

Patch Set 2 : logging nit #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -207 lines) Patch
D devil/devil/android/file_changer_devicetest.py View 1 chunk +0 lines, -72 lines 0 comments Download
D devil/devil/android/file_changer_test.py View 1 chunk +0 lines, -57 lines 0 comments Download
M devil/devil/android/flag_changer.py View 1 7 chunks +149 lines, -73 lines 4 comments Download
A + devil/devil/android/flag_changer_devicetest.py View 2 chunks +10 lines, -5 lines 0 comments Download
A devil/devil/android/flag_changer_test.py View 1 chunk +132 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
perezju
https://codereview.chromium.org/2633133002/diff/1/devil/devil/android/file_changer_devicetest.py File devil/devil/android/file_changer_devicetest.py (left): https://codereview.chromium.org/2633133002/diff/1/devil/devil/android/file_changer_devicetest.py#oldcode1 devil/devil/android/file_changer_devicetest.py:1: #!/usr/bin/env python Didn't notice on my previous CL, file ...
3 years, 11 months ago (2017-01-16 14:12:19 UTC) #3
perezju
Friendly ping. :) Hope you can have a look.
3 years, 11 months ago (2017-01-18 11:27:23 UTC) #6
jbudorick
lgtm Any idea why rietveld thinks you've deleted and readded the tests? https://codereview.chromium.org/2633133002/diff/20001/devil/devil/android/flag_changer.py File devil/devil/android/flag_changer.py ...
3 years, 11 months ago (2017-01-18 14:56:28 UTC) #9
perezju
On 2017/01/18 14:56:28, jbudorick wrote: > lgtm > > Any idea why rietveld thinks you've ...
3 years, 11 months ago (2017-01-18 15:19:31 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2633133002/20001
3 years, 11 months ago (2017-01-18 15:22:23 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/c4ea5aba503c326e243e7b35a110a35fa5d47cd6
3 years, 11 months ago (2017-01-18 15:24:23 UTC) #15
jbudorick
3 years, 11 months ago (2017-01-18 15:25:10 UTC) #16
Message was sent while issue was closed.
On 2017/01/18 15:19:31, perezju wrote:
> On 2017/01/18 14:56:28, jbudorick wrote:
> > lgtm
> > 
> > Any idea why rietveld thinks you've deleted and readded the tests?
> 
> I renamed the files "file_changer" -> "flag_changer", not sure how I missed
that
> when writing the first CL that added these tests.

Clearly I also missed that when reviewing this CL :)

> 
>
https://codereview.chromium.org/2633133002/diff/20001/devil/devil/android/fla...
> File devil/devil/android/flag_changer.py (right):
> 
>
https://codereview.chromium.org/2633133002/diff/20001/devil/devil/android/fla...
> devil/devil/android/flag_changer.py:14: _RE_NEEDS_QUOTING =
> re.compile(r'[^\w-]')  # Not in: alphanumeric or hyphens.
> On 2017/01/18 14:56:28, jbudorick wrote:
> > I'm surprised that this doesn't also include underscores.
> 
> \w already includes underscores, from the docs: "this is equivalent to the set
> [a-zA-Z0-9_]"

huh, didn't realize that.

> 
>
https://codereview.chromium.org/2633133002/diff/20001/devil/devil/android/fla...
> devil/devil/android/flag_changer.py:181: It's a direct port of
> CommandLine.java::tokenizeQuotedArguments.
> On 2017/01/18 14:56:28, jbudorick wrote:
> > somewhat amusingly, it's misspelled in CommandLine.java as
> > "tokenizeQuotedAruments"
> 
> yeah :-/ noted that too, wasn't sure whether to spread the misspelling here or
> whether that one should be fixed over there.

Fixed there, imo, but that's out of scope.

Powered by Google App Engine
This is Rietveld 408576698