#892 cli: also load plugins from ~/.koji/plugins
Merged by mikem. Opened by julian8628.
julian8628/koji issue/887  into  master

Download 892.patch
  • add plugin_path in koji.conf
  • add --plugin-paths in cli arguments

fixes: #887

I would swap the order, so system plugins are loaded first and possibly overridden by user ones.

I would swap the order, so system plugins are loaded first and possibly overridden by user ones.

User path will be searched in before system plugin path. Like the behavior of plugin2.py in unit test, if plugin filename is the same, the one in user path is loaded, and the one in system path is skipped, I think it should have the same result as the overriding approach.

if -p is not used, it fails on plugin_paths.append, as plugin_paths is None, so

else:
    plugin_paths = []

I've added one more comment, but yes, you're right and it works correctly for me.

rebased onto d92299c15d642b4d9d1ff70069d0bd03b95221e2

updated.
I added some extra info in help and comments in koji.conf

Dominance does not appear to be stable, at least in python3. If I define a plugin in ~/.koji/plugins that overrides the runroot command (but is not named runroot.py), then a random one appears to win.

Looks like we're trying to pick the first plugin file per name, which seems reasonable, but we then rely on imp.find_module to pick it from the set of paths.

rebased onto 43f9490b497cfdfcf15388c40772dd01924ab689

updated the loading order
will load plugins from module koji_cli_plugins -> ~/.koji/plugins/ > user defined dirs
and reload every file and method(no matter if the filename is duplicated)

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

@julian8628 Hi, can you rebase this one? (merge conflict)

rebased onto f1b9d439d4155cb1bd790683e91e755f09e08f27

@tkopecek
Rebased

These are not appended, but prepended. This wording leads me to understanding, that user's plugin will always have priority, which is not true.

2 new commits added

  • adjust cli plugin config description
  • cli: also load plugins from ~/.koji/plugins

updated

2 new commits added

  • adjust cli plugin config description
  • cli: also load plugins from ~/.koji/plugins

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

This isn't quite where it needs to be, but I think further work can be deferred or at least split out.

Minor changes here. Please check:

https://github.com/mikem23/koji-playground/commits/pagure/pr/892

:thumbsup:

2 new commits added

  • shorten help text
  • fix whitespace

Thanks! @mikem
updated

Further work may be related to #1534

Commit 4e221c51 fixes this pull-request

Pull-Request has been merged by mikem

Metadata