It would be great to be able to choose which plugins to install and which ones not to install when using the install_plugins.pl script([Koha]/misc/devel/install_plugins.pl). The --include option would take a list of plugins and only install those. The --exclude option would take a list of plugins and install all plugins except those.
Created attachment 156539 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It’s possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include Test1 --include Koha::Plugin::Test2 TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command : "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project : "./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>” 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful
Created attachment 156555 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It's possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include <package::pluginClass> --include <anotherPluginClass>" TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project"./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>" 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful
Created attachment 156557 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It's possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include <package::pluginClass> --include <anotherPluginClass>" TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project"./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>" 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful
Created attachment 160210 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It's possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include <package::pluginClass> --include <anotherPluginClass>" TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project"./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>" 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful
Created attachment 160239 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It's possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include <package::pluginClass> --include <anotherPluginClass>" TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project"./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>" 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 160240 [details] [review] Bug 34978: (QA follow-up): - Rebased tests patch (62->51) - tidy - spelling ( paramater -> parameter ) Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
What is the use case for this ? Why would you add plugins in the plugins path if you do not want to install them ?
We manage a hundred personnalized koha installations and we don't want to manually install all the plugins. Plus we have multiple in-house plugins, but not all of them go to all clients. It's much simpler for certain plugins to be in the koha git rather than floating in their standalone plugin in github, most of them because anyway they depend on a personnalised codebase. Some depend on the level of support the user has, etc... What was the use case for install_plugins.pl ? Shouldn't people just use the UI ?
> What was the use case for install_plugins.pl ? Shouldn't people just use the UI ? It would be nice to be able to install plugins from the UI (and by "install" I do not mean "upload and install", only "install") but I believe plugins don't even appear in the UI until misc/devel/install_plugins.pl is run. > We manage a hundred personnalized koha installations and we don't want to manually install all the plugins. One option you have is to keep in $KOHA_CONF only the plugins that should be enabled for that Koha installation. You can still have all plugins in the same git repository. That way you also cannot install the wrong plugins by accident (by forgetting --exclude or --include) I'm not against --include and --exclude options, as they could be useful for testing/debugging purposes, but I'm not sure if it's the best solution for your use case.
Created attachment 163800 [details] [review] Bug 34978: Add --include and --exclude options to install_plugins.pl I have added the options --include and --exclude to the install_plugins.pl script. When running the script, you can now specify which plugins you want to install (--include) and which ones you do not want to install (--exclude). --include installs only the plugins from the specified classes. --exclude installs all plugins except those from the specified classes. It's possible to specify the package to install a specific plugin. --include and --exclude cannot be used simultaneously. Usage example: ./misc/devel/install_plugins --include <package::pluginClass> --include <anotherPluginClass>" TEST PLAN 1) Apply the patch 2) Add at least three plugins to the plugin directory ([Koha]/plugins/Koha/Plugin/) 3) Empty the "plugin_data" and "plugin_methods" tables (SQL command: "delete from plugin_data; delete from plugin_methods;") 4) In a terminal, execute this command "./misc/devel/install_plugins.pl --include <package::pluginClass> --include <anotherPluginClass>" (Replace <package::pluginClass> and <anotherPluginClass> with the class and package of your plugins) 5) In your Koha intranet, go to "Koha administration > Manage plugins" 6) Verify that only the specified plugins are installed 7) Repeat step 3 8) In a terminal, execute this command from your Koha project"./misc/devel/install_plugins.pl --exclude <package::pluginClass> --exclude <anotherPluginClass>" 9) Verify that all plugins except the specified ones are installed 10) Run the tests from the Plugins.t file ([Koha]/t/db_dependent/Koha/Plugins/Plugins.t) 11) Ensure that all tests are successful Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 163801 [details] [review] Bug 34978: (QA follow-up): - Rebased tests patch (62->51) - tidy - spelling ( paramater -> parameter ) Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>