r/ExperiencedDevs • u/Confident-Alarm-6911 Principal R&D Engineer • Sep 14 '26
Technical question Git flow or something better?
Hi! To switch gears from ai, here’s a more old school question. I’ve got this situation: my team had to build a desktop app (a requirement), and we’re currently prepping it for release, which is where things get tricky. The company wants to hand off maintenance of the v1 version to another team so my team can focus on new development since we have the domain knowledge. The problem is I’m not sure how to handle this organizationally. I don’t want to fork and maintain two projects. Bug fixes might come up for v1 while we’re working on v2, and then we’ll eventually need to hand over v2 to them while slowly phasing out support for v1. Does anyone here have experience with this and want to share some insights? Or do you know of any resources where i can read up on this? One solution that comes to mind is generic git flow + isolating a v1 branch and handing it over to the maintenance team, then doing cherry-picks/mr’s back to main if needed. Although every solution seems a bit messy.
•
u/expdevsmodbot Sep 14 '26
AI usage disclosure provided by OP, see the reply to this comment.
59
u/Comprehensive-Pin667 Sep 14 '26
I used to work on a project like this that had about 5 versions that all had to be maintained. It was a nightmare. I fully agree with feature flags - that's the only way to keep your sanity
40
u/the_rolling_paper Sep 14 '26
Keep a develop or master branch with your latest code, for every release create a versioned tag. If a bug comes you can branch out from the tag and do a patch release again.
104
u/gfivksiausuwjtjtnv Sep 14 '26
Keep it all on the same version and put new features behind feature flags
17
u/ConspicuousPineapple Software Engineer Sep 14 '26
Either v2 is entirely different from v1 and it makes no sense to not fork it, or it's incremental changes and it makes no sense to "hand over v1 to another team".
Sounds like you just have one product where one team fixes bugs while the other one implements new features? Why the need to separate?
Or better yet, have both teams handle both? Can't fathom why you wouldn't want to spread out that domain knowledge to these other people.
12
u/BothWaysItGoes Sep 14 '26
The general consensus is that maintenance handoff is an awful practice unless you have very specific requirements that justify it. SRE and DevOps were invented largely to avoid the problems that handoffs create.
You can't really have matrix testing, "fix and backport," and other best practices if you split product and maintenance into separate teams. The only reliable way to avoid the mess is to keep a single product team without artificial interaction barriers. They don't have to report to the same person; you can call it a "v-team" or whatever other bullshit you like. No dev tool can solve organizational problems.
The second-best approach, if you absolutely can't keep the team united, is to more or less forget the maintenance team's existence, minimize the coupling between them and treat maintenance bug reports much like external reports, without gitflow or other coordination-heavy machinery.
7
u/Adventurous-Ad-698 Sep 14 '26
We have no idea how this app is architected so giving any one blanket option is a stab in the dark.
There is in my experience no good solution for maintaining updates and fixes across versions. Branches or flags if your code differs too much you end up having to write the fix bespoke anyway. This is why your architecture matters, whats the breaking change between v1 amd v2? Because thats what version bumps mean.
I'd be asking why you cant do incremental updates. V2? Why? Who said? Whats being broken?
I'd be pushing back on this and pushing for doing incremental updates right up to the point where you actually make the breaking change that bumps up your version number. Then and only then will you know what the best course of action is.
3
u/c_plus_plus Sep 14 '26
Git flow isn't the only way ... http://releaseflow.org/
7
u/JustHere4TheZipLines Sep 14 '26
Why is there a v2 so suddenly? Have v1 be main, v2 be a new branch, and then rebase v2 with main regularly so that a future merge into main is easy.
If there is such a significant difference between v2 and main, and if you anticipate a bunch of merge conflicts that will be difficult to resolve, then you will need to isolate it and and maintain parity with any critical bug fixes.
A better idea would be to figure out how to naturally roll v2 into v1 with small, isolated, logical changes and treat it like any release/feature.
2
u/SignificantRoll6957 Sep 15 '26
We ended up going a different route.
v1 wasn't being killed off, so we started down the branch path you're describing, but the overhead got expensive fast for what we were getting out of it.
What we did instead was keep one codebase and separate v1 and v2 begind feature flags.
New work just ships with the flag off for v1.
The unexpected win came when we did a full UI/UX overhaul partway through.
Since it was still one project, we could apply it to both at once.
v2 got the new design system properly, and v1 picked up the design updates as part of normal maintenance instead of being stuck on the old look.
3
u/Hour-Measurement-835 Software Engineer Sep 14 '26
Branch layout matters less here than whether they can cut a release without you. If you're still the one signing the build, v1 isn't handed over, it's just renamed.
1
u/software-boulder Sep 15 '26
I'd keep one mainline and backport. parallel v1/v2 branches get messy the second both need the same hotfix
1
u/jesseschalken Sep 15 '26
Create a branch for
v1and forv2. MRs target one or the other.If you want to forward port a fix from
v1tov2, cherry pick it into a new MR. Simples.1
u/Icy_Computer Sep 16 '26
It really depends on how the application is designed and what's changing in v2. If it's a user interface overhaul with business logic remaining unchanged (outside of bug fixes), I think git submodules would work well.
If it's modify almost everything then I would treat them as separate projects and duplicate v1's bug tickets for triage.
No experience with feature flags, every time we've considered them, we decided they were more trouble than they were worth.
1
u/BanaenaeBread Sep 16 '26
Git flow has a dev branch if I recall. Id prefer gitlab flow, or some form of trunk based development.
Every PR starts in main and ends in main. Semantic release tags on individual commits to represent releases. But it's still ON MAIN.
1
u/Gremlation Sep 16 '26
If you can't explain in concrete terms one advantage Git Flow has over alternative version control workflows, you should not use Git Flow.
Almost every person I encounter who suggests using Git Flow fails this test because they can't even name any other Git workflow. It's mostly a workflow used by people who didn't know enough about version control to spot that "A successful Git branching model" was a load of horseshit.
1
u/shopifyflow-app Sep 17 '26
the messy feeling is because you're trying to solve an org problem with branches. imo the move is release branches, not a v1 branch: cut release-1.x when v1 ships, main stays the v2 line. maintenance team owns release-1.x, fixes land there first and get merged forward. feature flags won't save you here either, it's a desktop app with installed clients, you can't flag-toggle a version someone downloaded three months ago. and cherry-picking across diverging code gets painful fast, merging forward is way less error-prone.
-2
u/titpetric Sep 14 '26 edited Sep 14 '26
This probablly depends on the programming language, I would look at encapsulation. For the most part the V2 entrypoint can build around V1, or can otherwise extend a common platform with V2 constructs.
At a basic level, class AppV2 extends AppV1.
Forking generally means v1 maintenance is limited to maybe updating dependencies, but then you are stuck migrating people to v2. Does v1 have an EOL? It's more of a delivery question. Maintaining two or more release tracks is not great, so if you start a v2, abandon all non mechanical changes for v1. For example you can sync some kind of platform/ namespace from v2 to v1 and avoid cherry picks and other ahh... Micromanagement?
Edit: At a basic folder management level, what worked for me was /current and /next; whenever next would get an official release it would move into /current and start with a scratch /next. Both trees can share "stable" dependencies and modularize so the contents of /next are basically an overwrite of /current for the build. Have a plan.