Add collapsed comparer for license_scanning
What does this MR do and why?
We have an enpoint for License Compliance widget on MR page. Payload over the wire can get pretty big potentially. As a performance Improvement, the MR Widget extension requires an additional endpoint to only represent the data used in the collapsed state of the MR Widget. To reduce the network payload when the user is not uncollapsing the License Compliance MR Widget, making the MR page faster.
url: [https://gitlab.com/gitlab-org/gitlab/-/merge_requests/$MR_ID/license_scanning_reports_collapsed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/%24MR_ID/license_scanning_reports_collapsed)
Response Structure:
{
"new_licenses": $integer_value_of_new_licenses_found,
"existing_licenses": $integer_value_of_existing_licenses_found,
"removed_licenses": $integer_value_of_removed_licenses_found,
}
Screenshots or screen recordings
How to set up and validate locally
- Get a project where
license_scanning
is enabled. - Create an MR, run pipeline
- Send JSON request {histname}/{group/project}/-/merge_requests/{MR_ID}/license_scanning_reports_collapsed
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #350333 (closed)