Skip to content

Skip SPDX deprecated licenses

mo khan requested to merge 199264-skip-deprecated-licenses into master

What does this MR do?

While testing the changes in !24829 (merged) I found duplicate names in the SPDX catalogue.

モ curl -s https://spdx.org/licenses/licenses.json | jq '.licenses[].name' | sort | uniq -c | grep -v '1 \"'
      2 "GNU General Public License v1.0 only"
      2 "GNU General Public License v1.0 or later"
      2 "GNU General Public License v2.0 only"
      2 "GNU General Public License v2.0 or later"
      2 "GNU General Public License v3.0 only"
      2 "GNU General Public License v3.0 or later"
      2 "GNU Lesser General Public License v2.1 only"
      2 "GNU Lesser General Public License v3.0 only"
      2 "GNU Lesser General Public License v3.0 or later"
      2 "GNU Library General Public License v2 only"
      2 "GNU Library General Public License v2 or later"
      2 "Standard ML of New Jersey License"

When diving in a bit deeper it looks like the duplicate names exist because the catalogue performs a soft delete by marking the old entry as deprecated via the isLicenseIdDeprecated.

モ curl -s https://spdx.org/licenses/licenses.json | jq '.licenses[] | "\(.licenseId) \(.name) \(.isDeprecatedLicenseId)"' | grep 'GNU General Public License v1.0 only'
"GPL-1.0 GNU General Public License v1.0 only true"
"GPL-1.0-only GNU General Public License v1.0 only false"

This change updates the ImportSoftwareLicensesWorker to skip licenses that have been marked as deprecated in the SPDX catalogue.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports