0

When using a git strategy similar to gitflow, can feature flags totally replace the Hotfix Release branch process?

When seeing bugs in production, we first make the change in the develop branch and test it. Then, we also merge fixes into the release branch or create a hotfix branch. Merges and cherrypicking are prone to errors, or people forgetting to place in code properly.

We have a release branch since some modules are not ready and we don't want them showing in production.

We are thinking of trying feature flags to replace the release and hotfix branches, allowing us to deploy daily. Leaving us with only a develop and master branch. Would this strategy make sense?

0

    1 Answer 1

    3

    Feature flags can't fully replace a hotfix process.

    You probably won't be putting every single change behind a feature flag. That would greatly increase the complexity of the code as well as the management of the state of all of those flags. In addition, some changes can't easily be put behind feature flags, such as dependency updates and infrastructure changes. You need to balance the complexity of the code, the performance impacts of checking for feature flag status, and the benefit of using and managing the flag.

    In some cases, though, feature flags can reduce the need for hotfix branches. Techniques such as feature flags, canary releases, and dark launching can help if you find yourself frequently hotfixing. Dark launching can help find potential performance issues in backend API calls before you display the results of those calls to users in the UI, especially if you have robust monitoring set up on the application and infrastructure. Canary releases roll out changes slowly so that if there is a problem, it affects a small subset of users. You can couple both with feature flags, especially of a more dynamic type that doesn't require a redeployment, to be able to disable functionality quickly if your monitoring or canary users report problems. By turning off the functionality, you ensure that your system is stable and you can take your time with a fix.

    I'm sure that canary releases, dark launching, and feature flags are three of the enablers behind deploying many times in a day. Netflix has a microservice architecture, so deploying new services or very small backward-compatible changes to existing services at an API level can also promote rapid deployments. Generally, though, they probably aren't cherry-picking code but rather focusing on moving forward and frequently deploying a branch that passes automated testing

    5
    • interesting, curious how other large software tech companies, if they are merging/cherry picking code all day, and how do theyDeploy several times a day? We have 100 plus developers, and the merging/cherry picking, committing, testing between two Git branches can get messy, error prone, time consuming,I was hoping feature flags would one all solution, but guess not thanks, zdnet.com/article/…
      – user375708
      CommentedOct 4, 2020 at 20:10
    • "Amazon, Google, and Netflix that deploy thousands of times per day, aggregated over the hundreds of services that comprise their production environment", I wonder if they manually cherry pick and merge code all day
      – user375708
      CommentedOct 4, 2020 at 20:12
    • @MarkThomas52 I'm sure that canary releases, dark launching, and feature flags are three of the enablers behind deploying many times in a day. Netflix has a microservice architecture, so deploying new services or very small backward-compatible changes to existing services at an API level can also promote rapid deployments. Generally, though, they probably aren't cherry-picking code but rather focusing on moving forward and frequently deploying a branch that passes automated testing.
      – Thomas Owens
      CommentedOct 4, 2020 at 21:16
    • I think the last sentence above may have answered my question, "Generally, though, they probably aren't cherry-picking code but rather focusing on moving forward and frequently deploying a branch that passes automated testing." , I need to convince our clients to allow us to test a/b canary releases, and let us move forward in a good path, rather than cherry pick code all day, appreciate it
      – user375708
      CommentedOct 5, 2020 at 2:40
    • 1
      @MarkThomas52 They don't deploy the same program 1000 times. They deploy 100 programs 10 times each.CommentedOct 5, 2020 at 15:08