Skip to content

Add dropdown to select visibility of container registry feature

Reuben Pereira requested to merge 18792-add-ui-select into master

What does this MR do?

We have migrated to use ProjectFeature#container_registry_access_level instead of Project#container_registry_enabled for controlling the visibility of the container registry. With ProjectFeature#container_registry_access_level, we now have the ability to set the container registry to private visibility (only available to reporter role and above) even if the project is public.

This MR adds a select dropdown under Settings > General > Visibility, project features, permissions to allow the visibility of the Container Registry feature to be modified by project admins.

Related to #18792 (closed)

Screenshots (strongly suggested)

Before After
container_visibility_ui_before container_visibility_ui_outlined

How to setup and validate locally (strongly suggested)

  1. Open any project in your GDK.
  2. Go to Settings > General > Visibility, project features, permissions
  3. Toggle the Container registry switch if it is off.
  4. Select an option from the dropdown.
  5. Click "Save changes".
  6. If you want to verify if the setting got saved correctly, open a Rails console and run the following:
    # If you selected "Everyone With Access", this value should be 20.
    # If you selected "Only Project Members", this value should be 10.
    # If you toggle the switch to disable the container registry, this value should be 0.
    Project.find(<your project ID>).container_registry_access_level

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