TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's your branch and merge strategy till production deployment?

11 pointsby sunasraalmost 7 years ago

3 comments

akuji1993almost 7 years ago
Usually it&#x27;s<p>&gt; master (used only for deploying on prod)<p>&gt; dev (used for merging feature branches into the &quot;new&quot; master branch that&#x27;s going to be deployed in a few weeks)<p>&gt; feature-branch (based off of the current dev build, getting merged back into dev when it&#x27;s finished)<p>We usually have a prod machine and a test machine running, the test machine usually runs dev for QA to test out the future build. If we need to test a feature branch before merging, we&#x27;re deploying that one there instead and swap it out for dev when the test is finished. This model obviously only works with a finite number of developers up to a certain point. But for us this is enough to be productive and not get into each other&#x27;s way when developing multiple features.
bitherdalmost 7 years ago
We &quot;Feature branch.&quot; With a twist on some of the busier repositories. We have a repository per application. We use Subversion (VisualSVN the Windows port)<p>1. Branch current live revision from Release to branches&#x2F;ticket-ref (Our Release is what others may call main, trunk or master)<p>2. Work on feature.<p>3. Code review.<p>4. Merge to Release, CI (Jenkins) picks up change and builds NuGet package(s) pushes them to Octopus Deploy<p>5. Deploy into Test environment<p>6. QA pass&#x2F;reject<p>7. If reject go back to 2.<p>8. If pass Deploy to production (single click in Octopus Deploy)<p>9. The twist for busy repositories with lots of changes: Cherry-pick merge to a Stable branch, which CI builds and pushes to Octopus Deploy Live channel<p>10. Deploy to production<p>Biggest issue we have is concurrent features x y z all being worked on, x y z are all deployed in test environment, y is passed by QA but can&#x27;t be deployed because that versioned package also contains x which is rejected, so has to wait until x is fixed, which will then of course contain z. This is only really a problem when we want to get an emergency hotfix w into production. Right now we have to revert x y z from the Release branch, merge w build and deploy then put x y z back in.<p>This has taken 2 years to perfect so far. Changes we are considering:<p>a) Jenkins plugin that automatically creates a build configuration the moment you create a feature branch in SVN, this way we can keep x y z in separate versioned packages (I personally feel this is not true &quot;integration&quot; because you are keeping things separate.<p>b) Feature switches. So if y is good but x and z are not ready we just deploy with those features switched off.<p>We deploy on Tuesday&#x2F;Wednesday&#x2F;Thursday most weeks, never Friday - Monday.
shooalmost 7 years ago
I don&#x27;t argue the following is good, but it&#x27;s what&#x27;s been done for a couple of years for an internally used line of business app with a sole enterprise owner&#x2F;client. Release frequency is roughly fortnightly for feature work.<p>there&#x27;s one main team git repo for application code, people push feature branches into it, then there&#x27;s code review (gitlab with automated pre-merge runs off the unit tests) and automated post merge runs of all the automated tests (takes more like 1-2 hours).<p>dev - main integration branch<p>feature&#x2F;$ticket - branched off dev, typically merged into dev after code review but before serious testing or uat<p>master - dev is merged into master infrequently, when we have dev branch in a state that plausibly resembles releasable software.<p>We can build deployment packages from any branch, but typically build packages from dev branch to deploy into test environments. When we merge dev into master, build a package from master, then do full dry run of release into staging env before deploying same package to production.<p>What doesn&#x27;t work so well:<p>* Same issue as bitherd&#x27;s comment: since features are merged into dev branch before manual QA&#x2F;uat process, quite often dev branch contains mix of new changes that are good to release, and changes that are broken and block release from that branch. there is increasing automated test coverage to catch some of this, but historically culture was not to write automated tests and try to manually test everything (yup, that doesn&#x27;t scale for regression testing).<p>* because of above, when the current date is a week or less from a planned prod release, devs cannot merge new feature branches into dev branch unless they are small patches to stabilise dev. This could be trivially avoided by forking release branches off dev branch and using these to stabilise to decouple from dev branch, but we never started doing that...<p>* i lied by omission earlier: instead there are actually multiple &quot;dev&quot; integration branches , say dev dev2, targeting different release dates. When we are gearing up to do a release from dev branch then more experimental changes that haven&#x27;t gone through uat can be merged into dev2 targeting a later release date. dev is merged into dev2 every day. After a release dev2 is merged into dev. the worst it ever got was dev, dev2, dev3 and devbarr when there were large batches of features that had been planned and were in some state of contruction but stakeholders weren&#x27;t yet agreed should be released for consumption by users. At some point obviously you can&#x27;t kid yourself this is continuous integration, is continuous something but not integration.<p>* I lied by omission earlier - above is what we do for application code, we have multiple other repos (related to Jenkins build scripts, per-environment configuration) where we more or less just feature branch off master, merge into master and try to keep master stable.<p>We&#x27;re in a place now where in principle we could bake a package off any random branch and deploy it to prod environment in about half an hour (without testing and with an outage), so even though some parts of our branching strategy are not ideal probably the main blocker to a higher release cadence is just getting the different stakeholders (business, users, support, ops, dev, change management approval process) to agree to it.