Search code examples
asp.net-mvcversion-controlazure-devopsazure-pipelines-release-pipelinefeature-branch

Partial deployment using VSTS builds - source control strategy


I am building a VSTS build pipeline for continues integration and deployment of a MVC web project. My client wants 0 down time in case of continues deployment so we have considered restructuring the source control strategy and split the single code repository to following:

Core features

  1. Feature 1
  2. Feature 2 .....
  3. Feature n

We are planning to keep features as child branches of Core feature and place individual build templates for each of the branch and sub-branches. So the ideal scenario is that if there is any change in core feature branch, the build should be deployed with full code ( branch + sub-branches) but if only 1 feature branch is changed, the continues deployment will be executed only for that branch or the feature in the branch.

So the questions which need some guidance are: -

  • Is the idea of feature branching is fine and can be used on production?
  • The .Net MVC application is n-tier application which has web tier, service and repository tiers. Shall I split the service and repository layers also in the core and feature branches to make it separated?
  • If I split the service and repository, how should the communication happened between the different features:

  • Via service to service calling? Like if feature 1 requires some functionality of feature 2, the feature 1 service calls feature 2 service and merge the result to send it to feature 1 GUI?

  • Feature 1 repository calls feature 2 repository, but this approach will bring dependency of feature 1 on feature 2 means if feature 2 is down at the time of deployment, feature 1 is also experience errors.

  • Splitting repository to several features is a good idea?

Thanks


Solution

  • Splitting repository to several features is ok, because they could be used in other apps (e.g. mobile app)

    I recommend that you can consider VSTS Packages feature or other 3rd package feed. The workflow:

    1. Push changes to server > Trigger CI build> Pack and publish package to VSTS feed by using NuGet task
    2. Install necessary packages to the web project and coding.
    3. Push changes of web project to server > Trigger CI build with current installed package (Do not update package)
    4. Update necessary package to the web project for new feature
    5. Push changes of web project to server > Trigger CI build