changing cli to use item and item-type instead of specific data types
ClosedPublic

Authored by tflink on Apr 15 2014, 2:19 PM.

Details

Summary

Changing CLI to use more generic item and item-type input to match better with
the rest of libtaskotron.
Also, changing usage of bodhi-id to bodhi_id so that it can be used in yaml
templates because '-' is an invalid character for jinja2 identifiers. Fixes T127

Test Plan

Updated existing unit tests to handle the new input format, added new unit tests
to cover the argument processing. Have been testing locally in a dev env for
taskotron

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
mkrizek requested changes to this revision.Apr 15 2014, 2:46 PM

Other than one nitpick, the example of running tasks in readme.rst needs to be updated as well. Looks good to me otherwise.

libtaskotron/runner.py
144

$ python runtask.py -i xchat-2.8.8-21.fc20 -a x86_64 task-rpmlint/rpmlint.yml
[libtaskotron:logger.py:63] 2014-04-15 16:39:29 DEBUG doing stream logging
[libtaskotron:logger.py:34] 2014-04-15 16:39:29 CRITICAL Traceback (most recent call last):

File "runtask.py", line 4, in <module>
  runner.main()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 182, in main
  task_runner.run()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 28, in run
  self._validate_input()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 125, in _validate_input
  'was not defined' % arg)

TaskotronYamlError: Required input arg envr was not defined

If you omit -t argument, the error message might be confusing for someone because it asks for envr and the type is koji_build.

the example of running tasks in readme.rst needs to be updated as well

Good catch, I had forgotten about that

If you omit -t argument, the error message might be confusing for someone because it asks for envr and the type is koji_build.

Good point. I suspect that some changes to the validation code are going to be needed. I'd really like to get this code pushed today so we can get a stg system set up, would you be OK with letting this slide if I file a ticket to fix the problem?

would you be OK with letting this slide if I file a ticket to fix the problem?

Yeah, not a big deal anyway.

tflink updated this revision.Apr 15 2014, 3:04 PM
  • updating readme to reflect changes in the cli, task yaml format

Filed T129 to address the unclear error message issue

mkrizek accepted this revision.Apr 15 2014, 3:13 PM

LGTM

tflink closed this revision.Apr 15 2014, 3:36 PM

Closed by commit rLTRN41b0e38be4f1 (authored by @tflink).