-
Notifications
You must be signed in to change notification settings - Fork 0
Branch Strategy
Last synced from
docs/engineering/process/branch-strategy.mdon 2026-08-05. The repo file is the source of truth. If the two diverge, follow the repo.
This page explains the branch strategy used by @deessejs/fp: what each
branch is for, who protects what, and who reviews what. It is conceptual, not
operational: there are no shell commands here. The operational details live in
the Release Process, Hotfix Flow, and
Canary Snapshots pages.
Outline
- The branch model
- What each branch is for
- Who protects what
- Who reviews what
- The flow
- Why this model
- Related documents
The repository uses three long-lived branches:
main <- staging <- dev (conceptual)
──── ─────── ───
stable integration work-in-progress
-
mainis the source of truth. Every commit onmainis either a published version or about to be one. -
stagingis the integration branch. Most pull requests targetstaging. Merging tostagingdoes not publish; it accumulates changes until a release is cut. -
devis a conceptual name for the collective per-feature work-in-progress. It is not materialized as a long-lived branch. Feature branches (feature/*) and fix branches (fix/*) targetstagingdirectly.
The main <- staging <- dev model is a conceptual hierarchy, not a strict
data-flow rule. Code flows from feature branches to staging, then to main
via the Version Packages PR. Hotfix branches skip staging and target main
directly.
- Holds the latest published version of
@deessejs/fp. - Receives two kinds of merges: the Version Packages PR (from
staging) and hotfix PRs (fromhotfix/*branches). - Every push to
maintriggers the Release Process. A push that introduces a Changeset file publishes a new version. A push that does not introduces a Changeset produces no release (the workflow detects and skips). - Protected by GitHub branch protection: PR required, no direct push, no bypass.
- Holds the integration of all in-flight changes.
- Receives merges from
feature/*,fix/*, and follow-up PRs (for hotfixes). - Does not trigger the release workflow on its own.
- A Version Packages PR is opened (or updated) automatically by
changesets/actionagainstmainwheneverstagingaccumulates changes. - Protected by GitHub branch protection: PR required, no direct push, no bypass.
Branch protection will also require the
changeset-checkCI job once #389 lands.
- Not a long-lived branch. The name refers to the collective set of feature branches, fix branches, and WIP work that has not yet been merged.
- In the senior plan,
devis preserved as a conceptual placeholder. Thefeature/*andfix/*branches targetstagingdirectly. This avoids the operational cost of a third long-lived branch that would need its own protection rules and its own CI runs. - If a project needs a long-lived
dev(for very long-lived experiments, for example), the model extends naturally:devbecomes a real branch, feature branches targetdevfirst, then a merge fromdevtostagingaggregates before the release.
-
feature/*— new features. Targetsstaging. Created fromstaging. -
fix/*— bug fixes. Targetsstaging. Created fromstaging. -
hotfix/*— urgent fixes. Targetsmaindirectly. Created frommain.
GitHub branch protection is configured at the repository level. The current rules:
| Branch | Required PR | Required reviews | Required status checks | Direct push allowed |
|---|---|---|---|---|
main |
yes | 1+ | (none currently) | no |
staging |
yes | 1+ | (none currently; changeset-check planned per #389) |
no |
dev |
n/a | n/a | n/a | n/a (does not exist) |
hotfix/* |
yes | 1+ (smaller reviewer pool from hotfix environment) |
per workflow | no |
feature/*, fix/*
|
optional | optional | optional | yes (for maintainers) |
The release GitHub environment is the human gate for any workflow that
publishes to npm. The hotfix environment (target architecture) is a separate,
faster gate for hotfix PRs targeting main directly.
| Type of PR | Target | Required reviewer count | Reviewer pool |
|---|---|---|---|
| Feature PR | staging |
1 | any maintainer |
| Fix PR | staging |
1 | any maintainer |
| Follow-up PR (after a hotfix) | staging |
1 | any maintainer |
| Hotfix PR | main |
1 | smaller pool, faster SLA |
| Version Packages PR (auto-generated) | main |
1 | any maintainer |
For a single-maintainer project, the reviewer pool is "the maintainer" — there is no team review. The model extends naturally when the project gains more maintainers: add them as CODEOWNERS or as required reviewers in the branch protection rules.
feature/* ──► staging ──► Version Packages PR ──► main
│
▼
publish.yml
│
▼
npm + tag
hotfix/* ────────────────────────────────────────────────► main
│
▼
publish.yml
│
▼
follow-up PR ─► staging
Three reasons the model is what it is:
-
Separation of integration and release.
stagingaccumulates changes without publishing.mainonly receives changes when a release is ready. This means every commit onmaincorresponds to a published version (or a documented failure), and no commit onmainis invisible to the release tooling. -
Hotfix escape hatch. Hotfix branches skip
stagingbecausestagingmay contain unfinished work that should not ship. This is the one exception to the "PRs targetstaging" rule. -
No
devlong-lived branch. The cost of a third long-lived branch (its own protection rules, its own CI, the risk of drift betweendevandstaging) outweighs the benefit for a single-package, single-maintainer project. The feature branches collectively play the role ofdev.
-
Release Process — operational pipeline that runs on
main. -
Hotfix Flow — operational pipeline for hotfix PRs targeting
main. -
Canary Snapshots — per-PR snapshots on every push to a PR
targeting
staging. - Pre-release Cycles — future feature for beta/rc phases.
-
Authoring Changesets — how to write the Changeset file
required for every PR targeting
staging. - Internal:
docs/engineering/process/branch-strategy.md— operational mirror of this page. - Repository:
CLAUDE.md— the original branching model documentation.
This wiki is maintained alongside the @deessejs/fp package. Pages here mirror internal documentation at docs/engineering/ in the repository; the repo file is the source of truth.
- Repository: source code, issues, releases.
- npm package: install, changelog, version history.
- Issue tracker: bug reports and feature requests.
- Discussions: questions and design conversations.