licensing: default to concatenating with AND, add simple mode for license-check --fix#2057
Merged
sil2100 merged 8 commits intochainguard-dev:mainfrom Jul 7, 2025
Merged
Conversation
… mode option for license-check --fix Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
dannf
previously approved these changes
Jul 2, 2025
Contributor
dannf
left a comment
There was a problem hiding this comment.
Nice! I've a suggestion inside about the flag name, but it's non-blocking
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
… license-adjustments
Member
Author
|
@dannf pushed some changes on top. The flag help description could use some expansion, but I'd recommend doing that as part of future changes. It's all very experimental right now! |
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale: even with our current license checking mechanism, listing out all the licenses properly will end up concatenating them in the package with an OR statement. This is bad. Think of GPL software containing some vendored MIT code - its SBOM will end up with a license string of "GPLv3 OR MIT", which is untrue and potentially dangerous as the code cannot be redistributed with a less restrictive license. Defaulting to AND is a safer bet.
There is an ongoing design and implementation effort to add ability to express relations to licensing: #2050 . But this is a big change and needs an actual design doc I'm afraid.
In the meantime, switching to AND seems a good bet, and I added a renovate
--simpleoption for the--fixmode that doesn't list all the licenses individually (with links to files) but simply deals with listing out just the licenses in one string. It's something we'll want to modify and do properly (listing all the files), but before we do, this is the only safe way of ensuring the person working on the licensing bits has power over relationships between the licenses listed out.--fixjust gives a guideline, nothing more.