> ## 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.

# Level 1 · Fix

> How to fix a defect with a small PR to develop, and how to ship a production hotfix from master.

A fix corrects wrong behavior, touches **a single project** and is around **200 lines** or fewer.
There are two variants:

| Variant | When | Branch | Target |
| - | - | - | - |
| **Bugfix** | The defect can wait for the next release | `bugfix/<scope>/<description>` from `develop` | `develop` |
| **Hotfix** | A production incident that cannot wait | `hotfix/<description>` from `master` | `master` |

## Bugfix to develop

**1. Create the branch from develop**

```bash theme={null}
git switch develop && git pull
git switch -c bugfix/portal-customer/coupon-expiry-timezone
```

The `scope` is one of the valid commitlint scopes (the project you are touching).

**2. Write the test that reproduces the defect**

A test that fails before the fix and passes after it. It is the best evidence for the reviewer.

**3. Fix it and commit**

```bash theme={null}
git commit -m "fix(portal-customer): compare coupon expiry in the store timezone"
```

**4. Open the PR as a draft**

```bash theme={null}
gh pr create --draft --base develop --fill
```

In the **Initiatives** section, declare the area's initiative and the matching task. A `fix`
always declares an initiative: `Initiative: none` is only accepted on `build`, `chore`, `ci` or
`revert` titles.

**5. Verify it and mark it ready**

```bash theme={null}
pnpm initiatives:pr-check
```

Once it passes, mark it ready (`gh pr ready`). If the fix does not touch the UI, add
`[skip e2e]` at the end of the title.

[In force since Wave 0](https://docs.bbrands.io/bbrands-lab/pull-requests/waves-roadmap.md)
`[skip e2e]` in the title skips the Playwright shards on the PR. The merge queue never honors it.

[Arrives in Wave 1](https://docs.bbrands.io/bbrands-lab/pull-requests/waves-roadmap.md)
E2E tests run in the merge queue by default, so a fix with no UI changes no longer needs the marker.

## Hotfix to production

A hotfix skips the release train. Use it only when the defect affects production and cannot wait
for the next candidate.

**1. Create the branch from master**

```bash theme={null}
git fetch origin && git switch -c hotfix/payment-webhook-retry origin/master
```

**2. Fix it with the smallest possible change**

No refactors or opportunistic improvements: only what closes the incident, with its test.

**3. Open the PR with the script**

```bash theme={null}
git push -u origin HEAD
pnpm pr:hotfix
```

The script checks that the branch starts with `hotfix/`, computes the hotfix version, opens the
PR against `master` with the hotfix template and uses the last commit as the title if it is a
`fix`, `perf`, `refactor` or `hotfix`. Otherwise it uses `fix(repo): hotfix <version>`.

**4. Review and queue**

`master` requires **CI OK**, **Review gate** and **Validate PR Title**, with the full CI of
every project. The **Wave-0 QA sign-off** check only asks for a sign-off on candidates coming
from `release`, so a hotfix passes it. It merges with a merge commit, through a queue that takes
one entry at a time.

**5. Automatic sync**

After the release, the post-merge workflow opens two sync PRs: `master → develop` and
`master → release`. Do not sync by hand.

> [!WARNING]
>
> A hotfix is never made from `develop` or `release`: it would ship to production changes that have
> not yet gone through the candidate.

## Checklist

* [ ] Branch `bugfix/<scope>/<description>` from `develop`, or `hotfix/<description>` from `master`.
* [ ] A test that reproduces the defect.
* [ ] Title `fix(<scope>): …` in English, following Conventional Commits.
* [ ] Initiative and task declared in the PR (bugfix to develop).
* [ ] Draft → `pnpm initiatives:pr-check` → ready → one push.
* [ ] `[skip e2e]` if it does not touch the UI.


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