Bug 34978 - Add --include and --exclude options to install_plugins.pl to choose the plugins to install
Summary: Add --include and --exclude options to install_plugins.pl to choose the plugi...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Emily-Rose Francoeur
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-03 17:15 UTC by Emily-Rose Francoeur
Modified: 2024-03-25 13:18 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.83 KB, patch)
2023-10-04 13:23 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.75 KB, patch)
2023-10-04 20:05 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.73 KB, patch)
2023-10-04 20:20 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.78 KB, patch)
2023-12-21 16:25 UTC, Salah Ghedda
Details | Diff | Splinter Review
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.83 KB, patch)
2023-12-22 13:36 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34978: (QA follow-up): (7.38 KB, patch)
2023-12-22 13:36 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34978: Add --include and --exclude options to install_plugins.pl (8.95 KB, patch)
2024-03-25 13:17 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 34978: (QA follow-up): (7.38 KB, patch)
2024-03-25 13:18 UTC, Hammat wele
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily-Rose Francoeur 2023-10-03 17:15:53 UTC
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.
Comment 1 Emily-Rose Francoeur 2023-10-04 13:23:29 UTC
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
Comment 2 Emily-Rose Francoeur 2023-10-04 20:05:01 UTC
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
Comment 3 Emily-Rose Francoeur 2023-10-04 20:20:58 UTC
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
Comment 4 Salah Ghedda 2023-12-21 16:25:03 UTC
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
Comment 5 Pedro Amorim 2023-12-22 13:36:24 UTC
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>
Comment 6 Pedro Amorim 2023-12-22 13:36:26 UTC
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>
Comment 7 Julian Maurice 2024-02-16 12:49:42 UTC
What is the use case for this ?

Why would you add plugins in the plugins path if you do not want to install them ?
Comment 8 Blou 2024-02-16 14:20:21 UTC
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 ?
Comment 9 Julian Maurice 2024-03-15 13:39:27 UTC
> 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.
Comment 10 Hammat wele 2024-03-25 13:17:58 UTC
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>
Comment 11 Hammat wele 2024-03-25 13:18:01 UTC
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>