leokhorn
leokhorn

Reputation: 507

SVN structure for deploying features and fixes to test and production in any order

The situation

For example purpose, the following situation can be considered:

Everything below has happened since the beginning of Feature A:

We might end up having to put Fix D in production, then Feature C, then Fix B... but maybe it's going to be Fix D, then Fix B, then Fix E, then Feature C. And who knows, maybe Feature A will go smoother than expected and will have to be released before some of the other bits.

How would one deal with this many parallel developments in SVN and when deploying? I'd interested in what one would commit in which branches, what might end up in the trunk, and deployment steps when any of these is ready for production, knowing that in our environment we do not really feature-freeze anything and any fix or feature, if ready, is likely to be pushed to production (I'm not sure this is great either -- if you think this is the root of our deployment issues, do tell).


The context and current solution

Our team uses three environments: development, test and production. We use a SVN repository for the web application with the usual(?) structure: trunk, branches, tags.

Our current method goes like this:

While this has worked for a while, the current situation makes it rather unmanageable. There are at least 3 different fixes that were committed to trunk but need to be tested before going to production. Since development and test working copies point at trunk, all the fixes are available for testing (no problem there). There are also 2 branches that need testing before going to production. With the current method, they would need to be merged into trunk which is problematic if they turn out not to be ready.

A frequent situation is that bug fix A is ready for testing before bug fix B (and committed in that order in trunk) but bug fix B ends up tested first (client priority) and needs to go to production right away.

Oh and we don't have test suites on this application because it's a huge legacy codebase and there is not time alloted to creating tests. As such, committing to trunk "when it's done" is mostly based on gut feeling.

Upvotes: 2

Views: 309

Answers (1)

mounds
mounds

Reputation: 1383

Sounds like you need to:

A) introduce release/integration branches:

  • create a branch for the 'next release' from a trunk revision at which you are certain all changes at that point are ready for release.
  • test against the release branch
  • 'hotfixes' can bypass this branch (see below)
  • new features and trunk revisions can be merged or cherry pick merged into the release branch if required.
  • once tagged and released, reintegrate the branch with trunk and delete it.

B) create Tags for fully tested releases

  • Once the release branch is prod ready, tag it, and svn switch production to the new tag

C) create Hotfix branches for emergency fixes:

  • create a hotfix branch off the most recent released tag.
  • commit the fix
  • tag it (ensuring the label indicates the released version is still prior to that 'next release'. Eg. If the next release is 1.1, and the hotfix was branched from 1.0, make the hotfix release tag 1.0.1

Upvotes: 1

Related Questions