Skip to content

Add a container_registry project feature

Reuben Pereira requested to merge 18792-add-container_registry_access_level into master

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 called container_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.

  1. This MR.
  2. !55327 (merged)
  3. !55071 (merged)
  4. !55077 (closed)
  5. !55079 (merged)

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:

container_registry_visibility_dropdown

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 Reuben Pereira

Merge request reports