Skip to content

Commit 2be3d3e

Browse files
committed
docs: record the single-source-of-truth rule for the version number
The 5.2.0 bump fixed diagnostics.py's drift, but the trap is worth keeping: a comment saying "keep in sync with manifest.json" is not a mechanism, and the value had drifted two releases before anyone saw it.
1 parent 798fa7b commit 2be3d3e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎docs/DEVELOPMENT_NOTES.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ The batF substitution and this one are the same class of decision — an absent
199199
metric becomes a durable zero — and `_merge_all_day_payload` records them
200200
together. Neither is fixed here; both are recorded.
201201

202+
**The version number has exactly one home.** `diagnostics.py` restated it by
203+
hand, comment and all — `"version": "5.1.0", # Keep in sync with manifest.json`
204+
— and by the 5.2.0 release it was two versions stale, so a diagnostics dump
205+
under-reported the running build. A comment cannot keep two copies of a value in
206+
sync. It now reads `manifest.json` at import (HA runs module import in an
207+
executor, so the file read stays off the event loop) and returns `"unknown"` if
208+
the read or the parse fails. If you need the version anywhere else, read the
209+
manifest — do not restate it.
210+
202211
## Git and history
203212

204213
`main` on GitHub has been rewritten more than once during this project's

0 commit comments

Comments
 (0)