#2111 runroot tasks end up in default channel
Closed: Fixed by tkopecek. Opened by ignatenkobrain.

Hello,

I have following policy in hub.conf:

channel =
  method newRepo distRepo :: use createrepo
  bool target && match target *-el8 :: use rhel8
  is_child_task :: parent
  all :: use default

When running any runroot task, it ends up in default channel...

I had to add has req_channel && has_perm customchannel :: req to make it work as expected... However, I think it would be nicer to have some better integration of a plugin with policies so that it uses runroot channel by default.

Since everything ends up on default channel, having check in CLI plugin seems weird which produces traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2683, in _callMethod
    return self._sendCall(handler, headers, request)
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2601, in _sendCall
    return self._sendOneCall(handler, headers, request)
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2647, in _sendOneCall
    ret = self._read_xmlrpc_response(r)
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2659, in _read_xmlrpc_response
    result = u.close()
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 655, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1000: 'No such entry in table channels: runroot'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/koji", line 333, in <module>
    rv = locals()[command].__call__(options, session, args)
  File "/usr/lib/python3.8/site-packages/koji_cli_plugins/runroot.py", line 67, in handle_runroot
    task_id = session.runroot(tag, arch, command, **kwargs)
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2187, in __call__
    return self.__func(self.__name, args, opts)
  File "/usr/lib/python3.8/site-packages/koji/__init__.py", line 2702, in _callMethod
    raise err
koji.GenericError: No such entry in table channels: runroot

Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.22

In fact it means creating runroot channel by default. Default channel policy in hub is:

has req_channel :: req
is_child_task :: parent
all :: use default

so, if runroot channel will exist, it will work. On the other hand, creating this channel if runroot pluging is not enabled by default looks like bad practice. Would it make sense to document the enablement of runroot plugin?

Metadata Update from @tkopecek:
- Issue tagged with: discussion

Metadata Update from @tkopecek:
- Issue untagged with: discussion
- Issue tagged with: doc, no_qe

PR #2344

Commit 580577ae fixes this issue

Commit ae7f686e fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/2111

Please continue any further discussion there.

Metadata
Related Pull Requests