fix(SP-4467): correct copyleft docs and remove dead license list#149
Conversation
The README stated the default copyleft license list was defined in src/utils/license.utils.ts. That list (defaultCopyleftLicenses / copyLeftLicenses / init()) was dead code: the field was private and never read, and the actual copyleft decision is delegated to scanoss.py (`scanoss-py inspect copyleft`), which uses the OSADL copyleft checklist (and includes -or-later variants). - README: point the copyleft reference to scanoss.py/OSADL and clarify that -or-later variants are treated as copyleft. - license.utils.ts: remove the unused copyleft sets and init(), keeping only getOSADL() (its single live use, called by report.service.ts). - tests: drop the now-meaningless class-initialization cases, keep the getOSADL coverage. Reported by a customer who noticed the README implied -or-later licenses were not copyleft, while the Action correctly flags them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesLicenseUtil copyleft removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 SCANOSS Code Similarity Detected📄 1 snippet matches found 🔗 View detailed findings on commit 556abb4 Files with similarities:
💡 Click the commit link above to see detailed annotations for each match. |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SP-4467
Background
A customer asked us to confirm how copyleft licenses are determined and reported a discrepancy: the README implies licenses with the
-or-latersuffix are not copyleft, but the Action correctly flags them.Root cause
The README stated the default copyleft license list "is defined in"
src/utils/license.utils.tsand linked to it. That list is dead code:defaultCopyleftLicenses/copyLeftLicensesare populated byinit()butcopyLeftLicensesis aprivatefield that is never read (there is noisCopyLeftmethod). The only live export from the file isgetOSADL(), used byreport.service.tsto build an SPDX URL.scanoss-py inspect copyleft(copyleft-policy-check.ts/copyleft-argument-builder.ts), which determines copyleft from the OSADL copyleft checklist, and OSADL does include-or-latervariants (e.g.GPL-2.0-or-later,AGPL-3.0-or-later).So the Action's behavior is correct; the README was the inaccurate part.
Changes
license.utils.tsto scanoss.py / the OSADL checklist, and clarify that-or-latervariants (and bothYes/Yes (restricted)entries) are treated as copyleft. Also mention theinclude/exclude/explicitcustomization inputs.license.utils.ts: remove the unuseddefaultCopyleftLicenses,copyLeftLicenses, andinit(); keep onlygetOSADL()(its single live use).getOSADL()coverage.Verification
jest license.utils→ 13 passed,license.utils.ts100% coverage.tsc/eslintenv issues in this checkout (UploadArtifactOptions.skipArchive, missingtypescript-eslint) are unrelated and do not touch these files.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Refactor
Tests