[Bug 23191] New: Administrators should be able to install plugins from the command line
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Bug ID: 23191 Summary: Administrators should be able to install plugins from the command line Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Target Milestone: --- Some support companies would prefer to now allow end users to install new plugins. Prior to bug 21073 this was mostly possible by enabling plugins in the config but making the plugin path read only to the apache user. In this way users could not upload new plugins, but support providers could add plugins at the users request. This did have the caveat that 'install', 'update' and 'remove' routines in the plugin would not be called. With bug 21073 we must run through the InstallPlugins method to populate the relevant database tables so we should add a command line script that would allow administrators to run this once they had manually added plugin code to the correct paths. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 90943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90943&action=edit Bug 23191: Add commandline script to install plugins This adds an initial skeliton script to enable plugin installation at the commandline. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex.arnaud@biblibre.com, | |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- s/now/not in description.. man I wish i could go back and fix bugzilla descriptions/comments sometimes. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #3 from Alex Arnaud <alex.arnaud@biblibre.com> --- Script install already installed plugins. Means that the install method is called again. Not safe IMO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Alex Arnaud from comment #3)
Script install already installed plugins. Means that the install method is called again. Not safe IMO.
In the InstallPlugins method there is this line of code: Koha::Plugins::Methods->search({ plugin_class => $plugin_class })->delete(); You can call InstallPlugins as many times as you want, because it is reinstall the second time. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #5 from Alex Arnaud <alex.arnaud@biblibre.com> --- (In reply to M. Tompsett from comment #4)
(In reply to Alex Arnaud from comment #3)
Script install already installed plugins. Means that the install method is called again. Not safe IMO.
In the InstallPlugins method there is this line of code: Koha::Plugins::Methods->search({ plugin_class => $plugin_class })->delete();
You can call InstallPlugins as many times as you want, because it is reinstall the second time.
Good! I was worried about script output, but i seems that InstallPlugins only reset plugin methods. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90943|0 |1 is obsolete| | --- Comment #6 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 90946 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90946&action=edit Bug 23191: Add commandline script to install plugins This adds an initial skeliton script to enable plugin installation at the commandline. Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Yeah, I'm not the biggest fan of the fact that InstallPlugins re-installs all plugins every run.. but it is indeed idempotent in the way it does so. I argued for a cleaner approach in the performance bug but we decided to push forward and refine that code as a next step. You are right though, I thought the output was a nice extra to show 'something' had happened, but in this case it may be more confusing than helpful.. totally open to some code gulf or suggestions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Also, it's not actually a change.. the code before the performance bug also iterated through all plugins each time install was called.. it was just less obvious about it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think reinstalling might be a real issue: What if the plugin comes with its own data, will it get killed? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure how things work really. Just wondering: if you had a plugin installed already that has added data, will reinstalling effect it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #9)
I think reinstalling might be a real issue: What if the plugin comes with its own data, will it get killed?
So the re-installing all really isn't a change.. that's always happened.. for any plugin you installed we would iterate and re-install all other plugins at the same time. By 'install' I mean literally telling Koha that the plugin exists and what methods are available within it.. we update the plugin_methods table but we do not update any internal plugin data, that all remains intact. We will trigger the 'install' or 'upgrade' methods from within the plugin if required (i.e. we check versions within the database and only run the install if it has not been run before, or the upgrade if we've caught a version change). It is up to the plugin author to make sure their 'upgrade' method doesn't splat older data during such actions. In short.. I think the re-install loop is a non-issue.. it's a minor annoyance performance wise but it shouldn't cause any harm and in reality is unrelated to this patch.. Clearly the fact that I output the actual results of the script run is confusing people :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I suppose I could call 'GetPlugins' before 'InstallPlugins' and only output the differential list.. would that be preferred? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #13 from Alex Arnaud <alex.arnaud@biblibre.com> --- (In reply to Martin Renvoize from comment #12)
I suppose I could call 'GetPlugins' before 'InstallPlugins' and only output the differential list.. would that be preferred?
May be it could be less confusion indeed. Even if InstallPlugins doesn't call plugin's install methods. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #14 from Alex Arnaud <alex.arnaud@biblibre.com> --- (In reply to Alex Arnaud from comment #13)
(In reply to Martin Renvoize from comment #12)
I suppose I could call 'GetPlugins' before 'InstallPlugins' and only output the differential list.. would that be preferred?
May be it could be less confusion indeed. Even if InstallPlugins doesn't call plugin's install methods.
Confusing* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90946|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 90979 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90979&action=edit Bug 23191: Add commandline script to install plugins This adds an initial skeliton script to enable plugin installation at the commandline. Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 90980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90980&action=edit Bug 23191: (follow-up) Improve output This patch adds a check of what plugins installed before the script run and outputs only those plugins that have been installed for the first time or upgraded during this run. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90980|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 90981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90981&action=edit Bug 23191: (follow-up) Improve output This patch adds a check of what plugins installed before the script run and outputs only those plugins that have been installed for the first time or upgraded during this run. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- New test plan: 1) Without any plugins installed, run the script. Output should be: No plugins found at $plugins_dir 2) Manually add an unzipped plugin into your plugins_dir 3) Run the script. Output should be: 'Installed $plugin_name $plugin_version' 4) Run the script again. Output should be: 'All plugins successfully re-initialised' 5) Increment the 'version' in your unpacked plugin. 6) Run the script. Output should be: 'Upgrade $plugin_name from version $old_version to version $new_version' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90979|0 |1 is obsolete| | Attachment #90981|0 |1 is obsolete| | --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 90985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90985&action=edit Bug 23191: Add commandline script to install plugins This adds an initial skeliton script to enable plugin installation at the commandline. Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 90986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90986&action=edit Bug 23191: (follow-up) Improve output This patch adds a check of what plugins installed before the script run and outputs only those plugins that have been installed for the first time or upgraded during this run. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21073 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21073 [Bug 21073] Improve plugin performance -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual, | |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch adds a new release notes| |script | |`misc/devel/install_plugins | |.pl ` which allows system | |administrators the option | |of installing plugins via | |the command line as opposed | |to requiring the web side | |UI. Keywords|Manual, | |release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Command-line Utilities |Plugin architecture -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #22 from David Cook <dcook@prosentient.com.au> --- I like the sound of this but the implementation seems very different to what I would have expected. I thought it would be something like "misc/devel/install_plugin.pl <path/to/kpz>". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to David Cook from comment #22)
I like the sound of this but the implementation seems very different to what I would have expected.
I thought it would be something like "misc/devel/install_plugin.pl <path/to/kpz>".
Feel free to add such this additional functionality in a new bug ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #24 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #23)
(In reply to David Cook from comment #22)
I like the sound of this but the implementation seems very different to what I would have expected.
I thought it would be something like "misc/devel/install_plugin.pl <path/to/kpz>".
Feel free to add such this additional functionality in a new bug ;)
It's on my mind! Heh. I just have so much going on at the moment. I haven't even been working on plugins, as I've just needed the free time to decompress. (I'm just about to roll out some experimental work with RabbitMQ to select production instances, so I might have more to say on Bug 22417 at least.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 --- Comment #25 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #23)
(In reply to David Cook from comment #22)
I like the sound of this but the implementation seems very different to what I would have expected.
I thought it would be something like "misc/devel/install_plugin.pl <path/to/kpz>".
Feel free to add such this additional functionality in a new bug ;)
I'm thinking "koha-plugin-install <instance> <plugin>". Then if you wanted all your instances to be running one plugin, it would be trivial... Ok I'll open a bug report now but probably won't work on for a while (although you never know :O) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25671 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25672 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25549 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25549 [Bug 25549] Install plugin script/method should remove broken plugins -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org