feat(metadata): deprecate non-SPDX license values - #6375
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a deprecation warning when the top-level license: value is not an SPDX license expression (while still accepting and preserving the original value), and documents the change in the Snapcraft 9.0 release notes.
Changes:
- Add a
BeforeValidatortoProject.licensethat warns on non-SPDX values viaemit.warning. - Add unit coverage verifying warnings (or lack thereof) and that the parsed license value remains unchanged.
- Add a release-note entry describing the deprecation.
Documentation Review Report
Reviewed: docs/release-notes/snapcraft-9-0.rst
Date: 2026-08-05
Skills Applied: documentation-build, documentation-diataxis, documentation-structure, documentation-verify, documentation-style
Build Findings (BLOCKING)
Source: documentation-build
- RTD/Sphinx artifacts detected (
.readthedocs.yaml,docs/conf.py,docs/Makefile), but the docs build targets could not be executed in this review environment (no command runner available). Build status is unverified.
Accuracy Findings (CRITICAL)
Source: documentation-verify
- Incorrect: The new release note text states non-SPDX values “must” be SPDX or
proprietary, but the implementation only warns and still accepts any string unchanged (snapcraft/models/project.py:323-335), with test evidence (tests/unit/models/test_projects.py:987-1013).
Diataxis Findings (HIGH)
Source: documentation-diataxis
- Release notes are a hard-to-fit genre (not a strict Diataxis quadrant). Placement under
docs/release-notes/is consistent with the existing structure; no category mismatch identified for the change.
Structure Findings (MEDIUM)
Source: documentation-structure
- No structural issues found in the edited section (heading level and formatting match surrounding release-notes conventions).
Style Findings (LOW)
Source: documentation-style
- No style violations found in the edited section based on the repository style guide excerpt reviewed.
Incomplete Stages
- documentation-build: Could not run
make html/linkcheck/spelling/lint-md/valeto confirm the docs build passes.
Summary
Address the release-note accuracy issue first (it contradicts the implemented behavior), then fix the unit test type annotation mismatch. Docs build should be validated in CI or locally because make html is configured with --fail-on-warning.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
snapcraft/models/project.py |
Adds a validator to warn (but accept) non-SPDX license values. |
tests/unit/models/test_projects.py |
Adds unit coverage for the warning behavior and value preservation. |
docs/release-notes/snapcraft-9-0.rst |
Adds a release-note entry for the license deprecation (currently overstated vs actual behavior). |
Deprecates non-SPDX license expression values in the top-level
license:key.Any license string is still accepted, and this change is backwards-compatible. This just lets us deprecate it for Snapcraft 10.
SNAPCRAFT-1341
make lint && make test.