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.
Created attachment 37120 [details] [review] Bug 13893 - Sample .perl file [Do Not Push]
Created attachment 37121 [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. Test Plan: 1) Apply this patch set 2) Run updatedatabase.pl 3) You should see the output "Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates)"
Created attachment 37122 [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. Test Plan: 1) Apply this patch set 2) Run updatedatabase.pl 3) You should see the output "Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates)"
Created attachment 37123 [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. Test Plan: 1) Apply this patch set 2) Run updatedatabase.pl 3) You should see the output "Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates)"
Created attachment 37389 [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) Apply bug 13068 if not pushed to master yet. -- I had to manually rebase the updatedatabase.pl, but it wasn't hard. Asked for a rebase on the bug. 2) Apply this patch set 3) Run updatedatabase.pl -- Expect output to be similar to: --- BEGIN OUTPUT --- $ ./installer/data/mysql/updatedatabase.pl DEV atomic update : test_bz13068.sql Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates) --- END OUTPUT --- 4) 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>
QA: Looking at this one now. Will finish it tomorrow (QA sprint).
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>
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>
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
Patches pushed to master. Thanks Kyle!