Skip to content

Fix matching license policy names when contains whitespaces

What does this MR do and why?

This MR fixes the problem where license policy name container whitespaces at the beginning or the end of the name. We are stripping these values to remove this problem.

How to set up and validate locally

  1. Create project and configure simple .gitlab-ci.yml file
  2. Enable License-Scanning (https://docs.gitlab.com/ee/user/compliance/license_compliance/#include-the-license-scanning-template)
  3. Copy https://gitlab.com/gitlab-org/gitlab/-/blob/master/package.json to the repository
  4. Wait for pipeline to finish
  5. Go to Security & Compliance -> License compliance -> Policies
  6. Try to create new policy with additional whitespace at the beginning and the end of the name
  7. Notice that it is being saved with stripped name

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #387987 (closed)

Merge request reports

Loading