Fix missing spdx licenses in the policy editor
What does this MR do and why?
Fix missing spdx licenses in the policy editor
The spdx list has more licenses than our current limit. This MR removes the limit to return all spdx licenses.
Related to: #473181 (closed)
Database query
SELECT
"software_licenses"."name"
FROM
"software_licenses"
WHERE
"software_licenses"."spdx_identifier" IS NOT NULL
ORDER BY
"software_licenses"."name" ASC
LIMIT 1000
https://postgres.ai/console/gitlab/gitlab-production-ci/sessions/30061/commands/93272
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
[2] pry(main)> SoftwareLicense.spdx.count
SoftwareLicense Count (4.8ms) SELECT COUNT(*) FROM "software_licenses" WHERE "software_licenses"."spdx_identifier" IS NOT NULL
=> 633
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Update the SPDX catalog using the rails console
ImportSoftwareLicensesWorker.new.perform
- Check the number of spdx licenses in the rails console
SoftwareLicense.spdx.count
- Create a new project
- Go to Secure > Policies
- Click in New policy
- Select merge request approval policy
- In Rules, select license scan
- In
License in
click in select all and verify that all SPDX licenses are available
Edited by Marcos Rocha