koji_utils/directive: add option to download build.log
ClosedPublic

Authored by kparal on Jun 30 2016, 2:23 PM.

Details

Summary

This allows you to download build.log for all arch for a specific Koji
build.

I considered whether to download all available logs for the build, or
just build.log. Downloading all logs was more difficult to do and also
required sending more Koji queries. For the moment, the code supports
build.log only, which is the only one we have some use for (rpmgrill).

Test Plan

Unit tests added. Tested manually with modified rpmgrill.
Check out feature/buildlog branch from rpmgrill and you can see it live yourself.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to koji_utils/directive: add option to download build.log.Jun 30 2016, 2:23 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added a reviewer: libtaskotron.
kparal updated this revision to Diff 2334.Jul 1 2016, 1:52 PM
  • add unit tests
kparal updated this object.Jul 1 2016, 1:52 PM
kparal edited the test plan for this revision. (Show Details)
jskladan requested changes to this revision.Jul 7 2016, 1:42 PM
jskladan added a reviewer: jskladan.
jskladan added a subscriber: jskladan.

Looks good other than the build_log_url copy-paste error.

libtaskotron/directives/koji_directive.py
235–240

Maybe log a warning if build_log and action not in (...)? Or is it too defensive?

libtaskotron/ext/fedora/koji_utils.py
32–33

Seems like a typo here - guess it was not supposed to be {nevra.version}/{nevra.version} but {nevra.version}/{nevra.release} based on the example. Maybe add a test? :)

This revision now requires changes to proceed.Jul 7 2016, 1:42 PM
kparal marked 2 inline comments as done.Jul 7 2016, 3:12 PM
kparal added inline comments.
libtaskotron/directives/koji_directive.py
235–240

Added.

libtaskotron/ext/fedora/koji_utils.py
32–33

OOOPS! Thanks! I improved my test coverage.

The reason this slipped is because it "worked" - build.logs were getting created. However, they contained only "404 error" html code, which I didn't check. I don't think our file_utils.download() method should ignore http 404 and similar, it should raise an error instead. I'll address that in a separate diff.

kparal updated this revision to Diff 2352.Jul 7 2016, 3:14 PM
kparal marked 2 inline comments as done.
  • fix typo in build_log_url, add tests to catch it next time
jskladan accepted this revision.Jul 8 2016, 6:58 AM
This revision is now accepted and ready to land.Jul 8 2016, 6:58 AM
This revision was automatically updated to reflect the committed changes.