Bug 13893

Summary: Add ability to execute perl scripts in atomicupdates
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Installation and upgrade (web-based installer)Assignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, katrin.fischer, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16170
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13068    
Bug Blocks:    
Attachments: Bug 13893 - Sample .perl file [Do Not Push]
Bug 13893 - Add ability to execute perl scripts in atomicupdates
Bug 13893 - Add ability to execute perl scripts in atomicupdates
Bug 13893 - Add ability to execute perl scripts in atomicupdates
Bug 13893 - Add ability to execute perl scripts in atomicupdates
Bug 13893 - Add ability to execute perl scripts in atomicupdates
Bug 13893: [QA Follow-up] Move print statement, sort files in loop

Description Kyle M Hall 2015-03-23 12:29:18 UTC
Bug 13068 adds the ability to execute sql files from atomicupdates for in process developments to reduce merge conflicts. We need to extend this ability further to be able to handle perl code.

I can see either something like IPC::System::Simple to execute the perl script, OR we can just have perl code in a file ( with the extension .perl or something ) which we simply evaluate. The latter seems like the better way, as the RM can just copy and paste the code into updatedatabase.pl when it's ready to be pushed.
Comment 1 Kyle M Hall 2015-03-23 13:15:31 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2015-03-23 13:15:37 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2015-03-23 13:17:47 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2015-03-23 13:19:34 UTC Comment hidden (obsolete)
Comment 5 Mark Tompsett 2015-03-30 22:41:41 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2015-04-16 13:24:37 UTC
QA: Looking at this one now. Will finish it tomorrow (QA sprint).
Comment 7 Marcel de Rooy 2015-04-17 06:51:57 UTC
Created attachment 37997 [details] [review]
Bug 13893 - Add ability to execute perl scripts in atomicupdates

Bug 13068 adds the ability to execute sql files from atomicupdates for
in process developments to reduce merge conflicts. We need to extend
this ability further to be able to handle perl code.

Revised Test Plan
-----------------
1) Run updatedatabase.pl
   -- Expect output to be similar to:
   $ ./installer/data/mysql/updatedatabase.pl
   DEV atomic update : test.perl
   Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates)
2) Run koha qa test tools.
   -- only need to check last commit (-c 1), because first commit is a
      sample file which shouldn't be pushed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2015-04-17 06:52:02 UTC
Created attachment 37998 [details] [review]
Bug 13893: [QA Follow-up] Move print statement, sort files in loop

Just moving the print statement for DEV updates to show them too for
the new perl format.
In the loop opendir..readdir is used; this might not be always in the
expected order. I added a sort to force the order.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2015-04-17 07:09:39 UTC
QA Comment:
Looks good to me. Added a small follow-up.
Note that (as mentioned earlier) I would also accept .pl as the extension for the perl snippets. But that is somewhat arbitrary.

Passed QA
Comment 10 Tomás Cohen Arazi 2015-04-29 18:45:32 UTC
Patches pushed to master.

Thanks Kyle!