T166 - yumrepoinfo directive
ClosedPublic

Authored by jskladan on May 21 2014, 2:41 PM.

Details

Summary

To support using depcheck, a directive for translating koji tags into a set of yum repos is needed.

Test Plan

unittests attached

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
tflink requested changes to this revision.May 21 2014, 5:29 PM

How exactly did you test this? Did you even test it at all?

Sure, the unit tests pass and all that but I wrote an example task to try this out and within two minutes, I had fixed one critical bug that keeps the directive from running (wrong arg name - noted in comments) and hit another.

{F2221}

python runtask.py -i fedora-19-updates-testing-pending -t koji_tag -a x86_64 yumrepoinfo.yml produces:

$ python runtask.py -i fedora-19-updates-testing-pending -t koji_tag -a x86_64 yumrepoinfo.yml
[libtaskotron:logger.py:65] 2014-05-21 11:10:17 DEBUG   doing stream logging
[libtaskotron:config.py:154] 2014-05-21 11:10:17 DEBUG   Trying to open configuration file: /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:164] 2014-05-21 11:10:17 DEBUG   Trying to parse configuration file: /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:189] 2014-05-21 11:10:17 WARNING Unknown option "taskotron_task_step" in the config file /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:62] 2014-05-21 11:10:17 DEBUG   Using config profile: development
[libtaskotron:config.py:242] 2014-05-21 11:10:17 WARNING Failed to create a required directory, please create it manually: [Errno 13] Permission denied: '/var/log/taskotron'
[libtaskotron:yumrepoinfo.py:185] 2014-05-21 11:10:17 DEBUG   Looking for yumrepoinfo config files in: ['/home/tflink/code/taskotron/libtaskotron/conf/yumrepoinfo.conf', '/etc/taskotron/yumrepoinfo.conf']
[libtaskotron:yumrepoinfo.py:190] 2014-05-21 11:10:17 DEBUG   Successfully loaded yumrepoinfo config file: /home/tflink/code/taskotron/libtaskotron/conf/yumrepoinfo.conf
[libtaskotron:logger.py:34] 2014-05-21 11:10:17 CRITICAL Traceback (most recent call last):
  File "runtask.py", line 4, in <module>
    runner.main()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 192, in main
    task_runner.run()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 31, in run
    self.do_actions()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 105, in do_actions
    self.do_single_action(action)
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 94, in do_single_action
    self.envdata)
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/directives/yumrepoinfo_directive.py", line 52, in process
    raise TaskotronDirectiveError("The yumrepoinfo directive requires "\
TaskotronDirectiveError: The yumrepoinfo directive requires kojitag and arch arguments.

If I fix the arg lookup issue and run again, I get:

$ python runtask.py -i fedora-19-updates-testing-pending -t koji_tag -a x86_64 ../task-example_reporting/yumrepoinfo.yml
[libtaskotron:logger.py:65] 2014-05-21 11:12:08 DEBUG   doing stream logging
[libtaskotron:config.py:154] 2014-05-21 11:12:08 DEBUG   Trying to open configuration file: /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:164] 2014-05-21 11:12:08 DEBUG   Trying to parse configuration file: /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:189] 2014-05-21 11:12:08 WARNING Unknown option "taskotron_task_step" in the config file /home/tflink/code/taskotron/libtaskotron/conf/taskotron.yaml
[libtaskotron:config.py:62] 2014-05-21 11:12:08 DEBUG   Using config profile: development
[libtaskotron:config.py:242] 2014-05-21 11:12:08 WARNING Failed to create a required directory, please create it manually: [Errno 13] Permission denied: '/var/log/taskotron'
[libtaskotron:yumrepoinfo.py:185] 2014-05-21 11:12:08 DEBUG   Looking for yumrepoinfo config files in: ['/home/tflink/code/taskotron/libtaskotron/conf/yumrepoinfo.conf', '/etc/taskotron/yumrepoinfo.conf']
[libtaskotron:yumrepoinfo.py:190] 2014-05-21 11:12:08 DEBUG   Successfully loaded yumrepoinfo config file: /home/tflink/code/taskotron/libtaskotron/conf/yumrepoinfo.conf
[libtaskotron:logger.py:34] 2014-05-21 11:12:08 CRITICAL Traceback (most recent call last):
  File "runtask.py", line 4, in <module>
    runner.main()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 192, in main
    task_runner.run()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 31, in run
    self.do_actions()
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 105, in do_actions
    self.do_single_action(action)
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 94, in do_single_action
    self.envdata)
  File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/directives/yumrepoinfo_directive.py", line 71, in process
  '%r not found.' % kojitag)
TaskotronDirectiveError: Repo with tagu'fedora-19-updates-testing' not found.
libtaskotron/directives/yumrepoinfo_directive.py
32

It's not just depcheck, though. That may be the primary driver for including this but I don't think it will remain the only use case.

Can you make this docstring a bit more generic

52

it's koji_tag, not kojitag

@tflink

ad 1) Looking at your sample .yml file - you used koji_tag instead of kojitag. With the .yml file structured according to the directive's docstring (see F2235 as a fixed version of your yumrepoinfo.yml), I am not getting the exception you encountered.

ad 2) There is no fedora-19-updates-testing-pending in yumrepoinfo.conf, so the exeption you encoutered is an expected behaviour. Maybe you meant run the code with f19-updates-testing-pending instead?

Please consider using this F2235 yml file and running the task as

python runtask.py -i f19-updates-testing-pending -t koji_tag -a x86_64 yumrepoinfo.yml

If you still get some tracebacks (as I do not), then we should have a look at our dev setups, and find out what the crucial difference is.

ad docstring) Sure thing, I'll change it to something more general.

If you still get some tracebacks (as I do not), then we should have a look at our dev setups, and find out what the crucial difference is.

Nope, completely my error. When I fix the yaml file as in F2235 and use a real tag, it works fine. Apologies for jumping to conclusions.

jskladan updated this revision.May 22 2014, 11:57 AM
  • T166 - minor changes
tflink accepted this revision.May 22 2014, 12:12 PM

Looks good to me

Just to point it out - it makes more sense for the parameter to be called koji_tag (as it is used in that way in the rest of the code), so this diff changed it from kojitag to koji_tag. I did not realize commit messages are not shown, so just poiting it out for the sake of clarity.

jskladan closed this revision.May 22 2014, 1:08 PM

Closed by commit rLTRN704dba3c521c (authored by @jskladan).