Bug 20669 - Add upgrade method to plugins
Summary: Add upgrade method to plugins
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Kyle M Hall
QA Contact: Tomás Cohen Arazi
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 22084
  Show dependency treegraph
 
Reported: 2018-04-26 19:04 UTC by Kyle M Hall
Modified: 2019-01-08 18:33 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
This enhancement standardises the methods used by plugin authors to maintain their plugin data across plugin versions.


Attachments
Bug 20669: Add upgrade method to plugins (3.73 KB, patch)
2018-04-26 19:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20669: Add upgrade method to plugins (6.06 KB, patch)
2018-05-31 15:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20669: Add upgrade method to plugins (6.03 KB, patch)
2018-05-31 15:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20669: Add upgrade method to plugins (6.02 KB, patch)
2018-09-16 18:35 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 20669: Add upgrade method to plugins (6.08 KB, patch)
2018-09-21 13:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2018-04-26 19:04:57 UTC
It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.
Comment 1 Kyle M Hall 2018-04-26 19:07:34 UTC
Created attachment 74892 [details] [review]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.
Comment 2 Magnus Enger 2018-05-11 09:07:48 UTC
Great enhancement! Is there a test plan?
Comment 3 Kyle M Hall 2018-05-14 13:32:59 UTC
(In reply to Magnus Enger from comment #2)
> Great enhancement! Is there a test plan?

Nope, but I could add something to the Kitchen Sink plugin to test with if you'd like!
Comment 4 Katrin Fischer 2018-05-15 10:40:20 UTC
(In reply to Kyle M Hall from comment #3)
> (In reply to Magnus Enger from comment #2)
> > Great enhancement! Is there a test plan?
> 
> Nope, but I could add something to the Kitchen Sink plugin to test with if
> you'd like!

This would be great I think, also for QA later :)
Comment 5 Kyle M Hall 2018-05-31 15:01:53 UTC
Created attachment 75704 [details] [review]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.

Test Plan:
1) Apply this patch
2) Download the 2 most recent releases of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
3) Install the earlier release
4) Look at the configuration page, at the bottom it should say the
   plugin has never been upgraded
5) Install the newer release
6) Reload the configuration page, it should now say that the plugin
   was upgraded and give you the date and time of the upgrade
Comment 6 Kyle M Hall 2018-05-31 15:04:48 UTC
Created attachment 75705 [details] [review]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.

Test Plan:
1) Apply this patch
2) Download the 2 most recent releases of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
3) Install the earlier release
4) Look at the configuration page, at the bottom it should say the
   plugin has never been upgraded
5) Install the newer release
6) Reload the configuration page, it should now say that the plugin
   was upgraded and give you the date and time of the upgrade
Comment 7 Claire Gravely 2018-09-16 18:35:38 UTC
Created attachment 78976 [details] [review]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.

Test Plan:
1) Apply this patch
2) Download the 2 most recent releases of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
3) Install the earlier release
4) Look at the configuration page, at the bottom it should say the
   plugin has never been upgraded
5) Install the newer release
6) Reload the configuration page, it should now say that the plugin
   was upgraded and give you the date and time of the upgrade

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Comment 8 Tomás Cohen Arazi 2018-09-21 13:38:09 UTC
Created attachment 79232 [details] [review]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.

Test Plan:
1) Apply this patch
2) Download the 2 most recent releases of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
3) Install the earlier release
4) Look at the configuration page, at the bottom it should say the
   plugin has never been upgraded
5) Install the newer release
6) Reload the configuration page, it should now say that the plugin
   was upgraded and give you the date and time of the upgrade

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Nick Clemens 2018-09-26 19:31:16 UTC
Awesome work all!

Pushed to master for 18.11
Comment 10 Martin Renvoize 2018-09-27 12:40:26 UTC
Pushed to 18.05.x for 18.05.05.

I chose to backport this enhancement in line with my policy of backporting non-breaking change enhancements to the API and Plugin systems.
Comment 11 Fridolin SOMERS 2018-10-08 06:00:48 UTC
Pushed to 17.11.x for 17.11.11