#150 no target info in channel policy for non-rpm tasks
Closed: Fixed 3 years ago Opened 5 years ago by mikem.

For build tasks, we provide the target info to the channel policy. However, there are other types of tasks with a target and they do not get that same info

I think it's time to resurrect this from the backlog.

With the parse_task_params function in koji.tasks it should be possible to do something much more robust that what we are doing now.

Metadata Update from @mikem:
- Issue set to the milestone: 1.17

3 years ago

1. should src, scratch be passed into policy as well, as far as possible?
2. 3th-party tasks won't be parsed by parse_task_params, is that meaningful to make this function extendible?

candidate patch https://pagure.io/fork/julian8628/koji/c/cdf55db

Rather than except Exception: here, let's explicitly catch the errors that parse_task_params is expected to throw (TypeError and koji.ParameterError). For those two, we can quietly ignore and skip the extra data. For unexpected errors, we should still skip the extra data and proceed, but we should also log the backtrace.

logger.warning('%s is not a standard koji task, skipping channel policy check.' % method)

with the logging module, best to avoid the explicit % operator and let the module do the expansion.

Also, we're not skipping the channel policy check, we're proceeding with less data.

src = params.get(k)
if src is not None:

If the src argument is None, then we should be passing None.

That code for sorting out the build target from different data types should probably be its own function.

We should avoid adding explicit failures here. We should fall back to simply providing less policy data.

I updated the patch and filed PR #962 for review.

Metadata Update from @franzh:
- Issue set to the milestone: 1.16.1 (was: 1.17)

3 years ago

Login to comment on this ticket.