Bug 13893 - Add ability to execute perl scripts in atomicupdates
Summary: Add ability to execute perl scripts in atomicupdates
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 13068
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-23 12:29 UTC by Kyle M Hall
Modified: 2016-03-31 00:13 UTC (History)
4 users (show)

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


Attachments
Bug 13893 - Sample .perl file [Do Not Push] (830 bytes, patch)
2015-03-23 13:15 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13893 - Add ability to execute perl scripts in atomicupdates (2.15 KB, patch)
2015-03-23 13:15 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13893 - Add ability to execute perl scripts in atomicupdates (2.15 KB, patch)
2015-03-23 13:17 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13893 - Add ability to execute perl scripts in atomicupdates (1.65 KB, patch)
2015-03-23 13:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13893 - Add ability to execute perl scripts in atomicupdates (2.18 KB, patch)
2015-03-30 22:41 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13893 - Add ability to execute perl scripts in atomicupdates (2.04 KB, patch)
2015-04-17 06:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 13893: [QA Follow-up] Move print statement, sort files in loop (1.51 KB, patch)
2015-04-17 06:52 UTC, Marcel de Rooy
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 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!