-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libdnf5: enable/disable plugins via Base
API
#831
Conversation
@softwaresale Thanks for the PR.
Description of Plugins that are disabled in the configuration file are not loaded. So they cannot be enabled with your Description of This will work. But it is not consistent with the config file. If the plugin is disabled in the configuration file, it is not loaded at all. This ensures that it cannot affect libdnf5 in any way. If the plugin is disabled using your I'm considering if you could modify the PR to behave the same as when the plugin is disabled in the config file. But that brings up the second problem. Until the plugin is loaded, it is not possible to call the method returning its name from it. Can you please wait a little longer with this PR? I am dealing with another issue related to this. Note: PR did not pass tests in Pre Commit. |
@softwaresale And I propose these changes in your PR:
|
Of course! I'm glad you got back to me at all lol. Those changes seem pretty straight-forward. I'll have updates pushed soon |
- Add `Base::enable_plugins` and `Base::disable_plugins` API to (dis|en)able plugins programmatically - Add `Plugins:set_plugin_enablement` to configure loaded plugins Fixes rpm-software-management#391
This reverts commit 88211d7.
- Pulled out the `Enabled` enum into `PluginEnabled` - Add `EnabledPlugins` class that holds the logic for a set of plugins that are either enabled or disabled. - Actually implemented the plugin enable/disable in `load_plugins`
62a1c35
to
32d50f3
Compare
How should |
Basically, apart from the loop, not much code has been added. The original code is moved to the condition and will only be executed if the plugin was not found in the When you wrote "Those changes seem pretty straight-forward", I thought you were going to make small changes to the original PR. Not that you throw it all away, including the API in Base, and start over. |
Yeah, I'm sorry I completely misinterpreted what you asked.
I totally conflated these two for some reason. I felt like I was supposed to be going in a different direction and not fixing what I already had. My bad. I'll fix it soon. |
@softwaresale The |
@softwaresale Hello, please do you still plan to work on this? |
@softwaresale I'm sorry, but I'm going to close this PR. We have waited a long time for a response. But, we need to solve the issue. So, I prepared another PR. |
Base::enable_plugins
andBase::disable_plugins
API to (dis|en)able plugins programmaticallyPlugins:set_plugin_enablement
to configure loaded pluginsI am unsure if implementation discussion should happen in PRs or in Issues. If these kinds of questions should be posted in an issue instead, I can move the discussion there. I have a few questions about my implementation:
Base
API acceptable? In the issue there is just oneinit_plugins
method that both enables and disable plugins at the same time. I decided to have two separate methods as it seems cleaner if the programmer only wants to enable/disable at one time. I am open to changing to match the DNF4 style.Base
to track which plugins should be enabled/disabled, and then do plugin enablement/disablement inPlugins
duringBase::setup
. Is this design adequate? or is there something I'm missing?Thanks in advance!
Fixes #391