Skip to content

ci/package_checks: Add a check for installed licenses#8772

Merged
EbonJaeger merged 1 commit into
mainfrom
add-license-check
May 19, 2026
Merged

ci/package_checks: Add a check for installed licenses#8772
EbonJaeger merged 1 commit into
mainfrom
add-license-check

Conversation

@silkeh

@silkeh silkeh commented May 6, 2026

Copy link
Copy Markdown
Member

Summary

Add a check that emits a warning when a package does not include license files.

See #7294

Test Plan

$ common/CI/package_checks.py packages/py/python3/pspec_x86_64.xml 
Checking files: packages/py/python3/pspec_x86_64.xml
Found 1 result(s), 1 warnings and 0 error(s)
WRN packages/py/python3/pspec_x86_64.xml:1: Package is missing a license in /usr/share/licenses/
$ common/CI/package_checks.py packages/s/snapd/pspec_x86_64.xml 
Checking files: packages/s/snapd/pspec_x86_64.xml
Found 0 result(s), 0 warnings and 0 error(s)

Checklist

  • Package was built and tested against unstable
  • This change could gainfully be listed in the weekly sync notes once merged
  • I agree to license this contribution and all my previous contributions under the licensing terms in LICENSE.md and have the power and authority to grant those licenses.

@EbonJaeger

Copy link
Copy Markdown
Member

Unfortunately, it is not quite that simple. Python packages usually install license files to /usr/lib/python3.12/site-packages/${project}-${version}.dist-info/licenses/. Ruby gemfile projects I think also install licenses to the gem directory somewhere. There may be other edge cases that I don't know about.

@silkeh silkeh force-pushed the add-license-check branch from 67fd26a to 58173a6 Compare May 13, 2026 10:19
@silkeh silkeh force-pushed the add-license-check branch from 58173a6 to 2703a9d Compare May 13, 2026 10:20
@silkeh

silkeh commented May 13, 2026

Copy link
Copy Markdown
Member Author

Unfortunately, it is not quite that simple. Python packages usually install license files to /usr/lib/python3.12/site-packages/${project}-${version}.dist-info/licenses/. Ruby gemfile projects I think also install licenses to the gem directory somewhere. There may be other edge cases that I don't know about.

I've changed the check to use a list of patterns which can easily be extended. That should make it possible to cover all the situations. It's also a warning, so it shouldn't block PRs when no licenses can be found.

@EbonJaeger EbonJaeger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oops, I didn't see that this had been updated. LGTM, thanks!

@EbonJaeger EbonJaeger merged commit 82dd38e into main May 19, 2026
2 checks passed
@EbonJaeger EbonJaeger deleted the add-license-check branch May 19, 2026 21:14
@github-project-automation github-project-automation Bot moved this from Triage to Done in Solus May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants