feat(scanner): Store detected and effective license in database#4791
feat(scanner): Store detected and effective license in database#4791Joelp03 wants to merge 2 commits intoeclipse-apoapsis:mainfrom
Conversation
|
@Joelp03 Thank you for the contribution! I don't have time to review this now and I won't be available for review for the next week, so some hints for anyone who picks up the review:
|
aca98ee to
f66517c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
For starters, you should run |
FYI, we have the |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
f66517c to
e250b1a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e250b1a to
d77894a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d77894a to
e8fb184
Compare
@Joelp03, can you confirm that esp. this first point from @mnonnenmacher has been addressed? |
It is not yet implemented. This latest commit contains the implementation. |
Store detected licenses and effective license for packages and projects during the scanner phase to make them easily available via API routes without having to traverse all license findings from scan results. - Add detectedLicenses and effectiveLicense columns to packages and projects tables (Flyway V139 migration) - Add fields to Package and Project models - Add DAO support for new columns with comma-separated serialization - Create LicenseComputation.kt with functions to compute licenses - Integrate license computation in ScannerWorker - Expose new fields in API v1 Package and Project responses - Add unit tests for DAO and LicenseComputation Signed-off-by: Joel Pimentel <joelpimentel1995@gmail.com> Resolves eclipse-apoapsis#4607.
511cc09 to
d9cb2e5
Compare
Detected licenses must have PackageCuration and PackageConfiguration applied before storing, otherwise wrong data could be shown. - Change computeDetectedLicenses to use LicenseInfoResolver which applies LicenseFindingCuration and PathExclude from PackageConfiguration - Remove scannerRun parameter from computeAndStoreLicenses since it's no longer needed after using LicenseInfoResolver Signed-off-by: Joelp03 <joelpimentel1995@gmail.com>
d9cb2e5 to
ed6934c
Compare
|
I would appreciate a thorough review of this request to ensure it fully aligns with the project's requirements and standards. Please let me know if any adjustments |
|
Some comments:
See Contributing Guide / Atomic Commits: each commit should be atomic and buildable. The first commit is pretty hard to follow, as it touches four software layers (model, DAO, workers, API) in a single commit. I would consider splitting the commit into smaller, more manageable and reviewable commits with their respective tests, and making sure each commit builds and tests pass. However I will not block this PR because it, as other reviewers may have easier time reading it than me as a non-back-end guy.
Do I understand correctly that no API endpoints are affected yet, ie. no detected/effective license data can yet be retrieved from packages/projects endpoints? I am asking because if the data is already available and meant to be provided by the API in this PR and not a follow-up, the PR should probably also touch
There's a lot of splitting by ",", then joining by "," in the code, which to me is a bit suspicious. |
|
Similar to point 3 from @Etsija : Wouldn't it be preferable to have a normalized data model for the detected licenses, i.e., storing them in a separate table and having a relation to the packages and projects tables? Just asking. |
True, and as I am not exactly loving the fact that my |
Hi there.
This implementation resolves the issue of storing detected and effective licenses for packages and projects in the database during the scanning process, making them readily available for API routes without needing to iterate through all scan results.
Resolve #4607