Add cache for Software Licenses table
What does this MR do and why?
This MR adds cache for the SoftwareLicense as described in the implementation plan of issue #388630 (closed)
The software licenses rarely changes and are returned every time we populate the license type dropdown in the Scan Result Policy
new and edit views.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Pre-requisites
Check if you have the licenses in your database.
- Open the rails console
rails c
- Query the software licenses
[1] pry(main)> SoftwareLicense.all
- If the table is empty, run the ImportSoftwareLicensesWorker
[2] pry(main)> ImportSoftwareLicensesWorker.new.perform
How to check the licenses in the UI
- Create a new project or open an existing one
- Go to
Security and Compliance
->Policies
. - Click on
New policy
- Select
Scan Result Policy
- In
Rules
, SelectLicense Scan
. - Click on the license type dropdown to verify the licenses
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marcos Rocha