Skip to content

Ignore `default_enabled` value in `Feature.enabled?` [RUN ALL RSPEC] [RUN AS-IF-FOSS]

What does this MR do?

Contributes to #271275 (closed)

Ignores default_enabled argument in Feature.enabled?. Takes default_enabled value from the feature flag definition file instead. That should ensure that everything works as expected without default_enabled argument.

As a side note, default_enabled argument value is always in sync with the default_enabled value in the YAML definition file. We cannot even set the argument value to be different from the one specified in the YAML file.

To make the MR smaller and enable ability to remove default_enabled from Feature.enabled? calls in chunks, I think we can make the following changes separately.

The only part I'm not sure about is either should we update the docs now to mention that the argument it ignored, or leave it till we change the docs after removing default_enabled argument completely.

Follow-up changes

  • Remove default_enabled from Feature.enabled? calls
  • Remove default_enabled argument from Feature.enabled?
  • Remove default_enabled from Feature::Definition.valid_usage!
  • Updated docs: Remove mentions of default_enabled
  • Add a changelog entry (?)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Mayra Cabrera

Merge request reports