Skip to content

Commit e3f8406

Browse files
committed
maintaining.md: add maintaining document
Outline the places we need to update for releases and how we handle certain things. Signed-off-by: Austin Horstman <[email protected]>
1 parent ceb884e commit e3f8406

File tree

1 file changed

+208
-0
lines changed

1 file changed

+208
-0
lines changed

MAINTAINING.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Maintaining Home Manager
2+
3+
This file is intended as a reference for Home Manager's core maintainers,
4+
although it may be interesting for anyone curious how we do certain things.
5+
6+
## Releasing
7+
8+
Home Manager releases stable versions in sync with NixOS/nixpkgs. A _`YY.05`_
9+
version is released in May and a _`YY.11`_ version is released in November.
10+
11+
We do not need to wait for the release to come out of _"beta"_ before creating a
12+
branch, however we _should_ wait before updating links and references on the
13+
`master` branch.
14+
15+
Creating a stable branch may require temporarily disabling branch protection.
16+
This can only be done by an "admin" or "owner".
17+
18+
Once a stable branch is created, its flake inputs should be updated to point to
19+
the corresponding stable versions. The branch can be created before these exist,
20+
in which case they should be updated when the corresponding stable inputs become
21+
available.
22+
23+
Once a stable version is considered "out of beta", references to Home Manager's
24+
stable branch should be updated on the `master` branch to reference the new
25+
version.
26+
27+
### Release Workflow
28+
29+
The release process involves four phases in a specific order:
30+
31+
1. **On master - Mark current as stable**: Update all documentation and examples
32+
to reflect the current release (e.g., 25.11) as stable, removing "(unstable)"
33+
tags
34+
2. **Cut the release branch**: Create the new release branch from master (e.g.,
35+
`release-25.11`)
36+
3. **On release branch - Mark as release branch**: Set `isReleaseBranch: true`
37+
in `release.json`
38+
4. **On master - Prepare for next**: Bump version to next release (e.g., 26.05)
39+
and add "(unstable)" tag back
40+
41+
**Important**: The `isReleaseBranch` field in `release.json` is managed
42+
differently on each branch:
43+
44+
- On **master**: Always remains `false`
45+
- On **release branches**: Set to `true` in a separate commit after cutting the
46+
branch from master
47+
48+
This workflow ensures that the release branch captures a stable snapshot of
49+
master, which then moves forward to the next development cycle.
50+
51+
### Release Preparation Checklist
52+
53+
#### Step 1: On master - Mark Current as Stable
54+
55+
**When**: When ready to cut a new release branch (e.g., when preparing to
56+
release 25.11)
57+
58+
Reference commits:
59+
60+
- `e08e6e2389234000b0447e57abf61d8ccd59a68e` (home-manager: set 25.05 as stable)
61+
62+
1. **README.md**
63+
- Update example release branch references (e.g., `release-24.11`
64+
`release-25.05`)
65+
- Update current stable version references (e.g., `24.11``25.05`)
66+
67+
2. **docs/manual/installation/nix-darwin.md**
68+
- Update channel version in example commands
69+
- Update `home.stateVersion` in examples
70+
71+
3. **docs/manual/installation/nixos.md**
72+
- Update channel version in example commands
73+
- Update tarball URLs
74+
- Update `home.stateVersion` in examples
75+
76+
4. **docs/manual/installation/standalone.md**
77+
- Update channel version in example commands
78+
79+
5. **docs/manual/manual.md**
80+
- Remove `(unstable)` suffix from version
81+
82+
6. **docs/manual/nix-flakes/standalone.md**
83+
- Update flake references (e.g., `home-manager/release-24.11`
84+
`home-manager/release-25.05`)
85+
- Update `$branch` examples
86+
87+
7. **docs/manual/usage/configuration.md**
88+
- Update `home.stateVersion` in example configurations
89+
90+
8. **docs/release-notes/rl-YYMM.md**
91+
- Replace "This is the current unstable branch and the information in this
92+
section is therefore not final."
93+
- With: "The YY.MM release branch became stable in <Month>, YYYY."
94+
95+
9. **home-manager/home-manager** script
96+
- Update default `home.stateVersion` in generated configurations
97+
- Update `home.stateVersion` in uninstall function
98+
99+
10. **modules/misc/uninstall.nix**
100+
- Update `home.stateVersion` in uninstall config
101+
102+
**Note**: Do NOT change `isReleaseBranch` in `release.json` - keep it as `false`
103+
104+
#### Step 2: Cut the release branch
105+
106+
**When**: After Step 1 is merged to master
107+
108+
1. Create the new release branch from master
109+
- Example: `git checkout -b release-25.11 master`
110+
2. Push the branch to the repository
111+
112+
#### Step 3: On the release branch - Mark as Release Branch
113+
114+
**When**: Immediately after creating the release branch
115+
116+
Reference commits:
117+
118+
- `70a787cc5` (release: set release branch)
119+
120+
1. **release.json**
121+
- Change `isReleaseBranch` from `false` to `true`
122+
- Do NOT change the `release` field (it's already correct from Step 1)
123+
124+
#### Step 3.5: On master - Update CI for the New Release Branch
125+
126+
**When**: After marking the release branch as a release branch (Step 3)
127+
128+
**Where**: On the **master** branch (CI workflows run from master)
129+
130+
**What**: Update GitHub Actions workflows to include the new stable branch
131+
132+
1. **.github/workflows/update-flake.yml** (on master)
133+
- Replace the old stable branch with the new release branch in the matrix
134+
- Example: When creating `release-25.11`, update the matrix from:
135+
136+
```yaml
137+
strategy:
138+
matrix:
139+
branch: [master, release-25.05]
140+
```
141+
142+
to:
143+
144+
```yaml
145+
strategy:
146+
matrix:
147+
branch: [master, release-25.11]
148+
```
149+
150+
- This ensures automated flake.lock updates run on the current stable branch
151+
- Note: We only maintain CI for the latest stable release, not older releases
152+
153+
**Important**: CI workflows are executed from master, so this change must be
154+
committed to the master branch.
155+
156+
#### Step 4: On master - Prepare for Next Release
157+
158+
**When**: After cutting the release branch, prepare master for the next
159+
development cycle
160+
161+
Reference commits:
162+
163+
- `9a4a9f1d6e43fe4044f6715ae7cc85ccb1d2fe09` (home-manager: prepare 25.11)
164+
165+
1. **docs/release-notes/rl-YYMM.md** (CREATE NEW)
166+
- Create new release notes file for next version with unstable warning
167+
- Example: Create `rl-2605.md` when preparing for 26.05
168+
169+
2. **docs/manual/manual.md**
170+
- Update version to next release with `(unstable)` tag
171+
- Example: `25.11` → `26.05 (unstable)`
172+
173+
3. **docs/release-notes/release-notes.md**
174+
- Add new release notes file `rl-YYMM.md` at the top of the chapters list
175+
176+
4. **home-manager/home-manager** script
177+
- Update `--version` output to next version
178+
- Example: `echo 25.11-pre` → `echo 26.05-pre`
179+
180+
5. **modules/misc/version.nix**
181+
- Add new version string to `stateVersion` enum list
182+
- Example: Add `"26.05"` after `"25.11"`
183+
184+
6. **release.json**
185+
- Update `release` field to next version (e.g., `"25.11"` → `"26.05"`)
186+
- **IMPORTANT**: Keep `isReleaseBranch` as `false` on master
187+
188+
### Version State Changes
189+
190+
Each release may introduce state version changes that affect the default
191+
behavior of Home Manager for users who set `home.stateVersion` to that version.
192+
193+
State version changes should be documented in the release notes under a "State
194+
Version Changes" section, explaining what behavior changes for users who set
195+
their state version to the new release.
196+
197+
### Backporting
198+
199+
Stable branches get bug fixes and security updates, but usually not new modules
200+
or features. When backporting:
201+
202+
1. Use `git cherry-pick -x <commit>` to preserve the original commit reference
203+
2. Test that the backport builds successfully
204+
3. Consider whether the change might affect existing stable users
205+
4. Update the PR/commit message to indicate it's a backport
206+
207+
If a user needs a module backported, they should open an issue explaining the
208+
use case.

0 commit comments

Comments
 (0)