Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a101684d
Commit
a101684d
authored
Sep 28, 2020
by
David Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the `container_registry_fast_tag_delete` feature flag
parent
b928a9bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
51 deletions
+18
-51
app/services/projects/container_repository/delete_tags_service.rb
...ices/projects/container_repository/delete_tags_service.rb
+1
-3
config/feature_flags/development/container_registry_fast_tag_delete.yml
..._flags/development/container_registry_fast_tag_delete.yml
+0
-7
spec/services/projects/container_repository/delete_tags_service_spec.rb
...projects/container_repository/delete_tags_service_spec.rb
+17
-41
No files found.
app/services/projects/container_repository/delete_tags_service.rb
View file @
a101684d
...
@@ -23,9 +23,7 @@ module Projects
...
@@ -23,9 +23,7 @@ module Projects
end
end
def
delete_service
def
delete_service
fast_delete_enabled
=
Feature
.
enabled?
(
:container_registry_fast_tag_delete
,
default_enabled:
true
)
if
@container_repository
.
client
.
supports_tag_delete?
if
fast_delete_enabled
&&
@container_repository
.
client
.
supports_tag_delete?
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
.
new
(
@container_repository
,
@tag_names
)
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
.
new
(
@container_repository
,
@tag_names
)
else
else
::
Projects
::
ContainerRepository
::
ThirdParty
::
DeleteTagsService
.
new
(
@container_repository
,
@tag_names
)
::
Projects
::
ContainerRepository
::
ThirdParty
::
DeleteTagsService
.
new
(
@container_repository
,
@tag_names
)
...
...
config/feature_flags/development/container_registry_fast_tag_delete.yml
deleted
100644 → 0
View file @
b928a9bd
---
name
:
container_registry_fast_tag_delete
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23325
rollout_issue_url
:
group
:
group::package
type
:
development
default_enabled
:
true
spec/services/projects/container_repository/delete_tags_service_spec.rb
View file @
a101684d
...
@@ -104,59 +104,35 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do
...
@@ -104,59 +104,35 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do
end
end
context
'when the registry supports fast delete'
do
context
'when the registry supports fast delete'
do
context
'and the feature is enabled'
do
before
do
before
do
allow
(
repository
.
client
).
to
receive
(
:supports_tag_delete?
).
and_return
(
true
)
allow
(
repository
.
client
).
to
receive
(
:supports_tag_delete?
).
and_return
(
true
)
end
end
it_behaves_like
'calling the correct delete tags service'
,
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
it_behaves_like
'handling invalid params'
context
'with the real service'
do
it_behaves_like
'calling the correct delete tags service'
,
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
before
do
stub_delete_reference_requests
(
tags
)
expect_delete_tag_by_names
(
tags
)
end
it
{
is_expected
.
to
include
(
status: :success
)
}
it_behaves_like
'handling invalid params'
it_behaves_like
'logging a success response'
context
'with the real service'
do
before
do
stub_delete_reference_requests
(
tags
)
expect_delete_tag_by_names
(
tags
)
end
end
context
'with a timeout error'
do
it
{
is_expected
.
to
include
(
status: :success
)
}
before
do
expect_next_instance_of
(
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
)
do
|
delete_service
|
expect
(
delete_service
).
to
receive
(
:delete_tags
).
and_raise
(
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
::
TimeoutError
)
end
end
it
{
is_expected
.
to
include
(
status: :error
,
message:
'timeout while deleting tags'
)
}
it_behaves_like
'logging an error response'
,
message:
'timeout while deleting tags'
it_behaves_like
'logging a success response'
end
end
end
context
'
and the feature is disabled
'
do
context
'
with a timeout error
'
do
before
do
before
do
stub_feature_flags
(
container_registry_fast_tag_delete:
false
)
expect_next_instance_of
(
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
)
do
|
delete_service
|
end
expect
(
delete_service
).
to
receive
(
:delete_tags
).
and_raise
(
::
Projects
::
ContainerRepository
::
Gitlab
::
DeleteTagsService
::
TimeoutError
)
it_behaves_like
'calling the correct delete tags service'
,
::
Projects
::
ContainerRepository
::
ThirdParty
::
DeleteTagsService
it_behaves_like
'handling invalid params'
context
'with the real service'
do
before
do
stub_upload
(
'sha256:4435000728ee66e6a80e55637fc22725c256b61de344a2ecdeaac6bdb36e8bc3'
)
tags
.
each
{
|
tag
|
stub_put_manifest_request
(
tag
)
}
expect_delete_tag_by_digest
(
'sha256:dummy'
)
end
end
end
it
{
is_expected
.
to
include
(
status: :success
)
}
it
{
is_expected
.
to
include
(
status: :error
,
message:
'timeout while deleting tags'
)
}
it_behaves_like
'logging a success response'
it_behaves_like
'logging an error response'
,
message:
'timeout while deleting tags'
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment