#1797 hub: build for policy check should be build_id in host.tagBuild
Merged by tkopecek. Opened by julian8628.
julian8628/koji typo_tag_build  into  master

Download 1797.patch

Metadata Update from @julian8628:
- Pull-request tagged with: testing-ready

I think we're addressing the wrong problem here.

It is true that #1702 changed the type of the build field in the policy data provided in host.tagBuild from the build id to the dict. However, there are other places in the code where the build field in the policy data is given as such (e.g. for places where we check volume policy).

All the other policy test handlers that look at the build field end up passing through get_build first (or passing it to another call that does so). The imported test is the only one that assumes it must be an integer. We should probably fix this test instead.

Based on my above comments, I'd expect similar errors if someone used the imported test in volume policy.

@mikem does an invalid data['build'] or absence of data['build'] make sense for imported test?
I think an exception should be raised in this case.

rebased onto 03564b671b4494a3ca8abc982ccc6f2b8e28d7d4

Based on my above comments, I'd expect similar errors if someone used the imported test in volume policy.

updated

:thumbsup:

I think, that raising an exception makes a sense here. imported is expected to return boolean, if there is no build, it is wrong usage and returning False/True would hide a problem and is definitely not true value.

Commit a365c9ad fixes this pull-request

Pull-Request has been merged by tkopecek

I've merged it, so we can proceed with fix. @mikem if you've concerns about exception, we can open new issue for that.

Metadata