-
Notifications
You must be signed in to change notification settings - Fork 352
model: Introduce a concludedCopyrights
field to package curations
#5680
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,16 @@ data class Package( | |
@JsonInclude(JsonInclude.Include.NON_DEFAULT) | ||
val authors: SortedSet<String> = sortedSetOf(), | ||
|
||
/** | ||
* The set of concluded copyright statements for this package. It can be used to override the [detected copyright | ||
* statements][CopyrightFinding.statement] (note that there is no such thing as *declared* copyright statements | ||
* because package managers do not support declaring them explicitly). | ||
* | ||
* ORT itself does not set this field, it needs to be set by the user using a [PackageCuration]. | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_DEFAULT) | ||
val concludedCopyrights: SortedSet<String> = sortedSetOf(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was decided during PR grooming by the TSC that the current implementation is not sufficient even as a minimal solution. At a minimum, this set should be a map that associates license names with their copyright holder in order to not associate concluded copyrights to all licenses found in a package. |
||
|
||
/** | ||
* The set of licenses declared for this package. This does not necessarily correspond to the licenses as detected | ||
* by a scanner. Both need to be taken into account for any conclusions. | ||
|
@@ -138,6 +148,7 @@ data class Package( | |
id = Identifier.EMPTY, | ||
purl = "", | ||
authors = sortedSetOf(), | ||
concludedCopyrights = sortedSetOf(), | ||
declaredLicenses = sortedSetOf(), | ||
declaredLicensesProcessed = ProcessedDeclaredLicense.EMPTY, | ||
concludedLicense = null, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ class PackageCurationTest : WordSpec({ | |
purl = "pkg:maven/org.hamcrest/[email protected]#subpath=src/main/java/org/hamcrest/core", | ||
cpe = "cpe:2.3:a:apache:commons_io:2.8.0:rc2:*:*:*:*:*:*", | ||
authors = sortedSetOf("author 1", "author 2"), | ||
declaredLicenseMapping = mapOf("license a" to "Apache-2.0".toSpdx()), | ||
concludedCopyrights = sortedSetOf("copyright 1", "copyright 2"), | ||
concludedLicense = "license1 OR license2".toSpdx(), | ||
description = "description", | ||
homepageUrl = "http://home.page", | ||
|
@@ -75,7 +75,8 @@ class PackageCurationTest : WordSpec({ | |
path = "path" | ||
), | ||
isMetaDataOnly = true, | ||
isModified = true | ||
isModified = true, | ||
declaredLicenseMapping = mapOf("license a" to "Apache-2.0".toSpdx()) | ||
) | ||
) | ||
|
||
|
@@ -86,6 +87,7 @@ class PackageCurationTest : WordSpec({ | |
purl shouldBe curation.data.purl | ||
cpe shouldBe curation.data.cpe | ||
authors shouldBe curation.data.authors | ||
concludedCopyrights shouldBe curation.data.concludedCopyrights | ||
declaredLicenses shouldBe pkg.declaredLicenses | ||
declaredLicensesProcessed.spdxExpression shouldBe "Apache-2.0".toSpdx() | ||
declaredLicensesProcessed.unmapped should containExactlyInAnyOrder("license b") | ||
|
@@ -147,6 +149,7 @@ class PackageCurationTest : WordSpec({ | |
purl shouldBe pkg.purl | ||
cpe shouldBe pkg.cpe | ||
authors shouldBe pkg.authors | ||
concludedCopyrights shouldBe pkg.concludedCopyrights | ||
declaredLicenses shouldBe pkg.declaredLicenses | ||
concludedLicense shouldBe pkg.concludedLicense | ||
description shouldBe pkg.description | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was decided during PR grooming by the TSC that an implementation of the general feature to conclude copyrights would at first not remove the feature to map authors to copyrights. This is to allow users for a transition period to migrate configuration from one feature to the other smoothly.