Skip to content

feat(metadata): deprecate non-SPDX license values - #6375

Open
bepri wants to merge 5 commits into
mainfrom
work/deprecate-non-spdx/SNAPCRAFT-1341
Open

feat(metadata): deprecate non-SPDX license values#6375
bepri wants to merge 5 commits into
mainfrom
work/deprecate-non-spdx/SNAPCRAFT-1341

Conversation

@bepri

@bepri bepri commented Aug 5, 2026

Copy link
Copy Markdown
Member

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


  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.
  • I've added or updated any relevant documentation.
  • In documents I changed, I added a meta description if one was missing.
  • I've updated the relevant release notes.

@bepri bepri self-assigned this Aug 5, 2026
Copilot AI review requested due to automatic review settings August 5, 2026 20:20
@bepri
bepri requested review from a team and mr-cal as code owners August 5, 2026 20:20
@bepri
bepri marked this pull request as draft August 5, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BeforeValidator to Project.license that warns on non-SPDX values via emit.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/vale to 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).

Comment thread tests/unit/models/test_projects.py Outdated
Comment thread docs/release-notes/snapcraft-9-0.rst Outdated
@bepri
bepri marked this pull request as ready for review August 5, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants