build(docs): fix version in rtd builds
Metadata
Current evaluation
PR #4864 merged as commit 3d05bf373: adds a post_checkout `git fetch --tags --unshallow` step to .readthedocs.yaml and installs snapcraft explicitly so docs show the correct version on RTD builds.
Resolution: closed resolved
Reason: The PR itself was merged into main by maintainer tigarmo (2 approvals, no unresolved comments) in commit 3d05bf373, which added the tag-fetch post_checkout job and explicit `pip install .` to the RTD install step; the config is still present in the current .readthedocs.yaml.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Readthedocs builds don't fetch tags when cloning the repo. This is a problem for us because Snapcraft's version comes from the git tag, so do a fetch of the tags as a post-checkout step.
Additionally, explicitly install snapcraft itself (via "pip install .") so that the code that gets the version from git actually runs. Note that this already works on "latest" because that builds off of "main" where this fix has already been applied (when moving to canonical-sphinx).
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox run -m lint`?
- [ ] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`)
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | PR #4864 merged as commit 3d05bf373: adds a post_checkout `git fetch --tags --unshallow` step to .readthedocs.yaml and installs snapcraft explicitly so docs show the correct version on RTD builds. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4864 in commit 3d05bf373, fixing Read the Docs version detection by fetching git tags after checkout and explicitly installing Snapcraft. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #4864 in commit 3d05bf373, fixing Read the Docs version detection by fetching git tags after checkout and explicitly installing Snapcraft. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4864 in commit 3d05bf373 to fix Read the Docs version builds by fetching git tags and installing Snapcraft explicitly. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix for ReadTheDocs builds failing to fetch git tags, breaking version reporting. The change adds a post-checkout tag fetch and explicit pip install to ensure the version logic executes correctly. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix for ReadTheDocs builds that failed to extract the correct version due to missing git tags. The change adds a post-checkout tag fetch and explicitly installs snapcraft via pip to ensure version detection runs correctly. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#342
(confidence 40%)
Later commit 5cf407731 'ci: fetch tags on readthedocs (#342)' re-applies/keeps the same tag-fetch step after the docs toolchain moved to uv/Makefile, confirming the fix persisted.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #6295 docs: fix version numbering | snapcraft | merged | Merged #6295 (commit 8456b4421), fixing docs version numbering to use Read the Docs branch metadata and keep local and RTD builds consistent. | |
| #6390 docs: fix version in Snapcraft 8 | snapcraft | merged | Merged #6390 corrected Snapcraft 8 RTD title versioning: local, PR, and branch builds show major.minor, while the latest branch shows dev. | |
| #219 docs: fix readthedocs documentation generation | craft-parts | merged | Merged PR #219 (commit c70294ee, merge 996ed24e) fixed RTD doc builds: added missing packages to the readthedocs env, indexed the changelog, and removed outdated python-apt from setup.py. Shipped in release 1.7.0. | |
| #2830 docs: fix version string for 'latest' | charmcraft | merged | Docs-only PR merged: RTD page titles now show major.minor for local/PR/branch builds, with 'latest' branch showing 'dev', following simplification of RTD version slugs (+2/-6 in one file). | |
| #6389 docs: fix version in Snapcraft 9 | snapcraft | merged | Merged PR #6389 (commit 7b092076d) fixed Snapcraft 9 docs versioning: builds show major.minor, while latest shows dev. | |
| #586 docs: fix incorrect version in documentation | rockcraft | merged | Merged in #586 via commits 0ffc2395 and d5da1878, fixing #584 by fetching tags for Read the Docs and labeling unreleased docs as dev. | |
| #342 ci: fetch tags on readthedocs | starbase | merged | Merged PR canonical/starbase#342 (commit 5cf4077, "ci: fetch tags on readthedocs") adds a post_checkout step `git fetch --tags --unshallow` to .readthedocs.yaml so RTD builds have tags. | |
| #6388 docs: fix version in Snapcraft 7 | snapcraft | merged | Merged PR #6388 hard-coded the release as Snapcraft 7 in the docs, mirroring #6387 because snapcraft.__version__ does not match the docs-only branch. | |
| #588 docs: fix version in title | starbase | merged | Merged docs fix (commit 23328cd): docs page titles now display major.minor version for local, PR and branch builds; only the 'latest' branch shows 'dev', following the RTD version slug simplification. | |
| #4258 docs: enable RTD builds | snapcraft | merged | Merged PR #4258 enabled Read the Docs builds by adding documentation build configuration; merged as commit 4d0d75112. |