Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

DB Change Scripts and Releases



  • We have an application with two active releases: 1.4.1 and 1.5.0. The 1.4.1 release is a hotfix of the already-deployed 1.4.0. We also have a SQL change script attached to the application, and tied to release 1.5.0. However, this morning when we executed a build for the 1.4.1 release, the SQL change script for 1.5.0 was executed. I thought by associating the SQL change script to release 1.5.0, it would NOT execute for release 1.4.1, but only for 1.5.0 (or perhaps later releases). Does this not work the way I think it does, or is there a bug?

    This is what our environments look like right now:

    DEV - 1.5.0 (change script for 1.5.0 executed - good)
    TEST - 1.5.0 (change script for 1.5.0 executed - good)
    QA - 1.5.0 (change script for 1.5.0 executed - good)
    STAGE - 1.4.1 (change script for 1.5.0 executed - not good)
    PROD - 1.4.0 (we haven't promoted anything here yet)

    Product: BuildMaster
    Version: 4.1.1



  • Hi Glen. This is the behavior, but you need to reorder your releases. To do this, go to the all release page, select "all" from the drop down. Then you can click the manage sequence button.

    We are going to get improving the auto sequence for newly created releases in a maintenance release.



  • Where is this done? At /applications/{number}/releases/history?

    In my original post I failed to format that list of environments, so here's that:

    • DEV - 1.5.0 (change script for 1.5.0 executed - good)
    • TEST - 1.5.0 (change script for 1.5.0 executed - good)
    • QA - 1.5.0 (change script for 1.5.0 executed - good)
    • STAGE - 1.4.1 (change script for 1.5.0 executed - not good)
    • PROD - 1.4.0 (we haven't promoted anything here yet)

    We've never promoted a build for 1.5.0 to STAGE; we went from 1.4.0 to 1.4.1, so I'm confused as to why a SQL change script for release 1.5.0 would have executed in STAGE.



  • Ok, so I found where to do this, but when I try to reorder the releases, the server returns a "Bad Request" error.



  • hmm... ther emust be a bug somewhere?

    When you refresh page, do releases seemed re-ordered?

    What happens if you drag/drop them in a different way? E.g. 14.1 down vs 15.0 up?

    There is also a API method you can use: [Releases_ResequenceRelease]



  • When I refresh the page, the releases are in the original order (i.e., the changes don't "take"). It doesn't matter if I swap 1.4.1 with 1.5.0 or 1.5.0 with 1.4.1.

    I tried reordering releases in another application and it worked fine, so something about this application and these releases is fubar. Maybe BuildMaster doesn't want me to reorder releases given the current state of SQL change scripts?



  • That would not impact this; i'm guessing there is some bug somewhere, that caused your release sequences to get messed up?

    Basically all that release ordering is doing is the following update statement:

    UPDATE [Releases]
       SET [Release_Sequence] = CASE
              WHEN [Releases].[Release_Sequence] = RTAR.[Release_Sequence] 
                   THEN RPOS.[Release_Sequence]
              WHEN [Releases].[Release_Sequence] BETWEEN RTAR.[Release_Sequence] AND RPOS.[Release_Sequence]
                   THEN [Releases].[Release_Sequence] - 1
              WHEN [Releases].[Release_Sequence] BETWEEN RPOS.[Release_Sequence] AND RTAR.[Release_Sequence]
                   THEN [Releases].[Release_Sequence] + 1
              ELSE [Releases].[Release_Sequence]
              END
      FROM [Releases],
           [Releases] RTAR,
           [Releases] RPOS
     WHERE [Releases].[Application_Id] = @Application_Id
       AND RTAR.[Application_Id] = @Application_Id
       AND RTAR.[Release_Sequence] = @Release_Sequence
       AND RPOS.[Application_Id] = @Application_Id
       AND RPOS.[Release_Sequence] = @Replaced_Release_Sequence
       AND @Release_Sequence <> @Replaced_Release_Sequence
    

    Can you look at your releases table to see the sequences?



  • I went to the Releases table and fixed it by hand, and the sequence is correct now. Thanks.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation