Skip to content

[License Compliance Widget Extension] - Backend - Add denied_licenses count to the collapsed license report endpoint.

As a follow up to:

#356336 (closed)

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

denied_licenses_v13_3

Implementation plan

  1. Enhance LicenseCompliance::CollapsedComparerEntity and LicenseCompliance::ComparerEntity with has_denied_licenses field. This field should return information if there are NEW DENIED licenses in the report in comparison to the default branch.
  2. This field should get the count of denied licenses
  3. 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