Skip to content
Snippets Groups Projects

Allow transfer of project with registry tags

Merged Adie (she/her) requested to merge 499163-allow-transferring-proj-with-tags into master

What does this MR do and why?

In this MR, we start to allow the transfer of projects with registry tags given the following conditions:

  1. Feature flag transfer_project_with_tags is enabled
  2. The GitLab API is supported (i.e. metadata database is enabled in the registry)
  3. The transfer is within the same top level namespace

Before the actual transfer, we also do a dry run of the command in the container registry API, and only if it succeeds will the transfer proceed, otherwise an error will be raised.

We use ContainerRegistry::GitlabApiClient.move_repository_to_namespace which was the recently added in #475000 (closed).

MR acceptance checklist

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

How to set up and validate locally

Prerequisites:

  1. The metadata database is enabled
  2. Redis is running (redis-server --port 6380)
  3. Groups and subgroups. In the sample below, we would move ProjectOne from Subgroup A to Subgroup B which would be allowed. We will also try to move ProjectOne to Group2 which would result to an error since Group2 is not in the same top-level namespace. Make sure that ProjectOne has container images and tags so we can test this update :muscle:
  • Group 1
    • Subgroup A
      • ProjectOne
    • Subgroup B
  • Group 2

A. When the feature flag is disabled

  1. Verify that the feature flag is disabled
Feature.disabled?(:transfer_project_with_tags)
# => true

# if the feature is enabled, you can disable it with:
Feature.disable(:transfer_project_with_tags)
  1. Transfer the project to another group within the same top level namespace in Settings > General > Advanced > Transfer project

Screenshot_2024-11-01_at_21.01.39

  1. You should get an error that the operation is not allowed due to tags.
Project cannot be transferred, because tags are present in its container registry

B. When the feature flag is enabled and transfer in the same top level namespace

  1. Verify that the feature flag is enabled
Feature.enabled?(:transfer_project_with_tags)
# => true

# if the feature is disabled, you can enable it with:
Feature.enable(:transfer_project_with_tags)
  1. Transfer the project to another group within the same top level namespace in Settings > General > Advanced > Transfer project

  2. It should be successful :white_check_mark: After the transfer, check the Container Registry page for the project and check that the container images and tags are still visible.

Screenshot: Container Registry page Screenshot_2024-11-01_at_21.06.43

C. When the feature flag is enabled and transfer NOT IN the same top level namespace

  1. Verify that the feature flag is enabled
Feature.enabled?(:transfer_project_with_tags)
# => true

# if the feature is disabled, you can enable it with:
Feature.enable(:transfer_project_with_tags)
  1. Transfer the project to another group that is not within the same top level namespace in Settings > General > Advanced > Transfer project

  2. There should be an error that it is not allowed to transfer projects with registry tags to a different top level namespace.

Screenshot_2024-11-01_at_14.24.38

Related to #499163 (closed)

Edited by Adie (she/her)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Reviewer roulette

    Category Reviewer Maintainer
    backend @ahegyi profile link current availability (UTC+1, 1 hour ahead of author) @kassio profile link current availability (UTC+1, 1 hour ahead of author)

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • added 1 commit

    Compare with previous version

  • Adie (she/her) added 1100 commits

    added 1100 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • A deleted user added feature flag label

    added feature flag label

  • Ghost User
  • added 1 commit

    • 8456ae63 - Remove updates on group rename

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 77f077bf - Allow project transfer with tags conditionally

    Compare with previous version

  • Adie (she/her) marked this merge request as ready

    marked this merge request as ready

  • Adie (she/her) changed title from Draft: Allow project transfer with tags conditionally to Allow transfer of project with registry tags

    changed title from Draft: Allow project transfer with tags conditionally to Allow transfer of project with registry tags

  • Adie (she/her) changed the description

    changed the description

  • Adie (she/her) resolved all threads

    resolved all threads

  • Adie (she/her) requested review from @radbatnag

    requested review from @radbatnag

  • added workflowin review label and removed workflowin dev label

  • mentioned in issue #499163 (closed)

  • Radamanthus Batnag approved this merge request

    approved this merge request

  • Radamanthus Batnag requested review from @10io

    requested review from @10io

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 7a1a2456

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Plan        | 152    | 0      | 0       | 0     | 152   | ✅     |
    | Create      | 258    | 0      | 44      | 0     | 302   | ✅     |
    | Release     | 10     | 0      | 0       | 0     | 10    | ✅     |
    | Package     | 48     | 0      | 22      | 0     | 70    | ✅     |
    | Govern      | 150    | 0      | 6       | 0     | 156   | ✅     |
    | Secure      | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Verify      | 86     | 0      | 4       | 0     | 90    | ✅     |
    | Data Stores | 66     | 0      | 2       | 0     | 68    | ✅     |
    | Analytics   | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Manage      | 2      | 0      | 2       | 0     | 4     | ✅     |
    | Monitor     | 16     | 0      | 0       | 0     | 16    | ✅     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Fulfillment | 4      | 0      | 0       | 0     | 4     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 804    | 0      | 82      | 0     | 886   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-cng: :white_check_mark: test report for 7a1a2456

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 140    | 0      | 20      | 0     | 160   | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Govern      | 84     | 0      | 9       | 3     | 93    | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Verify      | 50     | 0      | 15      | 0     | 65    | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Fulfillment | 2      | 0      | 7       | 0     | 9     | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Secure      | 1      | 0      | 6       | 0     | 7     | ✅     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 436    | 0      | 119     | 3     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • David Fernandez removed review request for @10io

    removed review request for @10io

  • added 1 commit

    • c4dab4bb - Update MR from maintainer feedback

    Compare with previous version

  • Adie (she/her) reset approvals from @radbatnag by pushing to the branch

    reset approvals from @radbatnag by pushing to the branch

  • Adie (she/her) requested review from @10io and removed review request for @radbatnag

    requested review from @10io and removed review request for @radbatnag

  • David Fernandez requested review from @marcel.amirault and removed review request for @10io

    requested review from @marcel.amirault and removed review request for @10io

  • added 1 commit

    • 0435d195 - Use let_it_be and reword errors

    Compare with previous version

  • Adie (she/her) requested review from @10io

    requested review from @10io

  • Marcel Amirault approved this merge request

    approved this merge request

  • Hi @marcel.amirault :wave:,

    GitLab Bot has added the Technical Writing label because a Technical Writer has approved or merged this MR.

    This message was generated automatically. Improve it or delete it.

  • David Fernandez approved this merge request

    approved this merge request

  • David Fernandez removed review request for @10io

    removed review request for @10io

  • added 1 commit

    Compare with previous version

  • Adie (she/her) reset approvals from @10io and @marcel.amirault by pushing to the branch

    reset approvals from @10io and @marcel.amirault by pushing to the branch

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading