From Tomas: "We really need to put each plugin in its own subdirectory (to identify them individually) and have a metadata file we can refer to." This would make things much more manageable. Right now, plugins get all mixed together in the plugins directory. For example, installing the kitchen sink plugin results in Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm being created in the plugins directory. Installing CoverFlow will create CoverFlow.pm in the same directory as KitchenSink.pm. There is no reason that plugins cannot be created to install in a subdirectory directly in the kpz file. In that case, the plugins directory would contain something like kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm, while CoverFlow would live in coverflow/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm.
Created attachment 103311 [details] [review] Bug 25222: Add ability to let plugins live in individual subdirectories From Tomas: "We really need to put each plugin in its own subdirectory (to identify them individually) and have a metadata file we can refer to." This would make things much more manageable. Right now, plugins get all mixed together in the plugins directory. For example, installing the kitchen sink plugin results in Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm being created in the plugins directory. Installing CoverFlow will create CoverFlow.pm in the same directory as KitchenSink.pm. There is no reason that plugins cannot be created to install in a subdirectory directly in the kpz file. In that case, the plugins directory would contain something like kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm, while CoverFlow would live in coverflow/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Download the Kitchen Sink plugin 4) Rename it from kzp to zip 5) Unzip the plugin 6) Create a new directory kitchen-sink 7) move the Koha directory from the plugin into kitchen-sink 8) Zip the new kitchen-sink directory, include that directory in the zip file 9) Change the file suffix from zip to kpz 10) Install the plugin in Koha 11) The plugin should load!
Created attachment 103317 [details] [review] Bug 25222: Add ability to let plugins live in individual subdirectories From Tomas: "We really need to put each plugin in its own subdirectory (to identify them individually) and have a metadata file we can refer to." This would make things much more manageable. Right now, plugins get all mixed together in the plugins directory. For example, installing the kitchen sink plugin results in Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm being created in the plugins directory. Installing CoverFlow will create CoverFlow.pm in the same directory as KitchenSink.pm. There is no reason that plugins cannot be created to install in a subdirectory directly in the kpz file. In that case, the plugins directory would contain something like kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm, while CoverFlow would live in coverflow/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Download the Kitchen Sink plugin 4) Rename it from kzp to zip 5) Unzip the plugin 6) Create a new directory kitchen-sink 7) move the Koha directory from the plugin into kitchen-sink 8) Zip the new kitchen-sink directory, include that directory in the zip file 9) Change the file suffix from zip to kpz 10) Install the plugin in Koha 11) The plugin should load! Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Created attachment 103389 [details] [review] Bug 25222: Add ability to let plugins live in individual subdirectories From Tomas: "We really need to put each plugin in its own subdirectory (to identify them individually) and have a metadata file we can refer to." This would make things much more manageable. Right now, plugins get all mixed together in the plugins directory. For example, installing the kitchen sink plugin results in Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm being created in the plugins directory. Installing CoverFlow will create CoverFlow.pm in the same directory as KitchenSink.pm. There is no reason that plugins cannot be created to install in a subdirectory directly in the kpz file. In that case, the plugins directory would contain something like kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm, while CoverFlow would live in coverflow/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Download the Kitchen Sink plugin 4) Rename it from kzp to zip 5) Unzip the plugin 6) Create a new directory kitchen-sink 7) move the Koha directory from the plugin into kitchen-sink 8) Zip the new kitchen-sink directory, include that directory in the zip file 9) Change the file suffix from zip to kpz 10) Install the plugin in Koha 11) The plugin should load! Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Hmm.. this looks like it adds a new dependency but doesn't specify that in the cpanfile File::Find::Rule
Had a quick chat with Kyle regarding alternatives: >I'm not sure about the approach in bug 25222 - Add ability to let plugins live in individual subdirectories > should we require that plugin devs package like this under a top level dir.. > or should we actually handle the separation at install time perhaps and create a directory for each plugin there? > I can see things ending up very inconsistent with a mix of the two styles otherwise. We agreed that if it's not a mammoth task it would be cleaner to continue to package plugins the way we currently are, and instead split them up at install time. As such, we're going to have a go at that and I'll hold off pushing this until we've reached a conclusion.
Created attachment 103495 [details] [review] Bug 25222: (QA follow-up) Make Koha create the subdirectory
Created attachment 103496 [details] [review] Bug 25222: (QA follow-up) Update @INC when calling Koha::Plugins::new
Setting back to signed off.. I've asked Tomas to give the follow-ups a quick once over to check there's nothing I've missed in Kyles work. Thanks for your effort guys, this will be a nice improvement.
Not sure how this worked before, but uninstalling a plugin with the patch applied leaves a lot of files in <pluginsdir>. Can it be fixed ?
(In reply to Julian Maurice from comment #9) > Not sure how this worked before, but uninstalling a plugin with the patch > applied leaves a lot of files in <pluginsdir>. Can it be fixed ? I think uninstallation is already broken anyway? Bug 25604
Tomas, you are QA contact here - could you verify that uninstalling works correctly?
Please check comment#9 and comment#10 - something appears not to be right with uninstalling plugins.
Is this dead in the water?
(In reply to Martin Renvoize from comment #13) > Is this dead in the water? I'm not opposed to continuing work on it if someone can tell me what needs done.
I don't have anything to ad from a QA perspective... but I'm intrigued by this one! In Discourse, the named plugins go into /var/www/discourse/plugins, so you wind up with something like /var/www/discourse/plugins/discourse-jwt/plugin.rb (https://github.com/discourse/discourse-jwt). I found it super convenient.
(In reply to David Cook from comment #15) > I don't have anything to ad from a QA perspective... but I'm intrigued by > this one! > > In Discourse, the named plugins go into /var/www/discourse/plugins, so you > wind up with something like > /var/www/discourse/plugins/discourse-jwt/plugin.rb > (https://github.com/discourse/discourse-jwt). I found it super convenient. Yeah, that's basically the gist of what we are trying do to here as well!