Overhaul |mach try| preset mechanism
Categories
(Developer Infrastructure :: Try, enhancement, P1)
Tracking
(firefox67 fixed)
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | fixed |
People
(Reporter: ahal, Assigned: ahal)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
With many |mach try| subcommands, you can save and load presets. E.g:
$ ./mach try fuzzy --save foobar -q "'some 'query"
$ ./mach try fuzzy --preset foobar
However, there are a lot of problems with this system. Most of them stem from the fact that the storage backend isn't adequate enough. It's a key/value store in an ini file (with subcommand names as the section headers). This makes it hard to save things that require more than one value.
Instead, I propose we use a format as follows (using yaml in the example):
foo:
subcommand: fuzzy
args:
queries:
- 'some 'query
- 'someotherquery
artifact: false
env:
CUSTOM_ENV: value
bar:
subcommand: syntax
args:
syntax: -b o -p linux -u mochitest
...
This simply stores the subcommand to run, and the arguments to pass into that subcommand. This makes it flexible enough to store as much (or as little) information along with the preset as desired.
Another benefit is that subcommands don't have to worry about loading presets at all. We could even restrict the ability to use --preset unless passed to the root |mach try| command. We could possibly even handle --save outside of the subcommands (though I'm on the fence about this, because it would mean no --save with fuzzy interactive mode).
Completing this task will allow us to fix several outstanding preset bugs, as well as provide a lot of new goodness.
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 2•7 years ago
|
||
Status update: this is mostly done. Just need to update some tests/documentation and get it reviewed. Hopefully landed in the next week or two.
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 4•7 years ago
|
||
For mach commands that have 'pass_context=True', we should implicitly add the
handler instance to the context. This will give mach command implementations an
easy way to access things like the command/subcommand names, the parser, argv
list, etc.
| Assignee | ||
Comment 5•7 years ago
|
||
I forgot to remove this after re-implementing without this dependency.
Depends on D20521
| Assignee | ||
Comment 6•7 years ago
|
||
Depends on D20522
| Assignee | ||
Comment 7•7 years ago
|
||
Depends on D20523
Comment 9•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9afd71742756
https://hg.mozilla.org/mozilla-central/rev/d7a45b84e063
https://hg.mozilla.org/mozilla-central/rev/1b5a4da48de3
https://hg.mozilla.org/mozilla-central/rev/24105ffcf6f5
| Assignee | ||
Comment 10•7 years ago
|
||
Sadly there was a bug in the preset migration despite the test. If you are here because of warnings about presets not being migrated, please see:
https://bugzilla.mozilla.org/show_bug.cgi?id=1530775#c3
Updated•3 years ago
|
Description
•