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 #9600

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 behaviour 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, and if either the concluded license is different from the declared license or if no license is declared at all.

Fixes #9599.

@wkl3nk wkl3nk requested a review from a team as a code owner December 12, 2024 17:42
@wkl3nk

This comment was marked as outdated.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.06%. Comparing base (81f58ea) to head (69f0fa4).
Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9600   +/-   ##
=========================================
  Coverage     68.05%   68.06%           
- Complexity     1285     1298   +13     
=========================================
  Files           249      249           
  Lines          8835     8861   +26     
  Branches        921      926    +5     
=========================================
+ Hits           6013     6031   +18     
- Misses         2433     2440    +7     
- Partials        389      390    +1     
Flag Coverage Δ
funTest-docker 65.14% <ø> (ø)
funTest-non-docker 33.28% <0.00%> (-0.04%) ⬇️
test-ubuntu-24.04 35.91% <100.00%> (+0.06%) ⬆️
test-windows-2022 35.88% <100.00%> (+0.06%) ⬆️

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.

@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch 2 times, most recently from 75abb71 to 9d51625 Compare December 13, 2024 11:01
sschuberth

This comment was marked as outdated.

@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch from 9d51625 to 1a4580f Compare December 13, 2024 13:49
@wkl3nk wkl3nk requested a review from sschuberth December 13, 2024 13:52
@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch 2 times, most recently from 053ada6 to 3e6f6f4 Compare December 16, 2024 16:30
Copy link
Member

@mnonnenmacher mnonnenmacher left a comment

Choose a reason for hiding this comment

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

Except for the one comment this change looks good to me. @sschuberth Do you also want to have another look?

@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch 2 times, most recently from 875975c to e0f75f4 Compare December 18, 2024 10:44
@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch from e0f75f4 to 46e8f36 Compare December 19, 2024 09:22
Refactor the code to improve reusability and
maintainability by extracting the functionality for resolving
copyright statements from package authors into a separate
function. The extracted function encapsulates the existing logic,
making it easier to call from multiple places while reducing
duplication.

The refactor does not introduce any changes to the
existing behavior and serves purely as a structural improvement.

Signed-off-by: Wolfgang Klenk <[email protected]>
@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch from 46e8f36 to 642e3d8 Compare December 19, 2024 09:25
@wkl3nk wkl3nk changed the title fix(reporter): Add authors to concluded license in disclosure document fix(reporter): Add authors to concluded license Dec 19, 2024
Copy link
Member

@sschuberth sschuberth left a comment

Choose a reason for hiding this comment

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

Just one more typo to fix 😄

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

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, I had a typo in my proposed commit message: "to be mapped to copyright" needs to say "to be mapped to copyrights".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 typo fixed

…nses

As concluded licenses are supposed to trump other licenses, they are
usually taken instead of declared and detected licenses in reports. When
doing do, and the concluded license is not among the other licenses, any
author information that is configured to be mapped to copyrights would be
dropped. To prevent that, apply the same author to copyright mapping that
is done for declared licenses also for concluded licenses.

Fixes oss-review-toolkit#9599.

Signed-off-by: Wolfgang Klenk <[email protected]>
Verify that package authors defined in a curation file are
added to the concluded license if
ORT option `addAuthorsToCopyrights` is enabled.

Signed-off-by: Wolfgang Klenk <[email protected]>
@wkl3nk wkl3nk force-pushed the wkl3nk/add-authors-to-concluded-licenses branch from 642e3d8 to 69f0fa4 Compare December 19, 2024 15:46
@wkl3nk wkl3nk requested a review from sschuberth December 19, 2024 15:47
@sschuberth sschuberth enabled auto-merge (rebase) December 19, 2024 17:25
@sschuberth sschuberth merged commit 0e4eb80 into oss-review-toolkit:main Dec 19, 2024
25 checks passed
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
3 participants