Forking project to groups with restricted visibility levels

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

  • This MR is related to #465288 (closed) and #384358 (closed)
  • This MR enhances the namespace dropdown (field "Project URL") in the project forking page and allows to fork a project into a group with a restricted visiblity level
  • Through this MR, the namespace dropdown suggests public and internal groups even though these visibility levels are restricted; the reasoning is that it should still be possible to fork a private project into an existing public group, see examples in the section "Screenshots or screen recordings"
  • MR does not changes the frontend directly, but adjusts the backend GraphQL query to retreive the possible fork targets for a project and user

🛠 with at Siemens

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

MR Checklist (@gerardo-navarro)

Screenshots or screen recordings

Scenario 1: Restricted visibility levels private

Reasoning: Private groups can only have private projects. But since the private visibility level is restricted, it is not possible to create a private project at all. Hence, it is not possible to create private project in a private group. Therefore, private groups can be disregarded from the namespace dropdown.

Before After
Private groups are not included in the namespace suggestion. Public groups are not included in the namespace suggestion. Not changed by this MR.
grafik grafik
grafik grafik

Scenario 2: Restricted visibility levels public

Reasoning: Public groups can have public, internal and private projects. But since only the visibility level public is restricted, it is still possible to create an internal and private project in existsing public group. Therefore, we can still suggest public groups in the namespace dropdown, even though the visiblity level public is restricted. Same reasoning can also be applied when only the visibility level internal is restricted.

Before After
Public groups are not included in the namespace suggestion. Public groups are included in the namespace suggestion.
grafik grafik
grafik grafik

Scenario 3: Restricted visibility levels private and internal

Reasoning: Similar reasoning to scenario 1. Internal groups can only have internal and private projects. But since the visibility levels internal and private are restricted, it is not possible to create an internal and private project as part of an internal or private group. Therefore, we can disregard private and internal groups in the namespace dropdown.

Before After
Private and internal groups are not included in the namespace suggestion. Private and internal groups are not included in the namespace suggestion. Not changed by this MR.
grafik grafik
grafik grafik

Scenario 4: Restricted visibility levels private and public

Reasoning: Similar reasoning as in scenario 1 and scenario 2. Private groups can be disregarded in the namesspace dropdown because the visibility level private is restricted and therefore it is not possible to create a private (or an internal) project in a private group. However, we do not need to disregard public groups because it is possible to create an internal project in an existing public group.

Before After
Private and public groups are not included in the namespace suggestion. Private are not included in the namespace suggestion, but public groups are included.
grafik grafik
grafik grafik

Scenario 5: Restricted visibility levels internal and public

Reasoning: Similar reasoning as in scenario 2, public and internal groups can be suggested in the namesspace dropdown because it is possible to create a private project in an existing public group.

Before After
Private and public groups are not included in the namespace suggestion. Internal and public groups are included in the namespace suggestion.
grafik grafik
grafik grafik

How to set up and validate locally

  1. With a non-admin user, create three groups with the different visibility levels public, internal and private
  2. With a non-admin user, create an private project in the internal group
  3. With an admin user, restrict the visibility levels public and internal in the admin area: http://gdk.test:3000/admin/application_settings/general#js-visibility-settings
  4. With a non-admin user, start forking the new created project
  5. You should be able to select all created groups as namespaces for the field "Project URL" 👍
  6. With an admin user, restrict other visibility levels private and internal and see that now the public groups is suggested in the namespace dropdown.

Related to #465288 (closed) and #384358 (closed)

Edited by Gerardo Navarro

Merge request reports

Loading