Bug 34685 - updatedatabase.pl does not propagate the error code
Summary: updatedatabase.pl does not propagate the error code
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks: 34683
  Show dependency treegraph
 
Reported: 2023-09-01 07:46 UTC by Jonathan Druart
Modified: 2023-12-28 20:47 UTC (History)
3 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:
23.11.00,23.05.04,22.11.10


Attachments
Bug 34685: Make updatedatabase.pl propagate the error (1.66 KB, patch)
2023-09-01 07:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34685: Make updatedatabase.pl propagate the error (1.64 KB, patch)
2023-09-01 08:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34685: Make updatedatabase.pl propagate the error (1.69 KB, patch)
2023-09-06 00:57 UTC, David Cook
Details | Diff | Splinter Review
Bug 34685: Make updatedatabase.pl propagate the error (1.75 KB, patch)
2023-09-06 13:32 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-09-01 07:46:04 UTC
updatedatabase.pl already return 0 even if an error occurred during the upgrade.
Comment 1 Jonathan Druart 2023-09-01 07:51:17 UTC
Created attachment 155057 [details] [review]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`
Comment 2 Jonathan Druart 2023-09-01 08:00:54 UTC
Created attachment 155060 [details] [review]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`
Comment 3 David Cook 2023-09-06 00:55:22 UTC
My test plan:
0. vi Koha.pm
Change $VERSION from "23.06.00.016" to "23.06.00.017"
1. vi installer/data/mysql/db_revs/230600017.pl
Added a "die" into the first part of the "up" sub
2a. koha-mysql kohadev
2b. update systempreferences set value = '23.0600016' where variable = 'Version';
3. echo 'flush_all' | nc -q 1 memcached 11211
4. perl ./installer/data/mysql/updatedatabase.pl
Comment 4 David Cook 2023-09-06 00:57:45 UTC
Created attachment 155247 [details] [review]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 5 Kyle M Hall 2023-09-06 13:32:37 UTC
Created attachment 155274 [details] [review]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi 2023-09-06 18:11:05 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-09-08 19:28:04 UTC
Pushed to 23.05.x for 23.05.04
Comment 8 Matt Blenkinsop 2023-09-15 09:51:09 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x