Bug 17356 - Add atomic update .perl skeleton file
Summary: Add atomic update .perl skeleton file
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 17234
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-27 07:30 UTC by Jonathan Druart
Modified: 2017-06-14 22:16 UTC (History)
4 users (show)

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


Attachments
Bug 17356: Add atomic update .perl skeleton file (2.03 KB, patch)
2016-09-27 07:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17356: Add atomic update .perl skeleton file (2.19 KB, patch)
2016-09-29 20:55 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 17356 - update README (916 bytes, patch)
2016-09-29 20:58 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 17356: Add atomic update .perl skeleton file (2.29 KB, patch)
2016-10-14 06:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17356 - update README (1016 bytes, patch)
2016-10-14 06:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17356: [QA Follow-up] Minor changes to skeleton.perl (1.89 KB, patch)
2016-10-14 06:51 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 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 2016-10-28 14:57:11 UTC
Pushed to master for 16.11, thanks Jonathan, Liz, Marcel!