Skip to content

Commit d75b8be

Browse files
authored
Merge pull request #80 from espressif/copilot/add-maintenance-policy-document
docs: add MAINTENANCE.md with release and breaking-change policy
2 parents 6fe696b + 01cef04 commit d75b8be

File tree

4 files changed

+89
-4
lines changed

4 files changed

+89
-4
lines changed

.github/copilot-instructions.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Base (src/target/base/) - Interface headers only
4848
CHANGELOG.md # Version history
4949
CMakeLists.txt # Main library build file
5050
LICENSE-APACHE, LICENSE-MIT # Dual license
51+
MAINTENANCE.md # Maintenance & release policy
5152
README.md # Main documentation
5253
example/ # Complete example implementation
5354
include/ # Public API headers
@@ -163,6 +164,8 @@ body (optional)
163164

164165
**Common types:** feat, fix, docs, style, refactor, test, chore, change (for version bumps)
165166

167+
**Breaking changes:** Use `!` after type/scope (`feat(flash)!: ...`) or add a `BREAKING CHANGE:` footer so commitizen detects and bumps the major version. See [MAINTENANCE.md](../MAINTENANCE.md) for the full breaking-change process.
168+
166169
### PR and Review Guidelines
167170

168171
**When creating or reviewing PRs, always check if documentation updates are needed:**
@@ -183,6 +186,9 @@ body (optional)
183186
- **README.md Updates:**
184187
- Review if changes require updates to repository README.md (e.g., new features, targets, or significant architectural changes)
185188

189+
- **Breaking Changes:**
190+
- Any PR that touches `include/esp-stub-lib/**` in a breaking way must follow the process in [MAINTENANCE.md](../MAINTENANCE.md#4-breaking-changes-policy)
191+
186192
## GitHub Actions CI
187193

188194
**Workflows:**
@@ -297,14 +303,17 @@ cd example
297303
```
298304

299305
**Release process (maintainers only):**
306+
307+
See [MAINTENANCE.md](../MAINTENANCE.md) for versioning rules, breaking-change policy, and release quality expectations.
308+
300309
```bash
301310
pip install commitizen
302311
git fetch
303-
git checkout -b update/release_vX.Y.Z
304-
git reset --hard origin/master
312+
git checkout master && git reset --hard origin/master
305313
cz bump
306-
git push -u && git push --tags
307-
# Then create PR and edit draft release notes
314+
git push && git push --tags
315+
# A draft GitHub release with auto-generated notes is created automatically.
316+
# Review and publish the draft — no separate PR is required.
308317
```
309318

310319
---

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ repos:
4141
hooks:
4242
- id: conventional-precommit-linter
4343
stages: [commit-msg]
44+
args:
45+
- --allow-breaking
4446

4547
- repo: https://github.com/pre-commit/mirrors-clang-format
4648
rev: v21.1.8

MAINTENANCE.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# esp-stub-lib maintenance & release policy
2+
3+
This document defines the maintenance rules for `esp-stub-lib` when multiple teams develop and integrate in parallel.
4+
5+
## 1) Public API definition
6+
7+
**Public API** is everything exposed by headers under:
8+
9+
- `include/esp-stub-lib/**`
10+
11+
Consumers must not rely on internal headers or internal symbols outside of this directory.
12+
13+
## 2) Versioning & releases (SemVer)
14+
15+
This project follows **Semantic Versioning**: `MAJOR.MINOR.PATCH` (e.g. `1.4.2`).
16+
17+
Releases are created and tagged regularly using **commitizen** (and its generated changelog/release notes).
18+
19+
**Integration rule for downstream projects:**
20+
- Downstream projects should pin the submodule to **release tags** (e.g. `v1.3.0`), not to branches and not to arbitrary commits.
21+
- Pinning to the exact commit that an annotated tag points at is equally valid. This is useful when a team has already tested and approved commit X: they can create a tag pointing at X without needing to move to a different commit and re-run their testing pipelines.
22+
23+
Rationale: tags are explicit integration points with a known set of changes and release notes.
24+
25+
## 3) Branch policy
26+
27+
- There is exactly **one maintained branch: `master`**.
28+
- Feature branches may exist for development, but no other long-lived maintained branches (no `release/*` branches).
29+
30+
## 4) Breaking changes policy
31+
32+
A change is considered **breaking** if it changes **public API or behavior** in a way that can break existing consumers.
33+
34+
This includes (non-exhaustive):
35+
- Changes to function signatures, types, macros, constants in `include/esp-stub-lib/**`
36+
- Removal/renaming of any public API surface
37+
- Behavioral changes that break existing correct usage (even if the header signature is unchanged)
38+
39+
### Required review for breaking changes
40+
Any PR that introduces a breaking change MUST be reviewed by **all teams** before merge.
41+
42+
Operationally:
43+
- PR must be clearly marked as breaking (e.g. title prefix `BREAKING:` and/or label `breaking-change`)
44+
- The merge commit must follow the Conventional Commits breaking-change format so that commitizen detects it automatically:
45+
- Use `!` after the type/scope: `feat(flash)!: change read buffer type`, **or**
46+
- Include a `BREAKING CHANGE:` footer in the commit body
47+
- Approval from all teams is required to merge
48+
49+
## 5) Who can release / tag
50+
51+
Each team is allowed to create releases/tags.
52+
53+
Typical flow:
54+
- Team A merges a change to `master` that they need in their tool.
55+
- Team A validates the commit with their tool, then performs a release directly on `master`:
56+
- Run `cz bump` on the up-to-date `master` branch — this commits a version bump and creates the tag locally.
57+
- Push both the commit and the tag: `git push && git push --tags`.
58+
- No separate release PR is needed. The push triggers CI and creates a draft GitHub release with auto-generated release notes. The same person who tagged may review and publish the draft.
59+
- Team B (and any other teams) can run automation that reacts to new tags (e.g., opens a PR to bump the submodule to the new tag) and executes integration tests.
60+
- Teams can either:
61+
- accept and merge the bump to keep up with the flow (reducing future catch-up cost), or
62+
- defer if they have a blocking issue, understanding that later upgrades will include more accumulated changes.
63+
64+
## 6) Expectations for release quality
65+
66+
Because tags are the supported integration points:
67+
- Do not tag a release unless it is buildable and passes the releasing team's integration test(s).
68+
- If a release is found to be bad, follow SemVer:
69+
- ship a new PATCH release with the fix, or
70+
- if necessary, ship a revert + PATCH release
71+
72+
(Do not move/retag an existing version tag.)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ pre-commit install -t pre-commit -t commit-msg
123123

124124
# How To Release (For Maintainers Only)
125125

126+
See [MAINTENANCE.md](MAINTENANCE.md) for the full maintenance and release policy (versioning, breaking changes, branch policy).
127+
126128
```bash
127129
pip install commitizen
128130
git fetch

0 commit comments

Comments
 (0)