Skip to content

License Compliance Approvals required even when no new denied licenses have been found

Summary

Screen_Shot_2021-05-17_at_8.59.03_AM

The license compliance capability is inappropriately blocking users from merging. This is a similar issue to what our security compliance capability suffered prior to 13.4.

Steps to reproduce

  1. Deny one of the licenses existing on the default branch.
  2. Turn on the License Approval feature
  3. Create an MR that doesn't change anything related to licenses (like update Readme)
  4. Wait until the pipeline is finished.

Example Project

What is the current bug behavior?

License approval is required because of denied licenses added

What is the expected correct behavior?

License approval is fall back to optional

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Implementation plan

  1. Add a condition to has_denied_policies? to check only new licenses
  2. Use Ci::CompareLicenseScanningReportsService to get a list of added licenses and then check what is denied
  3. Add tests that cover this case
Edited by Tetiana Chupryna