Skip to content

Commit f644fa2

Browse files
Merge pull request #11191 from sensei-hacker/docs-update-branching-strategy
docs: Update Development.md with maintenance branch workflow
2 parents 24e7b88 + 535291b commit f644fa2

File tree

1 file changed

+103
-6
lines changed

1 file changed

+103
-6
lines changed

docs/development/Development.md

Lines changed: 103 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ The main flow for a contributing is as follows:
107107
7. `git add <files that have changed>`
108108
8. `git commit`
109109
9. `git push origin my-new-code`
110-
10. Create pull request using github UI to merge your changes from your new branch into `inav/master`
110+
10. Create pull request using github UI to merge your changes from your new branch into the appropriate target branch (see "Branching and release workflow" below)
111111
11. Repeat from step 4 for new other changes.
112112

113113
The primary thing to remember is that separate pull requests should be created for separate branches. Never create a pull request from your `master` branch.
114114

115+
**Important:** Most contributions should target a maintenance branch, not `master`. See the branching section below for guidance on choosing the correct target branch.
116+
115117
Later, you can get the changes from the INAV repo into your `master` branch by adding INAV as a git remote and merging from it as follows:
116118

117119
1. `git remote add upstream https://github.com/iNavFlight/inav.git`
@@ -125,10 +127,105 @@ You can also perform the git commands using the git client inside Eclipse. Refe
125127

126128
## Branching and release workflow
127129

128-
Normally, all development occurs on the `master` branch. Every release will have it's own branch named `release_x.y.z`.
130+
INAV uses maintenance branches for active development and releases. The `master` branch receives merges from maintenance branches.
131+
132+
### Branch Types
133+
134+
#### Maintenance Branches (Current and Next Major Version)
135+
136+
**Current version branch** (e.g., `maintenance-9.x`):
137+
- Used for backward-compatible changes
138+
- Bug fixes, new features, and improvements that don't break compatibility
139+
- Changes here will be included in the next release of the current major version (e.g., 9.1, 9.2)
140+
- Does not create compatibility issues between firmware and configurator within the same major version
141+
142+
**Next major version branch** (e.g., `maintenance-10.x`):
143+
- Used for changes that introduce compatibility requirements
144+
- Breaking changes that would cause issues between different major versions
145+
- New features that require coordinated firmware and configurator updates
146+
- Changes here will be included in the next major version release (e.g., 10.0)
147+
148+
#### Master Branch
149+
150+
The `master` branch receives periodic merges from maintenance branches.
151+
152+
### Choosing the Right Target Branch
153+
154+
When creating a pull request, target the appropriate branch:
155+
156+
**Target the current version branch** (e.g., `maintenance-9.x`) if your change:
157+
- Fixes a bug
158+
- Adds a new feature that is backward-compatible
159+
- Updates documentation
160+
- Adds or updates hardware targets
161+
- Makes improvements that work with existing releases
162+
163+
**Target the next major version branch** (e.g., `maintenance-10.x`) if your change:
164+
- Breaks compatibility with the current major version
165+
- Requires coordinated firmware and configurator updates
166+
- Changes MSP protocol in an incompatible way
167+
- Modifies data structures in a breaking way
168+
169+
### Release Workflow
170+
171+
1. Development occurs on the current version maintenance branch (e.g., `maintenance-9.x`)
172+
2. When ready for release, a release candidate is tagged from the maintenance branch
173+
3. Bug fixes during the RC period continue on the maintenance branch
174+
4. After final release, the maintenance branch is periodically merged into `master`
175+
5. The cycle continues with the maintenance branch receiving new changes for the next release
176+
177+
### Propagating Changes Between Maintenance Branches
178+
179+
Changes committed to the current version branch should be merged forward to the next major version branch to prevent regressions.
129180

130-
During release candidate cycle we will follow the process outlined below:
181+
**Maintainer workflow:**
182+
- Changes merged to `maintenance-9.x` should be regularly merged into `maintenance-10.x`
183+
- This ensures fixes and features aren't lost when the next major version is released
184+
- Prevents users from experiencing bugs in v10.0 that were already fixed in v9.x
131185

132-
1. Create a release branch `release_x.y.z`
133-
2. All bug fixes found in the release candidates will be merged into `release_x.y.z` branch and not into the `master`.
134-
3. After final release is made, the branch `release_x.y.z` is locked, and merged into `master` bringing all of the bug fixes into the development branch. Merge conflicts that may arise at this stage are resolved manually.
186+
**Example:**
187+
```bash
188+
# Merge changes from current to next major version
189+
git checkout maintenance-10.x
190+
git merge maintenance-9.x
191+
git push upstream maintenance-10.x
192+
```
193+
194+
### Example Timeline
195+
196+
Current state (example):
197+
- `maintenance-9.x` - Active development for INAV 9.1, 9.2, etc.
198+
- `maintenance-10.x` - Breaking changes for future INAV 10.0
199+
- `master` - Receives periodic merges from maintenance branches
200+
201+
After INAV 10.0 is released:
202+
- `maintenance-10.x` - Active development for INAV 10.1, 10.2, etc.
203+
- `maintenance-11.x` - Breaking changes for future INAV 11.0
204+
- `master` - Continues receiving merges
205+
206+
### Working with Maintenance Branches
207+
208+
To branch from the current maintenance branch instead of master:
209+
210+
```bash
211+
# Fetch latest changes
212+
git fetch upstream
213+
214+
# Create your feature branch from the maintenance branch
215+
git checkout -b my-new-feature upstream/maintenance-9.x
216+
217+
# Make changes, commit, and push
218+
git push origin my-new-feature
219+
220+
# Create PR targeting maintenance-9.x (not master)
221+
```
222+
223+
When updating your fork:
224+
225+
```bash
226+
# Get the latest maintenance branch changes
227+
git fetch upstream
228+
229+
# Push directly from upstream to your fork (no local checkout needed)
230+
git push origin upstream/maintenance-9.x:maintenance-9.x
231+
```

0 commit comments

Comments
 (0)