Skip to content

Fix bug validating EE project features

What does this MR do?

In the ProjectFeature class, we define the FEATURES that the class is going to have. We have a validation that checks that we don't set any non-valid value in any of the features.

Nevertheless, in the ProjectFeature EE extension, we also define the EE_FEATURES, but we're not validating those because the validator uses directly the FEATURES constant.

We need to use the value returned from available_features coming from the Featurable concern. That method returns all the features defined in both FOSS and EE.

As well, we can move the validator to the Featurable concern because it's a generic method. We can reuse it later when we implement group features.

How to setup and validate locally (strongly suggested)

  1. Open the rails console and execute:
project = Project.first
project.project_feature.requirements_access_level = Featurable::PUBLIC
project.project_feature.valid?
  1. The valid? operation will return true but it should be false.

Does this MR meet the acceptance criteria?

Conformity

Related to #338821 (closed)

Edited by Francisco Javier López

Merge request reports

Loading