Repository navigation
version_project dates a Sphinx document too, with the tag namespace stripped - #37
Open
tobiaskaestner wants to merge 1 commit into
Open
tobiaskaestner wants to merge 1 commit into
tobiaskaestner wants to merge 1 commit into
Conversation
zdocs_conf resolved a Sphinx document's version from version_scope in the consuming repository and never read version_project. The Doxygen path (docrefs.py version) did, so the two toolchains could show different versions for one repository. A document that a downstream set builds from an upstream west project through doc_dir: showed the downstream repository's version. version_project now names the repository that dates the document, for Sphinx documents, the Doxygen CLI and the PDF file names alike (docrefs.document_version): - with version_project, the repository is that west project (west list, run in ZDOCS_WEST_TOPDIR); without it, ZDOCS_PROJECT_BASE as before; - version_scope is matched in that repository, so an upstream document shows the version of its own build when the scope is copied too; - version_project alone gives the project's nearest tag with the namespace stripped (sysreq/v1.0 -> v1.0); - the v0.0-dev+g<sha> fallback takes the sha of that repository, also for a project without tags (it was a bare sha), so an untagged upstream document shows the same downstream as in its own build. A registry that set both keys showed the consuming repository's scoped tags and now shows the project's. The registry schema says so; ADR 0016 records the decision (0015 is the strict-mode ADR of another branch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tobias Kaestner <tobias.kaestner@inovex.de>
This branch has not been deployed
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.
Closes #25
Based on
main, independent of #35 (sphinx-needs 9.2) and #36 (strict mode). ADR number: this adds ADR 0016, because #36 adds 0015 and the #26 PR adds 0017. Each PR adds one line after0014indecisions/index.rst, so a trivial conflict there is expected; I can rebase on request.What changed
version_projectnow names the repository that dates the document, andversion_scopenames which of its tags. One function,docrefs.document_version, serves Sphinx documents (zdocs_conf), the Doxygen CLI (docrefs.py version) and the PDF file names (pdf_files):version_project, the repository is that west project (west list, run inZDOCS_WEST_TOPDIR). Without it, the repository isZDOCS_PROJECT_BASE, as before.version_scopeis matched as<scope>/*in that repository and stripped. So an upstream document built downstream with the upstream's scope copied shows the same version as in the upstream's own build.version_projectwithout a scope gives the project's nearest tag with the namespace stripped (sysreq/v1.0→v1.0).v0.0-dev+g<sha>fallback takes the sha of that repository. A project without tags also gets the fallback. Before,--alwaysgave a bare sha, so an untagged upstream document showedacb2519downstream andv0.0-dev+gacb2519in its own build.version_scope,version_project), ADR 0016, the CLI help.Why
zdocs_conf.py:185passed onlyscope, so Sphinx and Doxygen could show different versions for one repository. An upstream document built throughdoc_dir:showed the consuming repository's version.How tested
test_docrefs_version.py(9 tests) on a real west workspace (.west/configand a manifest) with two git repositories. It covers scope alone, project alone (namespace stripped), scope matched in the project, fallbacks, theVERSIONoverride,ZDOCS_WEST_TOPDIRfrom the environment, CLI == Sphinx path, and an untagged project. Control: without thedocrefs.pychange, 5 fail. Full suites: 565 passed (8.3, CI pins). One test fake ofRefsintest_zdocs_latex.pygainedversion_project.zdocs-tests, 8.3): 238 passed, 11 failed, 20 skipped: the same failure set asmainin the same environment (the 11 come from the environment and already fail onmain; details in sphinx-needs 9.2; unique prefixes; no group with a document's target name #35).doc-checkOK.check --all): passes. The upstream requirements document now shows the version of its own repository in every set:v0.0-dev+gacb2519in its own repo, in the downstream ee repo and in the manifest full set. Before, it showed the ee sha and the manifest sha.Open questions
doc_dir's git root (suggested in the issue) is not done. The repository is named in the registry (version_project), not derived. A derived root would change the version of documents in nested repositories or submodules without any registry change. Do you want the derived variant as a default whenversion_projectis absent?westonPATHandZDOCS_WEST_TOPDIRat build time. Without them the consuming repository dates the document, as before (no error).🤖 Generated with Claude Code