Promoting code with Subversion

I am working on porting our development team to Subversion and improving the structure and processes of the repository. We mainly use the standard setting for trunks / branches / tags. It was originally planned to use the branch strategy (branches / 1.0, branches /2.0, etc.), but now I am leaning towards a model for promoting code (test and production units). It's a little better and intuitive how our team works, but the releases will be a little less straightforward: we need a test branch to become a manufacturing industry. (A production branch is always available for maintenance releases, but a test branch should not exist between deploying one version and the next ready for testing.)

Can anyone using code promotion recommend a better way to implement industry promotion from test to production? I believe that these are my options, but I do not know if they have the main pros and cons:

but. Fully merge the test branch into the production branch, delete the test branch
b. Delete production branch, copy production test, delete test branch
from. Delete production branch, rename test branch to production

Thanks for any advice!

+6
svn
source share
6 answers

first: option b) and c) are the same in subversion, since renaming subversive objects actually copies and deletes.

This says that you have only two options:

  • Fully merge the test branch into the production branch, delete the test branch

    This is a clean path in terms of subversion. You can see in your svn magazine which versions were merged into production, and the workboy everybodys remains untouched.

    But it comes with a price: you must manually perform the mergers and resolve potential conflicts (if changes occur in the productionbranch).

    However, you can do this with a bit of overhead.

  • Delete production branch, rename test branch to production

    This is an easy way because you just perform a very small operation that is scriptable.

    Disadvantages:

    You will invalidate all working models that pointed to testbranch (which became a product!)

    Tracking mergers is much more complicated, as you cannot easily browse through an old production branch. Direct changes in the manufacturing industry are lost (without notice)!

Also keep in mind that you may not want all the commits in testbranch to be in production (why did you test if all goes well?). Therefore, I highly recommend option A

+2
source share

I always thought of branches as short, and all my releases are actually in the tag folder. When corrections are needed for a specific release, the tag is copied to the branch, work is done, and a new tag is created. I am curious to find out if anyone has a different approach.

+2
source share

Your production branches should remain intact. Call them their release number. ProductName_Production_ {main}. {Secondary}. {} Minor. As you move from test to production, you create a new production branch with the latest version number. Delete the test branch if you want, but you can handle it the same way.

As part of my build process, I usually loop the current production before deploying the next release so that it can then be returned to the latest stable version. Just fyi.

I don't use branches in this way at all. I keep every iteration labeled so that I have all of them. I use my environments to promote code from test, to qa, to performance testing, production. Ziping every package along the way for rolling back features.

+1
source share

In fact, we do not distinguish between the main working branch and the testing branch at the level of code version control, but this makes sense to me.

I would really go for an approach like

  • Main
  • test branch
    • test
  • production branch (would use a tag folder for them)
    • production1.0

When the test is completed, you will copy it to the new folder / branch production1.1.

0
source share

I create a tag from any branch or trunk for each version.

  • tag / 1.0_tc1
  • tag / 1.0_tc2
  • Tag /1.0_rc1
  • Tag /1.0_ga

If rc1 is acceptable, you just mark it as 1.0_ga

0
source share

Why does code migration happen at all? Create a migration!

For over 4 years we have used only branches. We took the trunk and made our first branch, called RB-2013.07.0.x. This branch is a branch of Release for July 2013. We locked the truck, so no one could make changes to it. All changes were made to RB-2013.07.0.x. As soon as the July release was completed, we blocked RB-2013.07.0.x, so there were no changes in it.

At the same time, we also created an affiliate RB-2013.09.0.x for the September release from Trunk. The developers worked on the September release, working on the July release.

After the release of July in PROD, we combined RB-2013.07.0.x into RB-2013.09.0.0.x. We never returned to the Trunk. We never migrated anything. And after 4 years we never lost any code, and when you looked at the project, you knew exactly what the branch was for.

If you have a problem with prod (hot fix), you should take the current version of prod - say RB-2013.07.x and create a branch RB-2013.07.1.x, make changes, deploy to prod, lock the branch and merge the branch into the upper ones branches - RB-2013.09.0.0.x. Thus, you will have everything up to date.

Keep in mind, every assembly we made, we created a TAG and saved it in the TAGS directory.

In the lines we made, we added the version number from SVN to the last part of the build number.
The build will go from the developer to check before UAT / pre-prod and then to prod. If you want to know what code was in each assembly or branch, go to SVN and retrieve the list of logs.

0
source share

All Articles