Skip to content
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

fix(reporter): Add authors to concluded license in disclosure document #9600

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wkl3nk
Copy link
Contributor

@wkl3nk wkl3nk commented Dec 12, 2024

Include authors for package dependencies when both concluded_license and authors are curated, and ORT is configured with the addAuthorsToCopyrights option enabled. This ensures that package authors appear under the respective concluded license in the Disclosure Document.

This behavior applies when the Scanner option skipConcluded is enabled, having the effect that the scan stage is skipped for the particular package dependency in this case.

Fixes #9599.

Include authors for package dependencies when both `concluded_license`
and `authors` are curated, and ORT is configured with the
`addAuthorsToCopyrights` option enabled. This ensures that package
authors appear under the respective concluded license in the
Disclosure Document.

This behavior applies when the Scanner option `skipConcluded` is
enabled, having the effect that the scan stage is skipped for the
particular package dependency in this case.

Fixes oss-review-toolkit#9599.

Signed-off-by: Wolfgang Klenk <[email protected]>
@wkl3nk wkl3nk requested a review from a team as a code owner December 12, 2024 17:42
@wkl3nk
Copy link
Contributor Author

wkl3nk commented Dec 12, 2024

You may notice that the added code block is just a duplication of a code block that can be found already in code in the same file that handles copyright locations for declared licenses. So what this fix does is to apply the same mechanisms now also for concluded licenses.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 67.91%. Comparing base (709053a) to head (461fb9d).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...el/src/main/kotlin/licenses/LicenseInfoResolver.kt 0.00% 15 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9600      +/-   ##
============================================
- Coverage     68.03%   67.91%   -0.13%     
  Complexity     1285     1285              
============================================
  Files           249      249              
  Lines          8826     8842      +16     
  Branches        920      922       +2     
============================================
  Hits           6005     6005              
- Misses         2432     2447      +15     
- Partials        389      390       +1     
Flag Coverage Δ
funTest-docker 64.96% <ø> (ø)
funTest-non-docker 33.22% <0.00%> (-0.10%) ⬇️
test-ubuntu-24.04 35.74% <0.00%> (?)
test-windows-2022 35.72% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -83,6 +83,26 @@ class LicenseInfoResolver(
licenseInfo.concludedLicenseInfo.concludedLicense?.also {
originalExpressions += ResolvedOriginalExpression(expression = it, source = LicenseSource.CONCLUDED)
}

licenseInfo.declaredLicenseInfo.authors.takeIf { it.isNotEmpty() && addAuthorsToCopyrights }?.also {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to understand better in which situation this is required. Is it when the concluded license contains licenses which are not present in the declared licenses?

statement = statement,
location = UNDEFINED_TEXT_LOCATION,
matchingPathExcludes = emptyList()
)
Copy link
Member

@mnonnenmacher mnonnenmacher Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to a helper function to avoid the duplication.
Also cover this change in the LicenseInfoResolverTest (similar to the existing test "resolve copyrights from authors if enabled").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package curations: In some cases, they authors don't show up in the Disclosure Document
2 participants