3

as per my current requirement. I would like to maintain common source code for different country releases.

Below are the cases which are required to be covered in the new process of code manage.

  1. Release new feature for one country only and once that feature works perfectly we will release that feature in other country as well.
  2. bug fixed on all countries at the same time.
  3. Some features are related to few countries only while other countries wont have that features.

By all above criteria I think I need to manage different repository for all the possible countries but that will create a duplicate of code. At the same time if we have any bug I have to do it in all the branches. Is there any way that I can manage it by common code.

BobDalgleish
  • 4,644
  • 5
  • 18
  • 23
  • It's usually something that's done during the build process, or the release stage. If you're shipping a software, you could disable the features by using a config file. If you're shipping a library, you could choose not to compile the new feature for a certain country, for instance if you were using C++, you could use preprocessor directives. There's not a lot of information in your post to give a clear answer, but you're right that whatever solution you choose, you should only have a single repository/branch. – Vincent Savard Apr 08 '19 at 13:04
  • actually we are already in source control and we follow branch for any large release right now. once the release is done we merge that branch in trunk. Now we have distributed the architecture to multiple countries. so now we will release the feature country wise. Some country can get the feature earlier or some country wont get that feature at all. With that we also need to fix the bugs which are coming in between for different country. it this description cleared my requirement ? – Chirag Babaria Apr 08 '19 at 13:10
  • 4
    Possible duplicate of [Source/Version control for application used by multiple companies](https://softwareengineering.stackexchange.com/questions/133485/source-version-control-for-application-used-by-multiple-companies) Assume those different companies in different countries, then it is essentially the same question. – Doc Brown Apr 08 '19 at 15:41

1 Answers1

6

Your version control shouldn't matter.

This is an issue that should be dealt with at deploy-time. Implement Feature Toggles in your project, controlled by a config file. When you deploy to Country A that needs features X and Y turned on but not Z, your deploy tool provides a configuration file that has X and Y set to true, but Z set to false. And similarly for other country deploys. This has some notable advantages:

  1. Features can be turned on or off really simply - they don't need a code change, just a config (and possible server reboot or redeploy, depending on infrastructure/architecture).

  2. You get to keep all your code in one codebase still. Which importantly means bugs are always fixed at the same time (since it's the same codebase)

The first is definitely the more important of the two - since that one solves your immediate concern about country A having features [X,Y] and country B having features [Z,X,S]. But it also lets you turn features on/off for other reasons. E.g. if you release feature H to a few countries but find that it's crashing machines or deleting accounts or whatever, you can quickly and pretty painlessly shut that feature off (and then fix). Or if a client requests feature V for their region, you can do that (after the go-ahead from legal, etc.).

Delioth
  • 433
  • 4
  • 8