[License Compliance Widget Extension] - Backend - Add denied_licenses count to the collapsed license report endpoint.
As a follow up to:
Description
Add field to indicate denied_licenses
count. We should build on the summary endpoint that will be added in #350333 (closed)
Before
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,
"approval_required": $boolean
}
After
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,
"has_denied_licenses" : $boolean
"approval_required": $boolean
}
Why we need this field
So the UI can know when to indicate policy violations in the description
Implementation plan
- Enhance
LicenseCompliance::CollapsedComparerEntity
andLicenseCompliance::ComparerEntity
withhas_denied_licenses
field. This field should return information if there are NEW DENIED licenses in the report in comparison to the default branch. - This field should get the count of denied licenses
- Update tests.
Testing
The SET should update the relevant E2E tests to support the presence/non-presence of the text within the widget accordingly.
Edited by Will Meek