Skip to content

Remove redundant condition `usage_ping_feature?`

Fabio Pitino requested to merge usage-ping-feture-remove-redundant-check into master

What does this MR do and why?

Remove redundant condition usage_ping_feature? inside the namespace and project level feature check.

Usage Ping feature check has been moved inside License.feature_available? and the namespace and project level feature checks are now getting it for free.

The MR contains removals of spec examples because we are now testing internal implementation details of License.feature_available?. We have good test coverage for all the combinations when Registration (Usage Ping) features are available or not: https://gitlab.com/gitlab-org/gitlab/-/blob/cb89bd98ff1ac0dd898aee92e65c7479b5f9883e/ee/spec/models/license_spec.rb#L1061-1129.

At a higher level of abstraction we only need to test 2 scenarios:

  • Feature exists when stub_licensed_features(the_feature_name: true)
  • Feature does not exist when stub_licensed_features(the_feature_name: false)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Fabio Pitino

Merge request reports