Search code examples
visual-studioazuretfsdevopsalm

Azure PaaS and ALM - how to handle branches with single-click Publishing?


Right now I have an Azure PaaS solution with a single repo in TFS - we right-click publish from VS to an App Service and then swap slots to get code to production. Small team, disciplined check-ins (or so I thought), etc.

I made a decision to check code in that wasn’t production ready, thinking if needed, I could roll back and publish a hotfix should the need arise.

Well, the need has arisen and I've rolled things back to apply the fix. This was a bit of a headache though.

I’m a little unclear on what the right thing to do is moving forward. What I want to try is:

  1. Create a branch from our MAIN repo and stick all ongoing development there, call it DEV. We'll create two workspaces on our machines - one for each branch.
  2. When we're ready to push a feature, merge down to MAIN and then QA before right-click publishing > Staging > Prod.

At a high level, does this seem like a step in the right direction?

What I’m trying to do is keep this project/alm lean and simple. I don't want to go as far as introducing a build server with RM and other expensive (time, materials, process) components - I just want a sensible, incremental upgrade in the maturity of our current setup to avoid the above headache and this is all I could come up with.


Solution

  • That's two way for your reference, one base on the working flow , one base on the publish (releaseing)

    A. Just using mainline and tagging for release

    Pros:

    • Avoid merge hell.
    • Keeping to the mainline encourages some best practices like proper release planning, not introducing a lot of WIP, using branching by abstraction to deal with out-of-band long term work, and using the open closed system and configurable features for dealing with managing works in progress that may; or may not; need to be disabled now or in the future in order to release or to avoid a full rollback.

    Cons:

    • Dealing with works in progress becomes an issue and adds to potential surface attack area when it comes time to release. However, if your developers are disciplined then new features should be configurable and modular and therefore easily disabled/enabled, or there is no WIP and at each release point all work is either completed or has not yet been started (i.e. Scrum).
    • Large scale/out-of-band changes require more thinking ahead of time to implement.

    B. Branch by release

    Pros:

    • You can begin working on the next iteration while the current iteration finishes its round of acceptance testing.

    Cons:

    • Tons of branches.
    • Still need to tag branches at release points.
    • Still need to deal with WIP and merge WIP from previous release branch into next release branch if it's not going to make it and still need to disable or yank it of release branch and re-run acceptance tests.
    • Hot fixes need to be applied to more branches (release branch + hotfix + new tag merge hotfix into vnext branch and possibly vnextnext depending on where the hotfix fails.)