> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Releases and hotfix

> How a change travels from develop to production: candidates, release, sync and CalVer versioning.

Work PRs end in `develop`. The road to production is a separate flow, with its own scripts and PRs
opened by the platform team or Danibot.

![develop to release as a candidate, release to master as a stable release, hotfix from master, and sync from master back to develop and release.](https://mintcdn.com/bbrands/HbBhTZK1FiD1UtlY/images/bbrands-lab/git-flow-promotion.svg?fit=max\&auto=format\&n=HbBhTZK1FiD1UtlY\&q=85\&s=424f7e10d5f506de06e63208a215b678)

Promotion between branches

## Long-lived branches

| Branch | Role | Tags |
| - | - | - |
| `develop` | Integration: every work PR lands here | `YYYY.M.P-alpha.N` |
| `release` | A single branch holding the candidate under certification | `YYYY.M.P-rc.N` |
| `master` | Production | `YYYY.M.P` |

The tag is the source of truth for the version. Only `master` updates `package.json`, and the code
reads the deployed version from `APP_VERSION`. Nobody edits versions by hand.

## The flows

| Script | From → to | Purpose |
| - | - | - |
| `pnpm pr:rc` | `develop → release` | Cut a candidate. Runs `Release review (AI)` |
| `pnpm pr:release` | `release → master` | Ship the candidate to production. Requires **Wave-0 QA sign-off** |
| `pnpm pr:hotfix` | `hotfix/* → master` | Urgent production fix ([Level 1](https://docs.bbrands.io/bbrands-lab/pull-requests/level-1-fix.md#hotfix-to-production)) |
| `pnpm pr:sync-back` | `master → develop` | Bring back to `develop` what reached production |
| `pnpm pr:sync-release` | `master → release` | Align `release` with production |

Danibot opens both sync PRs automatically after every release to `master`. The scripts exist for
manual cases; they can also be launched from the "Open PR" workflow on GitHub.

**1. Candidate**

`pnpm pr:rc` opens `chore(repo): cut release candidate <version>`. Once merged, `release` gets a
`-rc.N` tag.

**2. Certification**

The release train deploys the tag to certification (environment, migrations, mobile apps and
monitoring) and runs the Wave 0 QA.

**3. QA sign-off**

The approver runs the sign-off workflow with the candidate's tag.

**4. Production**

`pnpm pr:release` opens `chore(repo): release <version>`. Once merged, `master` gets the stable
tag and the release train deploys it to production.

**5. Sync**

Danibot opens `master → develop` and `master → release`.

## What it means for a work PR

* Your change reaches production with the **next candidate** after it is merged into `develop`.
* If it is behind a flag, it can ship with the flag off and be turned on later.
* PRs targeting `release` and `master` run **every** CI lane. Do not open work PRs against those
  branches: only the flows on this page.

More details in the [Releases](https://docs.bbrands.io/bbrands-lab/releases/overview.md) section.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.