← 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

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.

Suggested action: needs review

Reason: This is a well-documented, low-complexity dependency bump that fixes a real bug (404 URLs from rockcraft init --profile, issue #1312). It includes a regression test, passes lint and test suites, and has clear reasoning. However, it has had zero reviewer engagement in 15 days, so a maintainer review is needed before merging.

Impact: 50 Quick Win: 42.5 Staleness: 45 Complexity: 15 Confidence: 75

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
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 42.5
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

  • Related To: canonical/rockcraft#1312 (confidence 95%)

    The PR body explicitly references and fixes this open issue about 404 URLs from rockcraft init --profile.

Related issues

Issue Project State Summary Similarity
#1312 'rockcraft init --profile' links to non-existent versioned docs (1.20.0 URLs return 404) rockcraft closed Resolved by upgrading craft-application to >=7.2.0, which truncates docs URLs to the major version to prevent 404s. A regression test was added. The issue is closed as fixed.
84%
#634 feat: use versioned form of doc urls rockcraft merged Merged. Updates documentation URLs in error messages and rockcraft init templates to use versioned paths. Approved by two reviewers, passed CI, and modified eight files.
72%
#6409 build(deps): bump craft-application to 7.2.1 snapcraft merged Merged dependency update bumping craft-application to 7.2.1 to resolve issue #1173. Approved after review. CI showed unrelated spread test failures, acknowledged by author.
71%