Allow transfer of project with registry tags
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:
- Feature flag
transfer_project_with_tags
is enabled - The GitLab API is supported (i.e. metadata database is enabled in the registry)
- 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
How to set up and validate locally
Prerequisites:
- The metadata database is enabled
- Redis is running (
redis-server --port 6380
) - Groups and subgroups. In the sample below, we would move
ProjectOne
fromSubgroup A
toSubgroup B
which would be allowed. We will also try to moveProjectOne
toGroup2
which would result to an error sinceGroup2
is not in the same top-level namespace. Make sure thatProjectOne
has container images and tags so we can test this update
- Group 1
- Subgroup A
- ProjectOne
- Subgroup B
- Subgroup A
- Group 2
A. When the feature flag is disabled
- 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)
- Transfer the project to another group within the same top level namespace in Settings > General > Advanced > Transfer project
- 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
- 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)
-
Transfer the project to another group within the same top level namespace in Settings > General > Advanced > Transfer project
-
It should be successful
After the transfer, check the Container Registry page for the project and check that the container images and tags are still visible.
C. When the feature flag is enabled and transfer NOT IN the same top level namespace
- 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)
-
Transfer the project to another group that is not within the same top level namespace in Settings > General > Advanced > Transfer project
-
There should be an error that it is not allowed to transfer projects with registry tags to a different top level namespace.
Related to #499163 (closed)
Merge request reports
Activity
changed milestone to %17.6
assigned to @adie.po
added pipelinetier-1 label
- Resolved by David Fernandez
Reviewer roulette
Category Reviewer Maintainer backend @ahegyi
(UTC+1, 1 hour ahead of author)
@kassio
(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
danger-review
job that generated this comment.Generated by
Dangeradded 1100 commits
-
2493442f...3b7eaa7f - 1098 commits from branch
master
- da2623b7 - Allow project transfer with tags conditionally
- 37c53ee3 - Add actual rename on update
-
2493442f...3b7eaa7f - 1098 commits from branch
- A deleted user
added feature flag label
- Resolved by Adie (she/her)
added 1 commit
- 77f077bf - Allow project transfer with tags conditionally
added workflowin dev label and removed workflowready for development label
- Resolved by Adie (she/her)
Hi @radbatnag, requesting for your backend review please
thank you! When you have approved, hope you can pass it to@10io
, thanks!
requested review from @radbatnag
added workflowin review label and removed workflowin dev label
mentioned in issue #499163 (closed)
requested review from @10io
added pipeline:mr-approved label
added pipelinetier-3 pipeline:run-e2e-omnibus-once labels and removed pipelinetier-1 label
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:
test report for 7a1a2456expand 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:
test report for 7a1a2456expand 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 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
- Resolved by David Fernandez
- Resolved by David Fernandez
- Resolved by David Fernandez
removed review request for @10io
reset approvals from @radbatnag by pushing to the branch
requested review from @10io and removed review request for @radbatnag
- Resolved by David Fernandez
requested review from @marcel.amirault and removed review request for @10io
requested review from @10io
- Resolved by Marcel Amirault
- Resolved by David Fernandez
Hi
@marcel.amirault
,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.
added Technical Writing label
removed review request for @10io
reset approvals from @10io and @marcel.amirault by pushing to the branch