Skip to content

Commit 292d25e

Browse files
authored
[Comgr] Document API versioning rule in AGENT_CONVENTIONS.md (#3135)
## Summary Adds an explicit API-versioning rule to `amd/comgr/AGENT_CONVENTIONS.md` (section 4, PR workflow): every commit that adds a public `AMD_COMGR_API` function must bump the minor version in `VERSION.txt` and tag the new prototype with a fresh `AMD_COMGR_VERSION_X_Y` macro. This codifies the policy that surfaced when #3008 added `amd_comgr_hotswap_rewrite_with_options` under the already-used `3.3` version without bumping (fixed in its follow-up #3134). The rule captures: - One bump per commit, not per function. - Never reuse the current version's macro for a new API in a later commit. - Don't wait for an official release to bump — we don't know which commit lands in each release, so the version advances when the API is introduced. - Add the symbol to `exportmap.in` under a version node matching the new tag. - `check_api_consistency.py` only enforces `VERSION.txt >=` the highest macro, so it cannot catch version reuse — verify the bump by hand. ## Changes - `AGENT_CONVENTIONS.md`: add the "Bump the version when adding a public API" subsection.
1 parent 58b8c0f commit 292d25e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

amd/comgr/AGENT_CONVENTIONS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,25 @@ a feature PR.
144144
**Tests required.** Each PR is accompanied by tests aiming for 100%
145145
code coverage of the change being added.
146146

147+
**Bump the version when adding a public API.** Any commit that adds a
148+
new `AMD_COMGR_API` function must bump the minor version in
149+
`VERSION.txt` and tag the new prototype(s) with a fresh
150+
`AMD_COMGR_VERSION_X_Y` macro in `include/amd_comgr.h.in`:
151+
152+
- One bump per commit, not per function — a commit adding several APIs
153+
bumps once and tags them all with the same new version.
154+
- Never reuse the current version's macro for a new API in a later
155+
commit. The previous version is already owned by whatever shipped it.
156+
- Don't wait for an official release to bump. We don't know which
157+
commit hash lands in each release, so the version must advance at the
158+
moment the API is introduced.
159+
- Add the symbol to `src/exportmap.in` under a version node matching the
160+
new tag (e.g. `@amd_comgr_NAME@_X.Y { global: ...; } @prev;`), not the
161+
previous node.
162+
- `utils/check_api_consistency.py` only enforces `VERSION.txt >=` the
163+
highest macro, so it will NOT catch a new API that reuses the current
164+
version. Verify the bump by hand.
165+
147166
**Keep the branch rebased.** Resolve conflicts before requesting
148167
review.
149168

0 commit comments

Comments
 (0)