Page MenuHomePhabricator

Quibble space separated options shallow arguments
Closed, ResolvedPublic


Quibble has a few options that accepts multiples space separated values:

  [--run [RUN [RUN ...]]]
  [--skip [SKIP [SKIP ...]]]
  [--commands [command [command ...]]]
  [projects [projects ...]]

So if one wants to run an explicit stage and pass some project as arguments such as:

quibble --run phpunit mediawiki/extensions/BoilerPlate

What happens is:

run['phpunit', 'mediawiki/extensions/BoilerPlate']

--run and --skip can be made ''choices'' which would only allow existing stages or all, then the project will be populated.

But --commands can be anything arbitrary. I think I will repurpose that one to accept a single value but allow multiple occurrences of it. Ie:

quibble --command 'ls -l' --command 'cat foo'

Event Timeline

hashar created this task.Mar 14 2019, 8:41 PM

Change 496125 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/quibble@master] Better arg handling

hashar moved this task from Backlog to Defect on the Quibble board.Mar 18 2019, 2:44 PM

The root cause is we have multiple arguments with args='*':

--run, --skip

Used to specify stages, since we know the stages we can migrate that to choices instead.


Run arbitrary shell snippets with:

for cmd in cmds:
    subprocess.check_call(cmd, shell=True, cwd=cwd)

Eg via: --commands 'echo hello' 'exec phpunit --debug'. At least in CI configs we only pass a single command, usually a shell script which is defined in the container.

I guess we can allow --commands to only get a single argument but accumulate them in a list using action='append'


Additional repositories to clone.

The job mediawiki-selenium-integration-docker works around the issue by using double dashes to stop argparse from processing an option and move to the next option or argument:

--commands=mwselenium -- mediawiki/selenium

projects should be the only one using args='*' to avoid mistakes when one forget to use -- to stop processing.

hashar claimed this task.Mar 26 2019, 12:46 PM
hashar moved this task from Defect to In progress on the Quibble board.Mar 26 2019, 1:47 PM

Change 496125 merged by jenkins-bot:
[integration/quibble@master] Better arg handling

hashar closed this task as Resolved.Apr 17 2019, 11:44 AM