Android — Trunk based development

Ewen Dandelion Mackenzie
2 min readJun 2, 2022
Photo by eberhard 🖐 grossgasteiger on Unsplash

One branch to rule them all, one branch to find them, One branch to bring them all, and in the darkness bind them; In the Land of Development where the shadows lie.

If you are here, maybe you have already tried Gitflow for some time now and do not feel comfortable maintaining release, feature, and master branches. Cherry-picking commits all over the place only to find out that the particular golden feature got broken due to a merge conflict resolution or some rebase overriding the history and “losing the change.” (well, that one is on you, actually)

Code maintenance

Multiple branches mean multiple problems

You got assigned to this new brand team and need to develop a new feature, and so do other teams. How do you integrate after six months?

Gatekeeper bottleneck

When everything stops making sense, people get assigned to make sense of it. Then the overhead starts.

You need to merge quickly and fix faster. Only when every team member is involved and committed to performing quick code reviews and accepts or declines a delta change.

Feature development

New features

Through feature flags to hide/avoid a particular flow. If the login flow is not complete yet, that’s ok. It’s still merged into the main branch but hidden from the user.

Do you need a complex feature board? No, use the existing debug and release build types to toggle feature/flows on and off.

Fixes and hotfixes

If you need to fix something, at least you know where to fix it and where the fix is.

Releasing

Release frequently

It would be best to shorten the release windows to a couple of times a day or weekly.

Test Continuously

Make sure you have a nice and tidy integration suite set up.

Takeaway

There is no silver bullet. Always do your research on which toolset is best for you. Do you happen to have a different way or approach?

--

--

Ewen Dandelion Mackenzie

Things I love doing: feeling the wind when riding my longboard and writing great software.