Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12487 +/- ##
============================================
- Coverage 59.21% 59.18% -0.03%
Complexity 1892 1892
============================================
Files 366 366
Lines 13839 13837 -2
Branches 1462 1462
============================================
- Hits 8195 8190 -5
- Misses 5115 5118 +3
Partials 529 529
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
IIUC this fixes a bug where incorrect operators are used for some package managers if declared license mappings are applied, so to me it would make sense to have this independent of any other change. |
| val declaredLicenses: Set<String>, | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_DEFAULT) | ||
| val declaredLicensesOperator: SpdxOperator = SpdxOperator.AND, |
There was a problem hiding this comment.
As the operator in use should only vary per ecosystem / package manager, does it really make sense to store this on the package level?
There was a problem hiding this comment.
Please explain why. Meaning: Not why it's programmatically easier to do so, but why it semantically makes sense. Specifically, it's unclear to me why for an ecosystem that by default uses OR, we should serialize the OR operator for every package.
There was a problem hiding this comment.
Please explain why.
- The package becomes self contained
- The decision about the operator remains flexible, and remains in the package manager plugin
- It would easily possible to allow curating the operator
- No unnecessary limitations
- Things are more obvious, regarding
declaredLicenses, e.g. the operator is next to it.
There was a problem hiding this comment.
Hmm. 1) and 5) are essentially the same thing ("self contained" vs. "next to it"). Likewise for 2) and 4), because "more flexibility" is just a different way to say "fewer limitations". And for 3), I cannot think of a case where this can occur for a single package: If the operator as defined by the package manager implementation is wrong, it's most certainly wrong for all created packages of that package manager.
I'm not saying that for me this concrete proposal is totally out of the question. But so far the arguments are not convincing me fully. But it also depends on how we weight the different aspects, e.g. redundancy / storage vs. explicitness / (potential) flexibility.
There was a problem hiding this comment.
Mind sharing your counterarguments?
There was a problem hiding this comment.
To repeat what I wrote above:
Specifically, it's unclear to me why for an ecosystem that by default uses
OR, we should serialize theORoperator for every package.
To me, storing this per-package is a waste of memory and disk space (for the non-default case) without a clear benefit.
There was a problem hiding this comment.
To me, the benefit is clear, and the amount of added memory and disk scace neglegible, so we are stuck now in discussing this.
There was a problem hiding this comment.
I'm fine to be overridden. I just cannot (yet) wholeheartedly approve this on my own.
Esp. @mnonnenmacher and @MarcelBochtler, please also share your views, not only on the idea, but also the concrete implementation.
There was a problem hiding this comment.
I'm fine to be overridden. I just cannot (yet) wholeheartedly approve this on my own.
yes, I know such situations from myself too, no problem.
Esp. @mnonnenmacher and @MarcelBochtler, please also share your views,
yeah, let's just decide this as a group.
#10995 does not fix anything, it only adds a test. @sschuberth did you maybe mix-up the pull-id? e.g. maybe it was #10961? I suppose it was 10961, so again
Yes, it not only helps but this PR already cleans up that code, and that is mentioned in the commit message, too. |
6d9c986 to
04a227d
Compare
No, I was indeed meaning to refer to #10995 as its description says I'll edit that PR's description to clarify. |
a8c06c7 to
0947924
Compare
Prepare for an upcoming change. Signed-off-by: Frank Viernau <frank.viernau@gmail.com>
Any package has two versions of `declaredLicensesProcessed`: 1. The one contained in `AnalyzerResult` as set by the package manager 2. The one in the curated package, which is recomputed from the raw declared licenses, when curations get applied, e.g. in `OrtResult.kt`. Add the operator corresponding to the (raw) declared licenses to `Package`, so that the semantics of these (raw) declared licenses is clear, and the package self-contained in that regard. Also the code for re-computing the `declaredLicenseProcessed` in `PackageCurationData` becomes more straight forward. Note: This allows for dropping computing the processed license for uncurated packages entirely, so that the processing happens only as part of curating an uncurated package. Signed-off-by: Frank Viernau <frank.viernau@gmail.com>
Signed-off-by: Frank Viernau <frank.viernau@gmail.com>
0947924 to
8e337ad
Compare
|
Notes from discussion in dev call:
|
PackagedeclaredLicensesOperator
While this PR is part of #11459, it makes sense indepenndently of it.
In #11459 this is a necessary preparation, for not computing the processedDeclaredLicense for uncurated packages anymore.
It adds
Package.declaredLicensesOperator, which has been the missing information needed for recomputing the processed declared license from the raw one(s). It make things more straight forward and clear, and simplifies the fix done by #10961.Part of #11459.