SVN Source Control of Database Objects - What Prevents a Bad Overwrite in this Case?

  • Odd as it may seem, I'm a bit light when it comes to using SVN correctly for source control of database objects and need some help with understanding what happens in the following situation (time proceeds from left to right on this chart).

    A

    -----------\-----------B------------------/--------> Trunk

    \ /

    \------------------C-------/ Branch

    D

    A. Folks are doing their normal thing on the Trunk and finally get to a point (A) where they call for a code freeze for a revision branch. The branch is created. No biggee, so far.

    B. While they're doing final QA/UAT Testing on the branch, an "emergency/immediate repair" needs to be made directly to a production stored procedure at point (B) and it's checked into the Trunk. Again, no biggee but I can see a problem coming because the branch has that same stored procedure in it.

    C. During the latter QA/UAT Testing, a fault is found in the stored procedure in question and is successful repaired, retested, and checked into the branch at point (C).

    D. Testing passes on the branch at point (D). Now what? I've been led to believe that what's in the branch is what's supposed to be promoted to production and that makes no sense to me because it's going to miss the fact that a change was made outside the branch at point (B).

    My thoughts and the real question...

    1. Is SVN smart enough to tell folks that there's a conflict when folks try to check in the proc at point (B) because there's a branch in process? If so, can the change at point (B) be merged into the branch (which I realize could be painful depending on what the changes actually were)?

    2. If (A) above is how it works, then we're good to go and I have no further question. If it doesn't work that way, then what happens? How do you keep an important change in production from being overwritten? What is the process to make this a happy event rather than an "Aw crud!" event?

    Also, I've looked and I'm still looking but if you have a good link on how to use RedGate Source Control for databases in conjunction with SVN (or standalone?), that would be incredibly helpful because I've not yet found one that explains situations like this.

    Thanks for the help folks. I appreciate it.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (10/18/2016)


    1. Is SVN smart enough to tell folks that there's a conflict when folks try to check in the proc at point (B) because there's a branch in process? If so, can the change at point (B) be merged into the branch (which I realize could be painful depending on what the changes actually were)?

    SVN is even smarter than that. It can tell that there have been changes to the same file from two different sources, and it can tell when the two changes conflict, but it's also smart enough to tell that the changes do not interact in some cases. And yes it can be a real pain to resolve conflicts in merges.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • drew.allen (10/18/2016)


    Jeff Moden (10/18/2016)


    1. Is SVN smart enough to tell folks that there's a conflict when folks try to check in the proc at point (B) because there's a branch in process? If so, can the change at point (B) be merged into the branch (which I realize could be painful depending on what the changes actually were)?

    SVN is even smarter than that. It can tell that there have been changes to the same file from two different sources, and it can tell when the two changes conflict, but it's also smart enough to tell that the changes do not interact in some cases. And yes it can be a real pain to resolve conflicts in merges.

    Drew

    If you want to follow the theory - first you merge the main branch with the B change into the C branch, test it thoroughly and then merge the finalized C version back to the main branch (essentially at that point, you're making the B+C branch your new main). But yes as Drew mentioned, svn is plenty smart enough to handle the merging.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • drew.allen (10/18/2016)


    Jeff Moden (10/18/2016)


    1. Is SVN smart enough to tell folks that there's a conflict when folks try to check in the proc at point (B) because there's a branch in process? If so, can the change at point (B) be merged into the branch (which I realize could be painful depending on what the changes actually were)?

    SVN is even smarter than that. It can tell that there have been changes to the same file from two different sources, and it can tell when the two changes conflict, but it's also smart enough to tell that the changes do not interact in some cases. And yes it can be a real pain to resolve conflicts in merges.

    Drew

    Thanks, Drew. That brought up another question but Matt somehow read my mind and answered it.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Matt Miller (#4) (10/18/2016)


    drew.allen (10/18/2016)


    Jeff Moden (10/18/2016)


    1. Is SVN smart enough to tell folks that there's a conflict when folks try to check in the proc at point (B) because there's a branch in process? If so, can the change at point (B) be merged into the branch (which I realize could be painful depending on what the changes actually were)?

    SVN is even smarter than that. It can tell that there have been changes to the same file from two different sources, and it can tell when the two changes conflict, but it's also smart enough to tell that the changes do not interact in some cases. And yes it can be a real pain to resolve conflicts in merges.

    Drew

    If you want to follow the theory - first you merge the main branch with the B change into the C branch, test it thoroughly and then merge the finalized C version back to the main branch (essentially at that point, you're making the B+C branch your new main). But yes as Drew mentioned, svn is plenty smart enough to handle the merging.

    Heh... still reading minds, I see. That was going to be my next question. Thanks, ol' friend.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply