docs(routes): point the /healthz header at CARGO_PKG_VERSION, not a literal - #327
Merged
Merged
Conversation
…iteral
The module header documented the /healthz response as
`{"status":"ok","version":"0.2.0"}` while the handler in the same file
returns `env!("CARGO_PKG_VERSION")` -- 0.2.0 was the version the day the
line was written (91aaba0, 2026-08-18) and it has been stale for the 26
releases since.
The repo states the "never hardcode the version" rule in three other
carriers (routes/ops.rs, ui/js/app.js, ui/README.md), all of which point
at CARGO_PKG_VERSION as the one source shared with /healthz. Replace the
snapshot with a pointer to that mechanism so it cannot drift again.
Note-style only; no production logic changes.
Owner
Author
|
Self-review (committer,
LGTM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
src/routes/mod.rsmodule header documented the/healthzresponse as{"status":"ok","version":"0.2.0"}, while the handler in the same filereturns
env!("CARGO_PKG_VERSION")(today0.7.28).0.2.0was the correctversion on the day the line was written (
91aaba09, 2026-08-18) and it has beenstale for the 26 releases since.
This one-liner replaces the hardcoded snapshot with a pointer to the mechanism
(
<CARGO_PKG_VERSION>), so it cannot drift again. The repository already statesthe "never hardcode the version" rule in three other carriers —
src/routes/ops.rs,ui/js/app.js, andui/README.md— all of which nameCARGO_PKG_VERSIONas theone source shared with
/healthz.Comment-only change: no production logic is touched.
Related Issue
(none — found while reviewing the module headers for claim drift)
Changes
src/routes/mod.rs: the/healthzdoc line now reads{"status":"ok","version":"<CARGO_PKG_VERSION>"}with a short pointer toenv!("CARGO_PKG_VERSION")Tests
cargo test— 426 passed; 0 failed (baseline unchanged)cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleanalready pinned by
routes::tests::healthz_ok, which assertsv["version"] == env!("CARGO_PKG_VERSION"))Checklist
docs/…)docs(routes): …)