License compliance detects licenses for the source branch only in MRs
Summary
License compliance reports "License Compliance detected [x] licenses for the source branch only" in pipeline's license tab, even when there is an associated Merge Requests which target branch has the same licences.
The pipeline view doesn't have the same context as the MR view, so there is no possible comparison between the source and the target branch. Therefore, the wording should not suggest it and rather state what's the result of license scanning for that coresponding pipeline only.
Steps to reproduce
- Create a new project
- Add files from https://github.com/CycloneDX/cyclonedx-php-composer/tree/master/demo/laravel-7.12.0/project
- Create a
.gitlab-ci.ymlfile with:
include:
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
- Check the Dependency List for stored dependencies with their licences in the DB.
- Create a new merge request with any change other than the dependency files from 2.
- Check the pipeline view -> Licences
Example Project
https://gitlab.com/gitlab-org/secure/tests/olivier/mr-license-widget-comparison
What is the current bug behavior?
License Compliance reports "License Compliance detected 3 licenses for the source branch only"
What is the expected correct behavior?
License Compliance reports "License Compliance detected 3 license"
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)
