Skip to content

Commit 96c1737

Browse files
Document the release branch pattern for batching feature PRs into one release
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent bfef8e1 commit 96c1737

4 files changed

Lines changed: 59 additions & 1 deletion

File tree

src/docs/Modules/Process-PSModule/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ This section documents how module repositories are formed and how they move from
1111
- [Build, Test, Pack, Publish](build-test-pack-publish.md)
1212
- [Template Quickstart](template-quickstart.md)
1313
- [Module Bootstrap](module-bootstrap.md)
14+
- [Release Branch Pattern](release-branch-pattern.md)
1415

1516
For broader framework context, see [MSX Frameworks / Process-PSModule](https://msxorg.github.io/docs/Frameworks/Process-PSModule/).

src/docs/Modules/Process-PSModule/module-bootstrap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ A module bootstrapped this way:
5555
## When to use this
5656

5757
- The module has no usable release yet, and the load-bearing core hasn't landed.
58-
- Use this only for the initial bootstrap. Once `main` has a first release, ongoing feature work targets `main` directly with ordinary topic branches, or a [stacked pull request](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests) when changes genuinely depend on each other.
58+
- Use this only for the initial bootstrap. Once `main` has a first release, ongoing feature work targets `main` directly with ordinary topic branches, batches independent features through the [Release Branch Pattern](release-branch-pattern.md), or uses a [stacked pull request](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests) when changes genuinely depend on each other.
5959

6060
For the general branching and merge model, see [MSX Branching and Merging](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/).
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Release Branch Pattern
2+
3+
Use a release branch to concentrate several related feature changes into one release, when the changes are independent of each other but should ship, close their issues, and generate release notes together.
4+
5+
This differs from [Module Bootstrap](module-bootstrap.md), which exists only to get a brand-new module's load-bearing core to its first release, and from a [stacked pull request](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests), where each layer depends on the one before it. The release branch pattern applies to any module that already has a release, for a batch of independent features destined for the same version bump.
6+
7+
## Pattern
8+
9+
1. Cut one release branch from `main`, named for the release, e.g. `release-v1`.
10+
2. Open the **release pull request** immediately: release branch → `main`, as a **draft**. This PR stays open for the lifetime of the release and accumulates the `Closes #N` references for every issue the release resolves.
11+
3. Cut each feature branch from the release branch, not from `main`.
12+
4. Open each **feature pull request** targeting the release branch, not `main`. Feature PRs can land in parallel and in any order relative to each other, unless one feature explicitly depends on another (in which case stack those two normally).
13+
5. Merge feature PRs into the release branch as they become ready.
14+
6. Once every planned feature PR has merged into the release branch, un-draft the release PR and merge it into `main`. This merge becomes the release.
15+
16+
```mermaid
17+
gitGraph
18+
commit id: "main"
19+
branch release-v1
20+
checkout release-v1
21+
branch feature-a
22+
branch feature-b
23+
checkout feature-a
24+
commit id: "PR: feature A"
25+
checkout feature-b
26+
commit id: "PR: feature B"
27+
checkout release-v1
28+
merge feature-a
29+
merge feature-b
30+
checkout main
31+
merge release-v1 id: "release PR"
32+
```
33+
34+
## Release pull request body
35+
36+
The release PR is the single place that:
37+
38+
- Lists `Closes #N` for every issue resolved by any feature PR merged into the release branch.
39+
- Carries the combined release notes, written per [MSXOrg PR Format](https://msxorg.github.io/docs/Ways-of-Working/PR-Format.md), once every feature has landed.
40+
41+
Feature PRs still follow PR Format for their own description, but do not need to duplicate `Closes #N` — the release PR is the one that closes issues when it merges to `main`.
42+
43+
## Merge order
44+
45+
- Merge feature PRs in dependency order. Independent feature PRs have no required order between them.
46+
- The release PR always merges last, after every feature PR it depends on has landed in the release branch.
47+
- Keep the release PR in draft for as long as feature PRs are still expected. Un-draft it only once the release branch is feature-complete and passing checks.
48+
49+
## When to use this
50+
51+
- The module already has a stable release, and several independent features are queued for the next version.
52+
- Skip this pattern for a single isolated change — use an ordinary topic branch targeting `main` directly.
53+
- Skip this pattern for a brand-new module with no release yet — use [Module Bootstrap](module-bootstrap.md) instead.
54+
- Use a [stacked pull request](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests) instead when changes genuinely depend on each other in sequence, rather than being independent features batched into one release.
55+
56+
For the general branching and merge model, see [MSX Branching and Merging](https://msxorg.github.io/docs/Ways-of-Working/Branching-and-Merging/).

src/zensical.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ nav = [
3434
{"Build, Test, Pack, Publish" = "Modules/Process-PSModule/build-test-pack-publish.md"},
3535
{"Template Quickstart" = "Modules/Process-PSModule/template-quickstart.md"},
3636
{"Module Bootstrap" = "Modules/Process-PSModule/module-bootstrap.md"},
37+
{"Release Branch Pattern" = "Modules/Process-PSModule/release-branch-pattern.md"},
3738
]},
3839
]},
3940
{"Dictionary" = [

0 commit comments

Comments
 (0)