Video in progress

Staff 🌿 Git

How do you build a branch strategy for supporting 3 LTS versions of a product installed at customers in parallel?

A long-lived release/X.Y branch for each LTS, with fixes starting from the oldest version that needs them and merged upward, or going down from main with an automated backport. The main cost is not in Git but in keeping CI, tests and dependency updates alive for every version.

📖 Answer

It is not like SaaS: here a customer may stay on 2.x for two years, and you are obliged to give them security fixes.

The structure:

main ──────────────────────────────►  (next 4.0)
  ├─ release/3.4 (LTS) ──► v3.4.0, v3.4.1 ...
  ├─ release/3.2 (LTS)
  └─ release/2.8 (LTS, EOL 2027-06)

The decisions:

  • Fix direction. A backport bot (it opens a cherry-pick PR based on a backport/3.2 label on the PR) works well in practice: the fix lands on main, the bot opens PRs for the rest, and hands conflicts to the owner. Merge-up works too, but gets harder as the differences between versions grow;
  • What is backported. Only security and serious bugs. If you carry over "small improvements" too, LTS stability is lost;
  • Infrastructure. 2.8 may still be on Java 11 and Spring Boot 2.7. Its build images, its CI runners, and the dependency security updates for them must be kept alive separately. This is where the most pain shows up: you want to put a fix on an old branch, and its build has been broken for six months;
  • Matrix tests. A weekly pipeline runs all the LTS branches, not only when a fix is needed.

The main thing to agree with the business is the EOL dates. Every new LTS version raises the cost of every later security fix, and you should show that with a number.