r/TrunkbasedDevelopment • • Aug 13 '25

TBD implementation and QA process questions

We are trying to adopt Trunk-Based Development (TBD) to improve stability. Currently, we work with develop, beta, and master branches. We have separate repositories for API, web, and mobile.

Our main pain point right now is that it’s hard to make a release without including code that hasn’t been tested or has failed tests. This happens because once a PR is approved by a partner, we merge it into develop, regardless of whether QA has validated it.

At the moment, the mobile app points to the develop server, which mirrors the develop branch of the API repo. The same applies to web. The current flow is:

•	All developers create PRs to develop.
•	A partner reviews and approves them.
•	Changes are merged and become immediately available to the whole team, including mobile and QA.

Our goal with TBD is to keep main as a stable branch containing only QA-approved code. However, I’m wondering how to handle certain scenarios—for example:

•	Mobile working on a feature that is being developed in API at almost the same time.
•	QA needing to test multiple features, bug fixes, or tasks before they are merged into main and deployed, given that we may resolve several tickets in a single day.

For context, our team consists of 4 full-stack developers and 3 mobile developers. We use GitLab and Jira.

I’ve researched ephemeral environments and feature flags/toggles.

•	Ephemeral environments make more sense to me and I see how they could fit our workflow. Still, they require careful coordination to define client endpoints before merging, because an environment created from a card identifier won’t necessarily match what web or mobile are working on.
•	Feature flags: I understand the general concept but not yet the technical implementation or how they would fit into our desired flow. Many developers work on different bug fixes and features that QA must review before merging and making them available to the whole team.

Most of my questions are related to defining a clear QA flow in TBD. Any guidance would be greatly appreciated.

1 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/martindukz Aug 15 '25

What is gained from having it in different repositories? You are basically one big or two small teams. Maybe you could make it simpler by having in same repository. But only if there is a problem associated with having multiple repositories? Then changes in multiple services then could be handled in same repo or even branch.

Pain points: What are the breaking changes? Are you, as another one writes, able to make it in steps? E.g. A new endpoint which can be QAed, or frontend usage that similarly can be toggled on to the new version in test, but still the old in production.

Regarding unstable code it is about isolating the changes you make via code structure (toggles or branch by abstraction) instead of using source control for it.

What is meant by unstable? If you can have the old code and new code living in parallel, you avoid many of the issues you describe.

Regarding coordinating releases, you can ensure the ground work and have the frontend or similar switch to new API when quality is good enough. But through routing, toggling or similar. Not through branching. You want to have work integrated and QA able to test, without the changes being without a fall back (the current implementation or functionality)

It is a big and diverse set of problems you describe, and a bit too broad to address in detail here.

I think the way forward is beginning to isolate changes through code, not through source control. And then try to get practice integration of changes in smaller increments. Then with that goal in mind, identify what is blocking you from making increments or integrating changes or QA of it. If you find it too difficult to avoid breaking changes, consider why that is. And possibly consider having an alpha customer that gets the version first and stabilisere it before deploying to next.

Let me know if it does not make sense :+)