Skip to content

Mutate the attribute instead of issuing a write operation to the DB in `ProjectFeaturesCompatibility` concern.

Gabriel Mazetto requested to merge bug/project-feature-compatibility into master

What does this MR do?

ProjectFeaturesCompatibility concern's currently behavior is to update_attribute:

https://gitlab.com/gitlab-org/gitlab-ee/blob/0515a4470c2a9419929be7d3a7a9279485e0598d/app/models/concerns/project_features_compatibility.rb#L35

This means that even in read operations we are going to get a write operation. This conflicts which the way Geo works, and also is affecting gitlab:env:info. See : https://gitlab.com/gitlab-org/gitlab-ee/issues/1520

Are there points in the code the reviewer needs to double check?

Possible impact on the original intention of the ProjectFeaturesCompatibility concern. If we want it to fix when opening the project, this means we are disabling the behavior. If we want to fix it whenever there is a update/write operation, than we are good.

Why was this MR needed?

Breaking gitlab:env:info means anyone using Geo, who wants to open an issue and follow our templated instructions, will get hit by this error.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

fixes gitlab-org/gitlab-ee#1520

Merge request reports