refactor(docs): let compose.yaml be the only place an image version appears - #157
Merged
Conversation
…ppears Assertion 6 of check_docs.py asserted that a version quoted in prose *matched* compose.yaml. That kept the documents honest but kept the duplication, and the duplication is the defect: Dependabot edits only compose.yaml, so a version written anywhere else is stale from the next bump onward, and the matching check would have turned every Dependabot PR red until someone hand-edited a table. ci.yml already refuses duplicated pins in shell, YAML and the Makefile — "Image versions are NOT duplicated here ... hardcoded copies went stale silently" — but its grep does not cover Markdown, which is exactly how the six in the stack README survived to become #73. So: drop the versions from the service table, keep the image names, and flip the assertion from "must match" to "must not appear". A version pin reappearing in prose now fails the build even when the version is correct, which is the case the old check could not catch. Mutation-tested: reintroducing `grafana/loki:3.7.6` — the *current* pin, which the previous check accepted — now fails with "only compose.yaml may carry a version". Refs #73 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W1QX12EJLwMfRAWsbpfRJz
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.
Follow-up to #155, taking the alternative its "Known consequence" section named. Refs #73.
What changed
The service table in
stacks/observability/README.mdnow names images without versions, and assertion 6 ofcheck_docs.pyflips from "a version quoted in prose must matchcompose.yaml" to "a version must not appear in prose at all".Why
#155 kept the documents honest but kept the duplication, and the duplication is the actual defect. Two problems with matching:
compose.yaml. A version written anywhere else is stale from the next bump onward — which is precisely how all six in this table became stacks/observability/README.md lists six stale image versions, and CI does not check Markdown #73..gitleaksignore: "a CI job that is permanently red for a known reason gets ignored."ci.ymlalready reached this conclusion for other file types:and enforces it with a grep over
--include='*.sh' --include='*.yml' --include='Makefile'. Markdown is not in that list, which is how the six survived. This is that existing rule, extended to prose — not a new policy.What the check now rejects
Naming an image is fine; naming its version is not.
`prom/prometheus`passes,`prom/prometheus:v3.14.0`does not. It only fires for repositoriescompose.yamlactually pins, so an OS version in the hardware table or an untagged registry path is untouched.The stack README gains a note saying where versions live and that
docker compose imagesprints what is running, so a reader is not left wondering.Blast radius
secrets/*.sops.yamlDocumentation and a build-time check. Nothing deployed, no image or service changed —
compose.yamlis untouched.Verification
Mutation-tested, and deliberately with the case the old check could not catch: reintroducing
`grafana/loki:3.7.6`— the current, correct pin, which #155's matching check accepted —Clean tree:
make validatepasses — not run in full. No docker, promtool, amtool, alloy or gitleaks here, so those sections would have skipped, and skipped checks prove nothing. What ran clean:check_docs.py,markdownlint-cli2,yamllint --strict. CI is the authority on the rest.🤖 Generated with Claude Code
https://claude.ai/code/session_01W1QX12EJLwMfRAWsbpfRJz
Generated by Claude Code