koji_directive: allow to download all arches and add src option
ClosedPublic

Authored by kparal on Aug 20 2014, 9:42 AM.

Details

Summary

The major change is that koji_directive can now download all arches of a
build (if the arch option is not provided). It also adds src option
to download src rpms. This goes in line with how koji_utils works.
The benefit is that we can now have noarch checks, like rpmlint, to
download the full build and produce the result in a single execution,
instead of separating it per-architecture (and omitting src rpms
completely).

Additionally, koji_utils.nvr_to_urls() no longer raises an error if there are no
RPMs available for the given build and architecture, which mostly resolves
https://phab.qadevel.cloud.fedoraproject.org/rLTRN75d1ebbecaa62a8592f5fa84ef461c2437083914
.

Some documentation and logging printouts were improved in the process.
New unit tests were added.

Test Plan

test suite works, new tests added. rpmlint works and downloads the full build if this directive is used:

- name: download rpms from koji
  koji:
    action: download
    koji_build: ${koji_build}
    src: True

Diff Detail

Repository
rLTRN libtaskotron
Lint
Lint Skipped
Unit
Unit Tests Skipped
kparal retitled this revision from to koji_directive: allow to download all arches and add src option.Aug 20 2014, 9:42 AM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal updated this revision to Diff 611.Aug 20 2014, 9:47 AM
  • improve docs a bit
kparal updated this revision to Diff 613.Aug 20 2014, 11:47 AM
  • make arch parameter mandatory again and use ['all'] to specify all arches

@jskladan claimed that it was confusing to have different behavior for arch=None and arch=[]. After consulting with him, I made the parameter mandatory again and used ['all'] to denote if you want to download RPMs for all architectures. I modified koji_utils to work the same way.

The psychological benefit of making arch mandatory (and using ['all']) should be that people will realize when they download more than they need.

Full-build rpmlint now works with this directive:

- name: download rpms from koji
  koji:
    action: download
    koji_build: ${koji_build}
    arch: ['all']
    src: True

Here, have a pony for your trouble :)

jskladan requested changes to this revision.Aug 20 2014, 12:27 PM
jskladan added inline comments.
libtaskotron/directives/koji_directive.py
124

?
Edit: on a second thought, I know what it does, but please use braces to make it obvious on the first glance ;)

  • maybe add to the documentation, that providing [] as the arch value will just download the noarch rpms. Or make sure that an empty list raises ValueError (which would make it consistent with the nvr_to_urls() method.
  • would it make sense to do some type-checking? Since you obviously require some MutableSequence?
This revision now requires changes to proceed.Aug 20 2014, 12:27 PM
kparal updated this revision to Diff 615.Aug 20 2014, 12:32 PM
  • add some brackets to earn another pony
jskladan accepted this revision.Aug 20 2014, 12:33 PM
jskladan added inline comments.
libtaskotron/directives/koji_directive.py
124

OK, disregard whatever I have written, it was under the influence of my internal "parsing error" of that if clause. But the braces would still be nice :)

This revision is now accepted and ready to land.Aug 20 2014, 12:33 PM
tflink requested changes to this revision.Aug 20 2014, 1:56 PM

small nit, but here are some bat ponies for your efforts!


Original

libtaskotron/koji_utils.py
137

Can you be consistent on the nested conditionals - either use parens or not?

This revision now requires changes to proceed.Aug 20 2014, 1:56 PM
kparal updated this revision to Diff 617.Aug 20 2014, 2:05 PM
  • more brackets, more ponies
tflink accepted this revision.Aug 21 2014, 9:00 AM

bah, that was supposed to be an accept

This revision is now accepted and ready to land.Aug 21 2014, 9:00 AM
kparal closed this revision.Aug 21 2014, 9:25 AM
kparal updated this revision to Diff 618.

Closed by commit rLTRN06b02772bffe (authored by @kparal).