License compliance report shows legacy approval_status [backend]
Summary
When generating a report comparison the classification of a license uses legacy classification names.
See this thread for more information.
These should be converted to the expected classifications: https://gitlab.com/gitlab-org/gitlab/blob/f385377cf38d187f138885af984a7d66f3628e0f/ee/app/models/software_license_policy.rb#L9
What is the current bug behavior?
approval_status
is reported as legacy name (e.g. blacklisted
, approved
).
What is the expected correct behavior?
approval_status
should return non-legacy name (denied
, allowed
).
Implementation plan
- Rename
approval_status
intolegacy_approval_status
and use it in EE::Entity::ManagedLicense we need this to ensure no breaking changes in API, as that will be tackled separately in #335707 (closed) - Create a feature flag
- Hide under feature flag
lc_remove_legacy_approval_status
new behavior ofapproval_status
so it returns classification. - Update tests that will fail:
- ee/spec/controllers/projects/pipelines_controller_spec.rb:107
- ee/spec/models/software_license_policy_spec.rb
- Fix https://gitlab.com/gitlab-org/gitlab/-/blob/033101d9a98b2338038c87ec0356de10222a180d/ee/app/models/ee/merge_request.rb#L183 and remove legacy names
Testing
-
update merge request widget spec to disable feature flag (should be turned on after #335868 (closed))
SET to test E2E tests with the feature flag set and unset.
Edited by Igor Frenkel