-
Notifications
You must be signed in to change notification settings - Fork 352
Also report detected main licenses as part of SPDX's licenseDeclared
field
#9301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9301 +/- ##
=========================================
Coverage 67.67% 67.67%
Complexity 1223 1223
=========================================
Files 244 244
Lines 8626 8626
Branches 911 911
=========================================
Hits 5838 5838
Misses 2413 2413
Partials 375 375
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6830e6a
to
26fa09c
Compare
licenseDeclared
fieldlicenseDeclared
field
715e3ee
to
d333bf6
Compare
plugins/reporters/spdx/src/funTest/kotlin/SpdxDocumentReporterFunTest.kt
Show resolved
Hide resolved
43a62c1
to
dd744ba
Compare
dd744ba
to
65564d2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
65564d2
to
5d60e8e
Compare
val patterns = LicenseFilePatterns.getInstance() | ||
val detectedPackageLicenses = resolvedLicenseExpressions.filterTo(mutableSetOf()) { licenseInfo -> | ||
licenseInfo.locations.any { | ||
FileMatcher.match(patterns.allLicenseFilenames, it.location.path, ignoreCase = true) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Because probably being the most natural string representation for an `SpdxExpression`, it makes sense to move that function to `spdx-utils`. Note that in order to continue working for `null`, it needs to stay an extension function and not just override `toString()` in `SpdxExpression`. Signed-off-by: Sebastian Schuberth <[email protected]>
Go projects are a bit special in that their dependencies are just links to Git repositories that have no metadata associated, and thus have no declared licenses in the ORT sense. Also, ORT and the purl specification treat Go dependencies differently with respect to whether they have namespaces, so it is good to have additional test coverage here as the SPDX document contains external purl references. Signed-off-by: Sebastian Schuberth <[email protected]>
Reduce the diff when introducing an upcoming feature. Signed-off-by: Sebastian Schuberth <[email protected]>
5d60e8e
to
e644284
Compare
The SPDX `licenseDeclared` field for a package [1] is not a declared license in the ORT sense (which means that it must originate from package metadata only), but should list any "licenses that have been declared by the authors of the package" in any way, including as part of a `LICENSE` file, which in the ORT sense would be a detected license. To account for that, also use licenses detected in root license files as licenses "declared" for the package. This solves the concrete case for Go packages that so far did not have any `licenseDeclared` set, as they are just pointers to Git repositories which have no metadata associated. Note that the overly complex SPDX expressions will get simplified in a later PR. [1]: https://spdx.github.io/spdx-spec/v2.2.2/package-information/#715-declared-license-field Signed-off-by: Sebastian Schuberth <[email protected]>
Signed-off-by: Sebastian Schuberth <[email protected]>
e644284
to
f63243d
Compare
Please have a look at the individual commit messages for the details.
Things to note:
BSD-3-Clause AND BSD-3-Clause
#8714.