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

ScanCode error handling improvements #9197

Merged
merged 4 commits into from
Sep 26, 2024
Merged

ScanCode error handling improvements #9197

merged 4 commits into from
Sep 26, 2024

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth requested a review from a team as a code owner September 25, 2024 15:56
@sschuberth sschuberth enabled auto-merge (rebase) September 25, 2024 15:56
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.10%. Comparing base (ad1329b) to head (ec04ed0).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9197   +/-   ##
=========================================
  Coverage     67.10%   67.10%           
  Complexity     1187     1187           
=========================================
  Files           240      240           
  Lines          7908     7908           
  Branches        914      914           
=========================================
  Hits           5307     5307           
  Misses         2233     2233           
  Partials        368      368           
Flag Coverage Δ
funTest-docker 59.82% <ø> (ø)
funTest-non-docker 34.49% <ø> (ø)
test 36.65% <ø> (ø)

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.

)
}
val summary = runCatching {
scanner.scanPath(downloadDir, filteredContext)
Copy link
Member

Choose a reason for hiding this comment

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

commit-message: Could you describe, why catching scanPath() throws is now necessary and maybe outline a real world case where it throws?

Copy link
Member Author

Choose a reason for hiding this comment

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

why catching scanPath() throws is now necessary

It's not now necessary, but always was for proper handling of errors. I've clarified this in the commit message.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
There have reportedly [1] been cases where ScanCode apparently crashed
without printing anything to `stderr`, resulting in no `result.json`
file being written, which causes `readText()` to throw a
`FileNotFoundException`. Properly handle such cases by logging and
creating an issue for them.

[1]: https://oss-review-toolkit.slack.com/archives/C9NNJ54B1/p1727277816661189?thread_ts=1724222709.453049

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth sschuberth merged commit 7a1c59d into main Sep 26, 2024
23 checks passed
@sschuberth sschuberth deleted the scancode-imps branch September 26, 2024 07:17
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.

3 participants