Skip to content

Commit f86c419

Browse files
📖 [Docs]: Document trunk-based release flow (#454)
The documentation now keeps Process-PSModule releases trunk-based and aligned with the workflow implementation. ## Changed: Release guidance follows the default branch The documentation now states that feature branches are short-lived and target `main` directly. Stable publication occurs only when a pull request is merged to the repository default branch. A `Prerelease` label remains available for previewing a feature pull request before merge. The proposed release-branch promotion process and `release/**` trigger have been removed. Dependent work may still use the canonical stacked pull request model. --- <details> <summary>Technical details</summary> - Removed the release-branch pattern added from PSModule/docs#90. - Aligned the versioning guide, module standard, principles, bootstrap guidance, and specification with trunk-based delivery. - Corrected the specification from publication on a release branch to publication on the default branch. - No test/import/no-mocks guidance was duplicated. </details> <details> <summary>Relevant issues (or links)</summary> - PSModule/docs#90 </details> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 8fa878a commit f86c419

5 files changed

Lines changed: 26 additions & 23 deletions

File tree

docs/content/get-started/module-bootstrap.md

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

6262
- The module has no usable release yet, and the load-bearing core hasn't landed.
63-
- 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://msx.no/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests) when changes genuinely depend on each other.
63+
- Use this only for the initial bootstrap. Once `main` has a first release, ongoing feature work targets `main` directly with ordinary topic branches, or uses a [stacked pull request](https://msx.no/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests) when changes genuinely depend on each other.
6464

6565
For the general branching and merge model, see [MSX Branching and Merging](https://msx.no/docs/Ways-of-Working/Branching-and-Merging/).

docs/content/guides/versioning-and-releases.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,20 @@ The label names are configurable through `Publish.Module.MajorLabels`, `MinorLab
4444

4545
## Branch types
4646

47-
- **Main (stable)** — pushes publish stable releases. A prerelease label on an open pull request publishes a prerelease.
48-
- **Development** — optional prerelease branch (for example `dev`). Its open, prerelease-labelled pull request to the
49-
stable branch publishes previews when it is updated.
50-
- **Feature branch** — optional feature branch. Its open, prerelease-labelled pull request publishes a preview for
51-
testing.
47+
- **Main (stable)** — the default branch and the only branch that publishes stable releases.
48+
- **Feature branch** — a short-lived topic branch with a pull request targeting `main`.
5249

53-
Exactly one branch is authorized to publish stable releases, so consumers always have one unambiguous latest version.
50+
Exactly one branch is authorized to publish stable releases, so consumers always have one
51+
unambiguous latest version. Use a
52+
[stacked pull request](https://msx.no/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests)
53+
when changes genuinely depend on each other; independent changes remain separate
54+
short-lived pull requests targeting `main`.
5455

5556
## Prereleases
5657

5758
A pull request labelled `Prerelease` publishes a prerelease version (for example `v1.2.3-pr.1.5`) that is installable
5859
but not promoted as latest. When that pull request is merged with a version label, the stable version is computed from
59-
the label and the current version on the release branch.
60+
the label and the current version on `main`.
6061

6162
When a pull request closes, the prerelease versions and tags created for it are removed, so abandoned or promoted work
6263
leaves no orphaned prereleases. This is controlled by `Publish.Module.AutoCleanup`.
@@ -76,8 +77,7 @@ Release names and notes can be generated from the pull request — see
7677

7778
Only a single linear ancestry of versions is maintained. Old versions are not patched: if a security issue is found on
7879
`2.1.3`, the fix ships on the latest version, not as a new `1.x` release. See
79-
[Principles and practices](../specification/principles-and-practices.md) for the reasoning and for the release-branch
80-
pattern used for larger efforts.
80+
[Principles and practices](../specification/principles-and-practices.md) for the reasoning.
8181

8282
## Related
8383

docs/content/reference/powershell-module-standard.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ The release process treats each important default-branch push as a release on a
115115
request supplies release metadata when its merge commit exactly matches that push. There is no patching of older
116116
versions — security fixes go on the current tip of `main` only.
117117

118-
### Release and feature branches
118+
### Feature branches
119119

120-
For large work, open a release branch and target it from feature branches. Apply the `Prerelease` label on the release
121-
branch PR to publish preview versions before its final merge creates the stable default-branch push.
120+
Keep feature branches short-lived and target `main` directly. Use a
121+
[stacked pull request](https://msx.no/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests)
122+
only when changes genuinely depend on each other. Apply the `Prerelease` label to a
123+
feature pull request to publish a preview before merging it to `main`.
122124

123125
## CI/CD pipeline
124126

@@ -291,7 +293,7 @@ The publish step only runs when:
291293

292294
- All tests and code coverage pass (or are skipped)
293295
- An important push reaches the default branch (stable release), or
294-
- The PR carries the `Prerelease` label (prerelease from the feature/release branch)
296+
- The PR carries the `Prerelease` label (prerelease from the feature branch)
295297

296298
On any closed PR, the pipeline cleans up any prerelease tags created for that branch. A closed pull request cannot
297299
create a stable release.

docs/content/specification/principles-and-practices.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ back to patch and update old versions of the modules. This means that if we are
1212
patch the latest version with a fix, not releasing new versions based on older versions of the module, i.e. not updating the latest 1.x with the
1313
patch.
1414

15-
## Release and feature branches
15+
## Trunk-based development
1616

17-
If you need to work forth a bigger release, create a branch representing the release (a release branch) and open a PR towards `main` for this branch.
18-
For each topic or feature to add to the release, open a new branch representing the feature (a feature branch) and open a PR towards the release
19-
branch. Optionally add the `Prerelease` label on the PR for the release branch, to release preview versions before merging and releasing a published
20-
version of the PowerShell module.
17+
Keep feature branches short-lived and open pull requests directly toward `main`.
18+
Independent changes use separate branches; use a
19+
[stacked pull request](https://msx.no/docs/Ways-of-Working/Branching-and-Merging/#stacked-pull-requests)
20+
only when changes genuinely depend on each other. Add the `Prerelease` label to a
21+
feature pull request when a preview version is needed before merging to `main`.
2122

2223
## Colocation of concerns
2324

docs/content/specification/spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ The pipeline MUST generate module documentation from the source (cmdlet help, RE
4545

4646
The pipeline MUST read pull-request labels (`Major`, `Minor`, `Patch`, `Prerelease`, `NoRelease`) to decide the
4747
semantic-version bump when the merged pull request exactly matches a default-branch push. It MUST compute the next
48-
version automatically, never reading or writing a hand-edited version file. An important push to the release branch
49-
MUST trigger publication to the PowerShell Gallery and documentation site; a prerelease label MUST result in a
50-
prerelease version available for testing before stable release.
48+
version automatically, never reading or writing a hand-edited version file. An important push to the default branch MUST
49+
trigger publication to the PowerShell Gallery and documentation site; a prerelease label MUST result in a prerelease
50+
version available for testing before stable release.
5151

5252
### FR6 — Produce immutable, linkable releases {#fr6}
5353

@@ -65,7 +65,7 @@ Only one release process MUST run against a given version of the codebase at a t
6565

6666
### NFR3 — Single production authority {#nfr3}
6767

68-
Exactly one branch (typically `main`) MUST be authorized to publish stable releases. All other release branches MUST publish only prerelease versions. This ensures consumers have one unambiguous latest stable version.
68+
Exactly one branch (the repository default branch, typically `main`) MUST be authorized to publish stable releases. Feature branches MAY publish only prerelease versions. This ensures consumers have one unambiguous latest stable version.
6969

7070
### NFR4 — Rapid feedback on failure {#nfr4}
7171

0 commit comments

Comments
 (0)