-
Notifications
You must be signed in to change notification settings - Fork 2
Description
To support "LTS"--or long-running releases--we will need to make some development workflow changes.
In terms of a branching strategy, I'm thinking the most reasonable approach would be trunk-based development, which I had experimented with before without knowing what it was called. Node.js uses something very similar to this.
In a nutshell:
- all development work is done targeting
master
(except in the case that the bug cannot be reproduced inmaster
; it then must happen on release branches) - each LTS release (e.g., each major or even-numbered majors) branches from
master
- bug fixes, features, etc. are cherry-picked from
master
into the release branch - releases are tagged from the release branches, not
master
- "feature" branches exist how we've been doing them--no change here. these are any short-lived branches to be rebased onto
master
and merged via a PR. note that this includes bug fixes, "chores"--pretty much anything. - in the case that work must be done against a release branch, a PR should target that branch, and cherry-picked from release into
master
, if it makes sense. - at no point is a release branch ever merged back into
master
.
In addition to whatever we're going to get from users reporting bugs against multiple release lines, this is the overhead we're looking at for LTS releases. There are some tools available which we can either use outright or adapt for our uses (from the Node.js project), but we may need a purpose-built solution. For example, it'd maybe make sense to automatically attempt cherry-picking of new changesets in master
into the active release branches.
(AFAIK, cherry-picking is used because otherwise each changeset in master
would create an extra merge commit when pulled into an active release branch.)
A noted headache is cross-referencing changesets with their original PRs (due to the loss of context created when a changeset is cherry-picked instead of merged). It becomes critical to link to the PR number somewhere in the commit message. Of course, you can't add the PR to the commit message when you create a changeset, so the commit message must be amended at time-of-merge. Node.js also has tooling (and a convention) around this.
Another unconventional way to tackle this is to literally snapshot the codebase for each release line and stuff it in some subdirectory. I'm pretty sure I didn't just dream this up. Anyway, I don't think the tooling's there to support this sort of thing, though at its core, it sounds similar to a monorepo. The major challenge would be to coordinate patch application across multiple directories, assuming something like Lerna could manage the rest of it. While the above branching solution is non-trivial, I still don't see a clear advantage; both will require tooling.
cc @mochajs/core