Repository navigation
fix LicenseRef handled incorrectly during satisfies check - #167
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Nested LicenseRef alternatives can still be dropped when an OR operand contains an expanded AND expression.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes LicenseRef alternatives being dropped during SPDX satisfaction checks.
Changes:
- Retains LicenseRef nodes while expanding OR expressions.
- Adds satisfaction tests for LicenseRef and DocumentRef combinations.
| File | Description |
|---|---|
spdxexp/satisfies.go |
Preserves LicenseRef OR operands. |
spdxexp/satisfies_test.go |
Adds regression cases for reference alternatives. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2 tasks done
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The expansion logic now handles reference alternatives correctly at arbitrary nesting depths with comprehensive regression coverage.
Review effort: Balanced
Findings: None
Resolved since last review (1)
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.

Closes #165
Co-authored-by: MrBeldum danielbae@ucla.edu
Expanded investigation on other deep expressions involving licenseRefs with OR and AND. This resulted in multiple modifications to the Satisfies support functions including
expandOrTermandappendTerms. Adds tests in the satisfies_test.go file including checks of OR with two licenses, license OR licenseRef, and license OR documentRef along with deeper complex licenses with multiple ORs and ANDs.Initial fix for the reported problem was introduced by @MrBeldum in PR #166.