License Scanning results do not load in Merge Request for project maintainers

Summary

The License Compliance detected widget does not load information for project maintainers.

Steps to reproduce

  1. Fork a project that does not have license_scanning enabled.
  2. Create a merge request from the forked project to add the license_scanning job.
include:
  - template: License-Scanning.gitlab-ci.yml

At this point the author of the merge request should be able to see the details of the License Scan widget but the project maintainers may not be able to.

Example Project

What is the current bug behavior?

The widget loads the data as expected for the contributor that forked the project and submitted the merge request. The widget does not load the data for owners of the project.

What is the expected correct behavior?

The owners of the project should be able to see the data in the License Compliance detected widget.

Relevant logs and/or screenshots

The Gitlab GUI doesn't load properly for us, and it triggers a Javascript console error "e.mr.licenseManagement is undefined"​.
Is that an issue on our end? Or is there a bug in this fix's interaction with the Gitlab GUI?

For me, it looks like this, even after allowing for a minute or two to load everything. (The gray placeholder boxes have a light-flash-like effect animating them.)

Screenshot_from_2020-03-02_16-50-08

one-touch-pipeline/otp!382 (comment 297167297)

Stack error (please let me know if you need more):
TypeError
​columnNumber: 449729​
fileName: "https://assets.gitlab-static.net/assets/webpack/pages.projects.merge_requests.show.246a806b.chunk.js"
​lineNumber: 1
​message: "e.mr.licenseManagement is undefined"​
stack: "[2724]/Pu<@https://assets.gitlab-static.net/assets/webpack/pages.projects.merge_requests.show.246a806b.chunk.js:1:449729\ne.prototype._render@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:35405\ni@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:68219\ngn.prototype.get@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:26759\ngn.prototype.run@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:27650\nhn@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:25761\nnt/<@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:12424\nXe@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:31:11821\nX/<@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:44:15457\ni@https://assets.gitlab-static.net/assets/webpack/main.b758a266.chunk.js:135:141965\n"​__proto__: Object { stack: "", … } sentry.0721cfd0.chunk.js:1:26144

Output of checks

This bug happens on GitLab.com

Possible fixes

It might be related to code around here or here.

Availability and Testing

SET to create an end to end test to exercise the steps to reproduce.

Expected behaviour should occur.

Edited by Will Meek