[Rt-commit] rt branch, 4.2/avoid-migration-upgrades, created. rt-4.2.1-44-gb47dee7

Kevin Falcone falcone at bestpractical.com
Wed Nov 27 18:32:40 EST 2013


The branch, 4.2/avoid-migration-upgrades has been created
        at  b47dee74d715e11394ef401d24f5042637ccf2a3 (commit)

- Log -----------------------------------------------------------------
commit eb6e4052adb653a031e009aadb510c4888a12679
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Nov 27 18:25:38 2013 -0500

    Don't run upgrades unless this is an incremental serialization.
    
    If you're running serializer on 4.0.x, this code would try to apply all
    the upgrade steps up to 4.2.y before writing out the object.
    
    Instead - limit to the current RT version.

diff --git a/lib/RT/Migrate/Serializer.pm b/lib/RT/Migrate/Serializer.pm
index 6e43cfc..0d13b5b 100644
--- a/lib/RT/Migrate/Serializer.pm
+++ b/lib/RT/Migrate/Serializer.pm
@@ -112,6 +112,9 @@ sub Metadata {
     # Determine the highest upgrade step that we run
     my @versions = ($RT::VERSION, keys %RT::Migrate::Incremental::UPGRADES);
     my ($max) = reverse sort cmp_version @versions;
+    # we don't want to run upgrades to 4.2.x if we're running
+    # the serializier on an 4.0 instance.
+    $max = $RT::VERSION unless $self->{Incremental};
 
     return {
         Format       => "0.8",

commit b47dee74d715e11394ef401d24f5042637ccf2a3
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Nov 27 18:28:21 2013 -0500

    Noticed when running rt-serializer on 4.0 and incremetal upgrades ran.
    
    $ref is a hashref, not an object, so you need to access {Domain} not
    call the Domain method.

diff --git a/lib/RT/Migrate/Incremental.pm b/lib/RT/Migrate/Incremental.pm
index 1ed9aca..d333afc 100644
--- a/lib/RT/Migrate/Incremental.pm
+++ b/lib/RT/Migrate/Incremental.pm
@@ -525,7 +525,7 @@ s!(?<=Your ticket has been (?:approved|rejected) by { eval { )\$Approval->OwnerO
         'RT::Group' => sub {
             my ($ref) = @_;
             $ref->{Name} = $ref->{Type}
-                if $ref->Domain =~ /^(ACLEquivalence|SystemInternal|.*-Role)$/;
+                if $ref->{Domain} =~ /^(ACLEquivalence|SystemInternal|.*-Role)$/;
         },
     },
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list