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

Refactor the scanner API to support reading more than ScanCode results from ClearlyDefined #7242

Merged
merged 7 commits into from
Jul 6, 2023

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 July 4, 2023 15:27
@sschuberth sschuberth force-pushed the scanner-api-generate-functions branch from d26c8fd to 63fdf5e Compare July 4, 2023 15:45
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 67.18% and project coverage change: -0.03 ⚠️

Comparison is base (df99e3a) 61.47% compared to head (2c0a890) 61.44%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7242      +/-   ##
============================================
- Coverage     61.47%   61.44%   -0.03%     
- Complexity     1966     1968       +2     
============================================
  Files           333      334       +1     
  Lines         16489    16504      +15     
  Branches       2355     2354       -1     
============================================
+ Hits          10136    10141       +5     
- Misses         5375     5385      +10     
  Partials        978      978              
Flag Coverage Δ
funTest-non-docker 31.77% <62.50%> (-0.05%) ⬇️
test 37.41% <67.18%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...n/kotlin/scanners/scancode/ScanCodeResultParser.kt 84.61% <ø> (-0.62%) ⬇️
...nner/src/main/kotlin/scanners/scancode/ScanCode.kt 74.19% <41.66%> (+3.22%) ⬆️
.../src/main/kotlin/storages/ClearlyDefinedStorage.kt 73.40% <57.57%> (-12.68%) ⬇️
...ain/kotlin/storages/utils/ScanCodeDetailsParser.kt 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sschuberth sschuberth force-pushed the scanner-api-generate-functions branch from 63fdf5e to bd7b39c Compare July 5, 2023 12:29
Move `getVersion()` next to `getVersionRequirement()` for a better
overview.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
This is a prerequisite for decoupling from concrete scanner / parser
implementations and solely relying on the scanner plugin API. The idea
is to later only take results from scan storages whose scanners are
present as plugins.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@sschuberth sschuberth force-pushed the scanner-api-generate-functions branch from bd7b39c to ecfa969 Compare July 6, 2023 09:07
Usually, ScanCode scanner details are obtained from running the ScanCode
CLI command. The only scenario where this is not possible is when
retrieving ScanCode scan results from a scan storage. So, move the
relevant code to storage specific utilities. While at it, give the
functions more specific names.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Fields except for "_metadata" returned by `harvestToolData()` are
tool-specific and should only be parsed by tool-specific code.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
…nners

Filter the tool results from ClearlyDefined by the scanners ORT has
available as a plugin and create a `ScanSummary` with the respective
scanner plugin's function.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@sschuberth sschuberth force-pushed the scanner-api-generate-functions branch from ecfa969 to 2c0a890 Compare July 6, 2023 09:57
@sschuberth sschuberth requested review from fviernau and a team July 6, 2023 09:59
@sschuberth sschuberth enabled auto-merge (rebase) July 6, 2023 15:47
@sschuberth sschuberth merged commit 9e03ee5 into main Jul 6, 2023
@sschuberth sschuberth deleted the scanner-api-generate-functions branch July 6, 2023 16:27
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.

2 participants