-
Notifications
You must be signed in to change notification settings - Fork 314
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
LicenseChoices: Add repository license choices #3801
LicenseChoices: Add repository license choices #3801
Conversation
d8ca3af
to
8251705
Compare
|
||
init { | ||
val choicesWithoutGiven = repositoryLicenseChoices.filter { it.given == null } | ||
require(choicesWithoutGiven.isEmpty()) { |
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.
Why do repositoryLicenseChoices
require a given
but packageLicenseChoices
do not?
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.
When using a package license choice we have a specific effective license of the package a choice (or several) can be applied to, which is most likely to be known before applying the choice. When we have a repository license choice, the license choice would be applied to each package that offers this license as a choice. Making sure that there is a given helps only applying the choice to a wanted given as opposed to all licenses with that choice, which could lead to unwanted choices.
For consistency it would be possible to make given
mandatory for packageLicenseChoices
, but this was previously discussed before and decided otherwise.
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.
Thanks for the explanation, can you add that to the code docs, e.g. for the LicenseChoices
class or the properties? And maybe also to the documentation from the last commit?
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.
I added the explanation to the RepositoryLicenseChoices
, but am unsure if this is how and where it belongs.
I also added it to the documentation.
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.
Thanks, I think this is good enough for now. I just wanted to avoid that when you read this code without knowing the context you stumble over the fact that only one of the properties has this requirement.
reporter/src/funTest/assets/static-html-reporter-test-input.yml
Outdated
Show resolved
Hide resolved
reporter/src/funTest/assets/static-html-reporter-test-input.yml
Outdated
Show resolved
Hide resolved
reporter/src/funTest/assets/static-html-reporter-test-input.yml
Outdated
Show resolved
Hide resolved
8251705
to
5f357fe
Compare
5388f7f
to
a8aaf17
Compare
|
||
init { | ||
val choicesWithoutGiven = repositoryLicenseChoices.filter { it.given == null } | ||
require(choicesWithoutGiven.isEmpty()) { |
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.
Thanks, I think this is good enough for now. I just wanted to avoid that when you read this code without knowing the context you stumble over the fact that only one of the properties has this requirement.
These are meant for license choices that apply to all packages in the repository. Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
a8aaf17
to
b604557
Compare
} | ||
} | ||
} | ||
|
||
private fun PackageRule.LicenseRule.containsLicense(expression: SpdxExpression) = |
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.
Nit: The extraction of this function could have happened in a preparing commit, as it's unrelated to the actual change.
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.
I would prefer to leave these changes together. As with the extraction came a fix for the actual test we weren't aware of before.
Since for a license choice only the concluded is relevant, the license view is changed to use `ONLY_CONCLUDED`. Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
The order of applying the license choices from the different sources ensures that the more precise scope is applied first (=prioritized). Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
Enable to use license choices from different sources (e.g. global and package specific) in a chosen order. Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
Resolves oss-review-toolkit#3396. Signed-off-by: Stephanie Neubauer <Stephanie.Neubauer@bosch.io>
b604557
to
2577355
Compare
Resolves #3396.
Introduce license choices that span the whole project scope and can be overwritten by package specific license choices.