Skip to content

Commit

Permalink
fix(evaluator): Apply excludes before lookups in the OSADL matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Dec 8, 2023
1 parent eaa29e5 commit e5e0f3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evaluator/src/main/resources/rules/osadl.rules.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ val ruleSet = ruleSet(ortResult, licenseInfoResolver) {
-isExcluded()
}

val projectLicenseInfo = licenseInfoResolver.resolveLicenseInfo(project.id).filter(licenseView)
val projectLicenseInfo = licenseInfoResolver.resolveLicenseInfo(project.id).filter(licenseView).filterExcluded()
val outboundLicenses = projectLicenseInfo.licenses.map { it.license }

// Define a rule that is executed for each license of the dependency.
licenseRule("OSADL_PROJECT_LICENSE_COMPATIBILITY", licenseView) {
// Requirements for the rule to trigger a violation.
require {
-isExcluded()
}

outboundLicenses.forEach { outboundLicense ->
val compatibilityInfo = CompatibilityMatrix
// Be conservative and use the simple license string without the exception string for lookup.
Expand Down

0 comments on commit e5e0f3f

Please sign in to comment.