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(helper-cli): Fix broken reading of scan results by identifier #8613

Merged
merged 1 commit into from
May 3, 2024

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented May 3, 2024

See commit message.

@fviernau fviernau requested a review from a team as a code owner May 3, 2024 11:16
@fviernau fviernau force-pushed the helper-cli-fix-create-command branch 2 times, most recently from 739e12c to 9944229 Compare May 3, 2024 11:18
@fviernau fviernau force-pushed the helper-cli-fix-create-command branch from 9944229 to eb8afcb Compare May 3, 2024 11:20
Copy link

codecov bot commented May 3, 2024

Codecov Report

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

Project coverage is 67.97%. Comparing base (8ed8e2b) to head (c13ff80).
Report is 5 commits behind head on main.

Files Patch % Lines
...ain/kotlin/commands/packageconfig/CreateCommand.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8613   +/-   ##
=========================================
  Coverage     67.97%   67.97%           
  Complexity     1005     1005           
=========================================
  Files           244      244           
  Lines          7844     7844           
  Branches        876      876           
=========================================
  Hits           5332     5332           
  Misses         2129     2129           
  Partials        383      383           
Flag Coverage Δ
funTest-docker 66.49% <ø> (ø)
funTest-non-docker 34.62% <0.00%> (ø)
test 37.93% <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.

@fviernau fviernau enabled auto-merge (rebase) May 3, 2024 11:27
@sschuberth
Copy link
Member

Commit message: Typo in "provnenance".

Copy link
Member

@tsteenbe tsteenbe left a comment

Choose a reason for hiding this comment

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

Tested this PR on several of the projects I currently doing license clearance for .. it working again as expected.

The refactoring done in [1] does not just merge functions, but in
addition changes the behavior of the `read()` function to filter the
result by the provenance of the given package. So, [1] obviously broke
the reading of scan results in `helper-cli`'s `CreateCommand`, see also
[2][3].

A better way to fix this might be to migrate the command to use
a scan results by provenance storage together with a package / nested
provenance storage. As this is a bigger effort, fix the regression from
[1] for now in a rather minimal invasive way, which just bypasses the
filtering by provenance.

[1]: 70b1b86
[2]: https://github.com/oss-review-toolkit/ort/blob/8ed8e2bff913f1d3aafecfb6eb746614f01dfafc/helper-cli/src/main/kotlin/commands/packageconfig/CreateCommand.kt#L123
[3]: https://github.com/oss-review-toolkit/ort/blob/8ed8e2bff913f1d3aafecfb6eb746614f01dfafc/scanner/src/main/kotlin/storages/PackageBasedFileStorage.kt#L75

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the helper-cli-fix-create-command branch from eb8afcb to c13ff80 Compare May 3, 2024 11:36
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.

So, [1] obviously broke the reading of scan results in helper-cli's CreateCommand

Having tests for the helper-cli would certainly help preventing such issues in future.

@fviernau fviernau merged commit 0b56a4e into main May 3, 2024
20 of 21 checks passed
@fviernau fviernau deleted the helper-cli-fix-create-command branch May 3, 2024 13:38
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.

4 participants