Bug 17356

Summary: Add atomic update .perl skeleton file
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: kyle, liz, m.de.rooy, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 17234    
Bug Blocks:    
Attachments: Bug 17356: Add atomic update .perl skeleton file
Bug 17356: Add atomic update .perl skeleton file
Bug 17356 - update README
Bug 17356: Add atomic update .perl skeleton file
Bug 17356 - update README
Bug 17356: [QA Follow-up] Minor changes to skeleton.perl

Description Jonathan Druart 2016-09-27 07:30:59 UTC

    
Comment 1 Jonathan Druart 2016-09-27 07:33:21 UTC
Created attachment 55834 [details] [review]
Bug 17356: Add atomic update .perl skeleton file

To show devs how it should be written.

Test plan:
% cp installer/data/mysql/atomicupdate/skeleton.perl
installer/data/mysql/atomicupdate/bug_XXXXX.perl
% perl installer/data/mysql/updatedatabase.pl

You should see:
DEV atomic update: bug_xxxxx.perl
Upgrade to 16.06.00.XXX done (Bug XXXXX - description)
Comment 2 Marc VĂ©ron 2016-09-28 16:35:05 UTC
Followed test plan. I get an error with step:
% perl installer/data/mysql/updatedatabase.pl

DEV atomic update: bug_XXXXX.perl
Atomic update generated errors: Undefined subroutine &main::column_exists called at (eval 1045) line 5.
Comment 3 Jonathan Druart 2016-09-29 08:09:05 UTC
Sorry, the dependency was wrong, you need patches from bug 17234.
Comment 4 Liz Rea 2016-09-29 20:55:43 UTC
Created attachment 55944 [details] [review]
Bug 17356: Add atomic update .perl skeleton file

To show devs how it should be written.

Test plan:
% cp installer/data/mysql/atomicupdate/skeleton.perl
installer/data/mysql/atomicupdate/bug_XXXXX.perl
% perl installer/data/mysql/updatedatabase.pl

You should see:
DEV atomic update: bug_xxxxx.perl
Upgrade to 16.06.00.XXX done (Bug XXXXX - description)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Very good. I'll submit a patch for the readme to make the instructions better.
Comment 5 Liz Rea 2016-09-29 20:58:55 UTC
Created attachment 55945 [details] [review]
Bug 17356 - update README

Test plan:
Look at the README and make sure it makes sense.
Comment 6 Marcel de Rooy 2016-10-13 13:07:30 UTC
Why not add a few lines to README and remove the skeleton.perl?
Any dev would understand and is able to copy/paste.
Now it executes skeleton.perl every time.
Comment 7 Jonathan Druart 2016-10-13 14:13:58 UTC
(In reply to Marcel de Rooy from comment #6)
> Why not add a few lines to README and remove the skeleton.perl?
> Any dev would understand and is able to copy/paste.
> Now it executes skeleton.perl every time.

It should not execute the skeleton, there is a next for this filename.
It seems easier to use cp than edit, copy, create a new file, paste :)
Comment 8 Liz Rea 2016-10-13 20:06:44 UTC
I'm with Jonathan here.
Comment 9 Marcel de Rooy 2016-10-14 06:51:34 UTC
Created attachment 56444 [details] [review]
Bug 17356: Add atomic update .perl skeleton file

To show devs how it should be written.

Test plan:
% cp installer/data/mysql/atomicupdate/skeleton.perl
installer/data/mysql/atomicupdate/bug_XXXXX.perl
% perl installer/data/mysql/updatedatabase.pl

You should see:
DEV atomic update: bug_xxxxx.perl
Upgrade to 16.06.00.XXX done (Bug XXXXX - description)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Very good. I'll submit a patch for the readme to make the instructions better.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2016-10-14 06:51:42 UTC
Created attachment 56445 [details] [review]
Bug 17356 - update README

Test plan:
Look at the README and make sure it makes sense.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2016-10-14 06:51:46 UTC
Created attachment 56446 [details] [review]
Bug 17356: [QA Follow-up] Minor changes to skeleton.perl

Due to the way the snippet is run, there is no need to add a use for
C4::Installer or define $dbh (just like $DBVersion).
The suggested code is commented (column_exists is not defined).
Just as in updatedatabase, CheckVersion is called. The version number
does not need to contain 16.06; if we do so, we should update this
number each release. The XXX's work just fine.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Kyle M Hall (khall) 2016-10-28 14:57:11 UTC
Pushed to master for 16.11, thanks Jonathan, Liz, Marcel!