Skip to content

Parse keys SPDX lists as exceptions with WITH in license data test - #47

Open
andrew wants to merge 4 commits into
mainfrom
fix-exception-only-spdx-keys
Open

andrew wants to merge 4 commits into
mainfrom
fix-exception-only-spdx-keys

Conversation

@andrew

@andrew andrew commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

The weekly license database update has failed since 2026-11-30 (https://github.com/git-pkgs/spdx/actions/runs/46371879195). ScanCode added Google-Patent-WebM with is_exception: false. go-spdx lists it as an exception, so Parse rejected the bare identifier that TestLicenseDataParses passed it as an invalid license. The test now wraps a key in GPL-2.0-only WITH ... when lookupException returns a match for it, as well as when ScanCode sets is_exception. Parse rejects a bare exception by design, so the fix is limited to the test.

A new report job in the update workflow opens or comments on an issue titled "Update License Database workflow is failing" when the update fails, with a link to the run, and the next successful run closes it. Two separate commits remove the unused isValidLicenseOrException helper and spdx.test, a compiled test binary committed with the initial import.

ScanCode marks Google-Patent-WebM as a license; SPDX lists it as an exception.
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test now considers exception lookup results when deciding whether to build a WITH expression. The unexported isValidLicenseOrException helper was removed.

Changes: License exception parsing test

Layer / File(s) Summary
Exception expression fallback
licensedb_test.go, normalize.go
The test builds a WITH expression when license lookup fails and the entry is marked as an exception or exception lookup recognizes its key. The unexported validation helper was removed.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to 91b14

This change fixes a failing license database update test and removes unused code and a stray binary. It does not change production behavior, and the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: TestLicenseDataParses now wraps keys that SPDX lists as exceptions in a GPL-2.0-only WITH expression before calling Parse. The raw summary describes the test-file chan…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: TestLicenseDataParses now wraps keys that SPDX lists as exceptions in a GPL-2.0-only WITH expression before calling Parse. The raw summary describes the test-file change and the removal of the unused helper, and the objectives match the title. The title is specific and accurate, though it omits the helper removal and the committed binary deletion, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e4d41ee-6d57-4c91-8e60-58f6fdc3ea5f
Commits

Reviewing files that changed from the base of the PR and between dc5533f and 91b14f2.

Files selected for processing: 3

  • licensedb_test.go
  • normalize.go
  • spdx.test
Files with no reviewable changes: 1

  • normalize.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

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.

1 participant