Repository navigation
docs: take the version from one source - #224
Merged
Merged
Conversation
The current release version is taken from the release tag and, on dev,
from the version in CITATION.cff. The docs and the chart's README write
it as a {{ version }} placeholder, which the docs hooks replace with the
version of CITATION.cff and scripts/chart_readme.py with the release
version when the chart is packaged. Comments, templates and tests use
placeholders and refer to sections by anchor.
tests/test_version_mentions.py fails if the current release version
appears outside CITATION.cff, docs/releases/, links to release notes
and migration headings.
Closes #220
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Add a chart version placeholder for chart file names, which use the SemVer form for pre-releases (1.2.3-rc1). - Limit the drift guard to mentions of the version as a release of the app (tag, image, chart, "release"/"version" in prose), so that other uses of the same number don't block a release, and exempt the tests of the release tooling, whose versions are test data. - Keep the 0.4.0 chart URL in the section about upgrading to 0.4.0. - Share the placeholders between the docs hooks and chart_readme.py, and document that files read on GitHub show the placeholders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also find the version as an image tag, an appVersion, a *_VERSION value or after "since", and the chart (SemVer) form of pre-releases. Skip only the allowed parts of a line, so that other mentions on it are still found. Share the placeholder check of the docs hooks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR establishes Sequence diagram for rendering versioned documentationsequenceDiagram
participant Build as MkDocs build
participant Hooks as docs/hooks.py
participant Citation as CITATION.cff
participant Chart as scripts/chart_readme.py
participant Docs as Documentation
Build->>Hooks: on_page_markdown(markdown, page, config, files)
Hooks->>Hooks: uses_placeholders(markdown)
Hooks->>Citation: release_version(text)
Citation-->>Hooks: release version
Hooks->>Chart: substitute(markdown, version)
Chart->>Chart: chart_version(version)
Chart-->>Hooks: substituted Markdown
Hooks-->>Docs: rendered version and chart_version placeholders
Sequence diagram for packaging a versioned chart READMEsequenceDiagram
participant Release as Release tooling
participant Script as scripts/chart_readme.py
participant README as deployment/README.md
participant Chart as Packaged chart
Release->>Script: version_links(markdown, tag)
Script->>Script: substitute(markdown, tag.removeprefix(v))
Script->>Script: chart_version(version)
Script-->>Chart: README with version and chart_version resolved
Chart-->>Release: versioned chart README
Flow diagram for the version drift guardflowchart TD
F[Tracked repository files] --> G[test_version_mentions.py]
G --> V[Read citation.release_version]
V --> M[Find release-version mentions]
M --> A{Mention in allowlist?}
A -->|Yes| P[Permit allowed span]
A -->|No| E[Fail release checks]
P --> R[No drift detected]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #224 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1283 1296 +13
=========================================
+ Hits 1283 1296 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 24, 2026 03:25
This was referenced Oct 24, 2026
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 current release version now comes from one source, so a release no longer needs to find and bump it in many places:
dev,versioninCITATION.cff(newcitation.release_version).{{ version }}and{{ chart_version }}(the SemVer form used in chart file names, e.g.,1.2.3-rc1).docs/hooks.pyreplaces them with the version ofCITATION.cff, including in code blocks and in the included chart README.scripts/chart_readme.pyreplaces them in the packaged chart README. Other{{ ... }}(Helm and Go templates) are left alone. The placeholders are defined once, inscripts/chart_readme.py.1.2.3), and sections referred to by anchor (_helpers.tplnow points todeployment/README.md#to-app-version-040). Historical statements are reworded ("since the first release", "any release").tests/test_version_mentions.pyfails when the current release version, or its chart form, is mentioned as a release of the app outside an allowlist. Release mentions are: a tag, an image or chart name, "release X" or "version X" in prose, inline code, "X on" or "X or later", "since X", andtag:,appVersion:or*_VERSION=. The allowlist isCITATION.cff,docs/releases/, the tests of the release tooling, links to release notes and release assets, and migration headings. Only the allowed part of a line is skipped.docs/development.mddescribes the rule.Closes #220
How it was verified
coverage run --source cloud_registry,scripts -m pytest -W ignore::DeprecationWarning: 1094 passed, 228 skipped (Helm is not installed locally, so CI's "Check Helm chart" job runs those). Coverage is 100%.pre-commit run --all-files: all hooks pass.mkdocs build --strictpasses. No placeholder is left in the site.operations/andupgrading/rendercloud-registry:0.4.0,refs/tags/v0.4.0andcloud-registry-0.4.0.tgz.{{ json .SBOM }}is unchanged.The guard fails on a test line added to
docs/api.md. Run against the tracked files as they are now, it finds nothing for 0.4.0, 0.4.1, 0.5.0, 1.0.0, 2.0.0 and 0.2.0, the foca-common pin. That means mentions of the GA4GH spec version or of dependency versions don't block a release.Review: two rounds of adversarial and quality reviewer subagents. All medium findings and the cheap low ones are fixed: chart file names for pre-releases, guard false positives for 1.0.0 and similar, the 0.4.0 upgrade section, shared placeholders, and allowed spans instead of whole lines.
CI: all checks pass (tests with mongomock and MongoDB 7.0, Helm chart, docs, release readiness, Compose, image scan, CodeQL, Codecov).
Declined review findings
deployment/README.md): this is accepted by design, per the maintainer's decision "chart README via chart_readme.py". It is documented indocs/development.md. The docs and the packaged chart show the version.1.2.3in docstrings: it would be flagged if 1.2.3 is ever released. The guard's message says what to do.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Centralize release-version metadata and render it into documentation and chart artifacts while guarding against version drift.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: