Ingest unknown licenses with occurrence count
What does this MR do and why?
We aim to ensure the proper ingestion of SBOM occurrences, where unknown licenses are stored with their respective occurrence count in the following format:
{
"name": "<count> unknown",
"spdx_identifier": "unknown",
"url": null
}
| State | DB |
|---|---|
| All Known Licenses | Store only known licenses. |
All unknown Licenses |
Store unknown licenses with their occurrence count included in the license name. |
| Mixed Licenses | Store both known and unknown licenses, with the occurrence count for unknown licenses in the name. |
References
-
Issue: #482764 (closed)
-
Decision table discussion: #482764 (comment 2308009008)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
| Before | After |
|---|---|
| Unknown not displayed for mixed licenses | Unknown displayed with their count |
How to set up and validate locally
-
Clone the example project:
-
Switch to the main branch.
-
Sync your local GDK with the package metadata
- You may need to delete the
Sbom::Occurrencerecords using the Rails console by runningSbom::Occurrence.destroy_all.
- You may need to delete the
-
Trigger a new pipeline:
- Navigate to the Build->Pipelines section in GitLab.
- Manually create a new pipeline for the main branch.
-
Validate the pipeline results:
- Go to the License tab and confirm the presence of the
markupsafelicense. - Verify that the
markupsafeunknown license is not listed in the Secure->Dependency List.
- Go to the License tab and confirm the presence of the
-
Switch to this merge request branch.
-
Repeat steps 4 and 5 for this branch.
-
Verify the following:
- The License tab still displays the
markupsafelicense. - The Dependency List now includes the
markupsafeunknown license.
- The License tab still displays the
Edited by Ugo Nnanna Okeadu