Add a container_registry project feature
What does this MR do?
Currently, access to a project's container registry is controlled by the boolean projects.container_registry_enabled
column. This MR adds the database and model changes needed to allow visibility of the Container Registry feature to be controlled independent of project visibility, similar to how the visibility of Repository or Issues can be set.
- Adds a new column in
project_features
table calledcontainer_registry_access_level
. - Updates
ProjectFeature
and related classes.
The new column will not be used as yet. In the next MR, we will add a background migration to move values from projects.container_registry_enabled
to project_features.container_registry_access_level
. The new column will start being used after the 3rd MR is merged.
Database migration output:
== 20210222105120 AddContainerRegistryAccessLevel: migrating ==================
-- add_column(:project_features, :container_registry_access_level, :integer, {:default=>0, :null=>false})
-> 0.0013s
== 20210222105120 AddContainerRegistryAccessLevel: migrated (0.0043s) =========
Revert migration output:
== 20210222105120 AddContainerRegistryAccessLevel: reverting ==================
-- remove_column(:project_features, :container_registry_access_level, :integer)
-> 0.0037s
== 20210222105120 AddContainerRegistryAccessLevel: reverted (0.0081s) =========
This is the 1st in a series of MRs. Please see #18792 (comment 519028655) for more details.
Related to #18792 (closed) and #196253 (closed)
Screenshots (strongly suggested)
This is where the UI element will be added (in !55079 (merged)), under Settings > General > Visibility, project features, permissions:
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - Tested in all supported browsers
- Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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