Bugzilla – Attachment 33859 Details for
Bug 13068
New feature for DB update and sandbox
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13068: Counterpatch follow-up for controlling workflow
Bug-13068-Counterpatch-follow-up-for-controlling-w.patch (text/plain), 5.63 KB, created by
Marcel de Rooy
on 2014-11-24 14:23:07 UTC
(
hide
)
Description:
Bug 13068: Counterpatch follow-up for controlling workflow
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-11-24 14:23:07 UTC
Size:
5.63 KB
patch
obsolete
>From 034c33ed1f0bbb95415e9d0349bf6aaa3c39a51a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 16 Oct 2014 09:58:24 +0200 >Subject: [PATCH] Bug 13068: Counterpatch follow-up for controlling workflow >Content-Type: text/plain; charset=utf-8 > >The workflow for dev updates can be altered with devupdatecontrol: >[1] devupdatecontrol= PROD for production machines: Do not execute > RunRemainingDevUpdates, so only official db revs. This is the default. >[2] devupdatecontrol= RESET: Reinstall dev updates after an official db rev. >[3] devupdatecontrol= ALWAYS: Run the dev updates at each upgrade. >[4] devupdatecontrol=TRACK: Only install new dev updates. It does not reset > the local pref listing all recently applied dev updates. ONLY use this > if you know what you are doing! > >Note: devupdatecontrol is a configuration variable from koha-conf.xml. >If it does not exist or is empty, we fall back to PROD (safest). >If it differs from PROD, ALWAYS or TRACK, it falls back to RESET. > >Note2: Initially, devupdatecontrol was a preference. It has been moved >to koha-conf.xml as requested by several developers (Nov 24). > >Test plan: >[1] Add a few lines calling ExecDBRev to updatedatabase with corresponding > files in atomicupdate like (insert the correct version!!): > ExecDBRev( $aupd, '13068', 'My test', '13068.pl', '3.17.00.028'); > Do not forget to update kohaversion.pl accordingly. > Add some other files in atomicupdate as dev updates. >[2] Repeat for the various modes of devupdatecontrol (see above): > Reset the database version. You could edit Version in local preferences. > Optionally clear/delete the _LocalAtomicUpdates pref. > Run updatestructure and check which db revs and dev updates are run or > skipped. Run it again and check which dev updates are run or skipped. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > debian/templates/koha-conf-site.xml.in | 3 +++ > etc/koha-conf.xml | 2 ++ > installer/data/mysql/updatedatabase.pl | 17 ++++++++++++++--- > 3 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index 26f4e50..48e56c4 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -283,6 +283,9 @@ __END_SRU_PUBLICSERVER__ > <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir> > <use_zebra_facets>1</use_zebra_facets> > <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config> >+ <devupdatecontrol>PROD</devupdatecontrol> >+ <!-- See explanation in updatedatabase.pl --> >+ > </config> > > </yazgfs> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 6f2f8a8..f34e11e 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -119,6 +119,8 @@ __PAZPAR2_TOGGLE_XML_POST__ > <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir> > <use_zebra_facets>1</use_zebra_facets> > <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config> >+ <devupdatecontrol>PROD</devupdatecontrol> >+ <!-- See explanation in updatedatabase.pl --> > > <!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm --> > <ttf> >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index c515b2f..b2181ac 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -50,12 +50,18 @@ use constant ATOMICUPD_PREF => '_LocalAtomicUpdates'; > my $debug = 0; > my $aupd = { #hash for atomic updates > location => C4::Context->config('intranetdir')."/installer/data/mysql/atomicupdate", >+ mode => C4::Context->config('devupdatecontrol') || 'PROD', > remember => C4::Context->preference(ATOMICUPD_PREF)//'', > skipfiles => { > 'Bug-4246-Talking-Tech-itiva-phone-notifications.pl' => 1, > 'oai_sets.sql' => 1, > }, > }; >+# Short explanation of the various dev update control modes: >+# PROD: Only install official database revisions (default and fallback) >+# RESET: After an official database rev, reinstall all development updates >+# ALWAYS: When upgrading, reinstall all development updates >+# TRACK: Do not reinstall applied development updates > > my ( > $sth, $sti, >@@ -9565,7 +9571,8 @@ sub RunRemainingAtomicUpdates { > if( exists $atomicupd->{skipfiles}->{$upd} ) { > next; # Skip official db revision > } >- if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { >+ if( $atomicupd->{mode} ne 'ALWAYS' && >+ $atomicupd->{remember} =~ /(^|;)$upd;/ ) { > #Skip files that have recently been applied > #Note that an official db rev erases this list > print "Skipping $upd as recently applied dev update\n"; >@@ -9623,7 +9630,7 @@ sub ExecDBRev { > print "Dev upgrade $file done\n"; > _atomic_memory( $atomicupd, $file ) if $rv; > } else { >- _atomic_memory( $atomicupd ); #Official db rev clears the atomic pref >+ _atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref > SetVersion($version); > print "Upgrade to $version done (Bug $bugno - $descr)\n"; > } >@@ -9631,6 +9638,10 @@ sub ExecDBRev { > > sub _atomic_memory { > my ( $atomicupd, $upd ) = @_; >+ >+ return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref >+ return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset >+ > $atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; > C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); > } >@@ -9744,5 +9755,5 @@ sub CheckVersion { > } > } > >-RunRemainingAtomicUpdates( $aupd ); >+RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; > exit; >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13068
:
32173
|
32174
|
32175
|
32177
|
32178
|
32179
|
32180
|
32185
|
32294
|
32300
|
32398
|
32399
|
32525
|
32526
|
32658
|
32659
|
32784
|
32785
|
32839
|
32840
|
32841
|
32842
|
32843
|
32919
|
32921
|
33859
|
34070
|
34071
|
34072
|
34949
|
34950
|
34951
|
34960
|
34998
|
35000
|
35001
|
35002
|
35003
|
35366
|
35367
|
35368
|
35370
|
36716
|
36717
|
36718
|
36719
|
36779
|
36780
|
36781
|
36792
|
37061
|
37062
|
37063
|
37064
|
37065
|
37066
|
37075
|
37076
|
37491