Skip to content

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

Screenshot_2024-07-18_at_10.23.22_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Update the SPDX catalog using the rails console
ImportSoftwareLicensesWorker.new.perform
  1. Check the number of spdx licenses in the rails console
SoftwareLicense.spdx.count
  1. Create a new project
  2. Go to Secure > Policies
  3. Click in New policy
  4. Select merge request approval policy
  5. In Rules, select license scan
  6. In License in click in select all and verify that all SPDX licenses are available
Edited by Marcos Rocha

Merge request reports

Loading