← Back to issue list

fix: use major-version docs URLs in init output

View original Github issue

Metadata

Project
rockcraft
Number
#1341
Type
pull request
State
open
Author
shAsh-cy
Labels
—
Created
Updated
Closed
—

Current evaluation

Updates craft-application to emit major-version documentation URLs, with regression and companion test/docs updates; later main already requires >=7.3.0 and contains these changes, making the PR obsolete.

Suggested action: close superseded

Reason: Main already declares craft-application>=7.3.0, and later commit 035711d7 ('build(deps): update craft-parts and craft-application') is reflected in the current tree; the companion docs exclusion and .spread-reuse.* lifecycle update are also already present. The production fix is therefore superseded, although the proposed regression assertion could be submitted separately if maintainers still want it.

Evaluated by: mr-cal-bot

Impact: 48 Quick Win: 8 Complexity: 34 Confidence: 86 Actionability: 25

Issue body

`rockcraft init --profile <name>` prints a link to that profile's documentation. The printed URL contains the full application version, and that path returns 404: ``` $ curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" \ https://documentation.ubuntu.com/rockcraft/1.20.0/reference/extensions/spring-boot-framework/ 404 https://ubuntu.com/containers/rockcraft/docs/1.20.0/reference/extensions/spring-boot-framework/ ``` The documentation site serves the major version. `1`, `1.19`, `1.20` and `stable` all resolve to `/docs/1/` and return 200. Only the full `major.minor.patch` form fails. The URL is built by `APP_METADATA.versioned_docs_url`, which calls `render_doc_url` in craft-application. Version 7.1.0, pinned in `uv.lock`, substitutes the version verbatim. Version 7.2.0 added `major_only=True`, which truncates to the major version. The fix already exists upstream; rockcraft just needs to pick it up. ## Changes **`uv.lock`**: craft-application 7.1.0 to 7.2.0. Single package, no transitive dependency changes. **`pyproject.toml`**: constraint floor raised from `>=7.1.0` to `>=7.2.0`. The old constraint already permitted 7.2.0, but the test added here fails against 7.1.0, so leaving the floor at 7.1.0 would permit an environment where the suite does not pass. **`tests/unit/test_application.py`**: regression test. Two notes on how it is written: * It asserts a hard-coded URL instead of deriving one from `versioned_docs_url`. The existing assertion in `tests/unit/test_cli.py` puts the same property on both sides of the comparison, so it passes whatever the URL scheme happens to be. * It injects a release-shaped version. `AppMetadata.version` is an `init=False` field derived in `__post_init__` from `rockcraft.__version__`, and a git checkout produces a setuptools_scm string containing `+g`, which `render_doc_url` short-circuits to `latest` before reaching the truncation. Patching `rockcraft.__version__` and calling `dataclasses.replace(APP_METADATA)` re-runs the real derivation and leaves the module-level singleton untouched. **`tests/unit/services/test_lifecycle.py`**: the `ignore_outdated` literal now includes `.spread-reuse.*`. That value is built entirely inside craft-application, and rockcraft has no references to it. `git log -L` on the line shows one commit, `1856eca build(deps): update craft-application to 6.2.1`, whose message does not mention `ignore_outdated`, so the literal records what craft-application emitted at the time rather than an intended contract. 7.2.0 appends `.spread-reuse.*` so that changes to spread test files do not force a re-pull of sources, which matches the reuse files this repo's CI generates and cleans up. **`docs/conf.py`**: excludes `common/craft-application/how-to-guides/pack-a-pro-artifact.rst`. This one is a required companion to the bump rather than incidental cleanup. 7.2.0 ships that page as new shared documentation, which `link_common_docs` symlinks into the docs tree. The page uses substitutions rockcraft does not define (`|app|`, `|artifact|`, `|an-artifact|`, `|app-link|`, `|app-min-pro-version|`) and a `code-block` `:substitutions:` option that needs `sphinx_substitution_extensions`, which is commented out at `docs/conf.py:240`. Without the exclusion the docs build emits 16 errors and a toctree warning, and `.readthedocs.yaml` sets `fail_on_warning: true`, so the build fails. The exclusion sits alongside the five craft-application pages already excluded for the same reason. If rockcraft wants this page, enabling the extension and defining the substitutions would be a separate change. ## Testing Fail to pass was verified directly. With `uv.lock` reverted to craft-application 7.1.0, both parametrisations of the new test fail: ``` AssertionError: assert 'https://documentation.ubuntu.com/rockcraft/1.20.0' == 'https://documentation.ubuntu.com/rockcraft/1' ``` On 7.2.0 they pass. Full suite on 7.2.0, deterministic ordering: ``` 677 passed, 3 skipped ``` That covers `tests/unit` and `tests/integration`. `tests/spread` was not run, since it needs the spread binary and the self-hosted runners. `make lint` passes in full, including sphinx-lint, vale, woke, linkcheck, twine check and `uv lock --check`. `make docs` completes with zero warnings; `docs/_dev/warnings.txt` is empty. Fixes #1312 --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/rockcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've added or updated any relevant documentation. The only documentation change is the exclusion described above. - [x] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. No documentation pages were added or edited. - [ ] I've updated the relevant release notes. `docs/release-notes/` currently ends at 1.20 and there is no file for the next release. Happy to add an entry if there is a target.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 48
Quick Win: 8
Complexity: 34
Confidence: 86
Actionability: 25
close superseded Updates craft-application to emit major-version documentation URLs, with regression and companion test/docs updates; later main already requires >=7.3.0 and contains these changes, making the PR obsolete.
stealth/space-bunny-alpha
Impact: 42
Quick Win: 22
Complexity: 27
Confidence: 91
Actionability: 72
needs review Upgrade craft-application from 7.1.0 to 7.2.0 so init prints valid major-version documentation URLs, add regression coverage, and exclude an incompatible shared docs page. Open with no review or CI results.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 42
Staleness: 45
Complexity: 15
Confidence: 75
needs review Bumps craft-application from 7.1.0 to 7.2.0 to fix 404 URLs in rockcraft init --profile output. Includes regression test and docs exclusion. Unreviewed, 15 days old.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 15
Confidence: 90
needs review Updates craft-application to 7.2.0 to fix 404 documentation URLs in rockcraft init by using major versions. Includes regression tests, test updates, and docs build fixes. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Bumps craft-application to 7.2.0 to fix 404 documentation URLs in init output by using major versions only. Includes regression tests, updates test literals, and excludes a new doc file causing build failures. Currently awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 20
Confidence: 90
needs review Bumps craft-application to 7.2.0 to fix 404 documentation URLs in rockcraft init output by using major version paths. Includes test updates, docs exclusion, and passes all checks. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Updates craft-application to 7.2.0 to fix 404 documentation URLs in rockcraft init output. Includes regression tests, updates test literals, excludes a new doc page causing build failures, and passes all checks. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Updates craft-application dependency to 7.2.0 to fix broken documentation URLs in rockcraft init output by using major-version paths. Includes regression tests and dependency constraint updates. Currently awaiting maintainer review and CI execution.

Update history

Date Change
updated
updated
updated
updated
created

Related work

  • Likely Fixed By: rockcraft#1312 (confidence 98%)

    The PR explicitly claims to fix #1312, and the closed issue describes the same major-version documentation URL fix.

  • Superseded By: rockcraft#1356 (confidence 80%)

    Later application and dependency work is present in main at craft-application>=7.3.0 and includes the companion lifecycle and shared-documentation updates.

Related issues

Issue Project State Summary Similarity
#377 build(deps): update dependency craft-application to v7 (main) imagecraft merged Merged PR #377 via commit 8d6f7c2, upgrading craft-application from ~=6.1 to ~=7.1; all reported CI checks except OSV scanning passed.
72%
#6311 fix(docs): update base docs_url to use stable snapcraft closed Closed unmerged as a duplicate: canonical/craft-application#1140 fixed #6300 in commit 209a1367 by routing remote-build documentation through the major version.
71%