Commit 8a642b8e authored by João Pereira's avatar João Pereira

Remove feature flag for the container registry Google CDN feature

This feature flag allowed us to perform a gradual rollout
of this feature for GitLab.com. Now that the feature rollout is
complete and the feature deemed stable, we can remove this
flag so that the feature becomes on by default.

This reverts
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77705.

Changelog: changed
parent a7ebd942
...@@ -140,8 +140,7 @@ module Auth ...@@ -140,8 +140,7 @@ module Auth
type: type, type: type,
name: path.to_s, name: path.to_s,
actions: authorized_actions, actions: authorized_actions,
migration_eligible: self.class.migration_eligible(project: requested_project), migration_eligible: self.class.migration_eligible(project: requested_project)
cdn_redirect: cdn_redirect
}.compact }.compact
end end
...@@ -176,13 +175,6 @@ module Auth ...@@ -176,13 +175,6 @@ module Auth
false false
end end
# This is used to determine whether blob download requests using a given JWT token should be redirected to Google
# Cloud CDN or not. The intent is to enable a percentage of time rollout for this new feature on the Container
# Registry side. See https://gitlab.com/gitlab-org/gitlab/-/issues/349417 for more details.
def cdn_redirect
Feature.enabled?(:container_registry_cdn_redirect) || nil
end
## ##
# Because we do not have two way communication with registry yet, # Because we do not have two way communication with registry yet,
# we create a container repository image resource when push to the # we create a container repository image resource when push to the
......
---
name: container_registry_cdn_redirect
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77705
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/349717
milestone: '14.7'
type: development
group: group::package
default_enabled: false
...@@ -145,28 +145,4 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do ...@@ -145,28 +145,4 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
it_behaves_like 'an unmodified token' it_behaves_like 'an unmodified token'
end end
end end
context 'CDN redirection' do
include_context 'container registry auth service context'
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:current_params) { { scopes: ["repository:#{project.full_path}:pull"] } }
before do
project.add_developer(current_user)
end
it_behaves_like 'a valid token'
it { expect(payload['access']).to include(include('cdn_redirect' => true)) }
context 'when the feature flag is disabled' do
before do
stub_feature_flags(container_registry_cdn_redirect: false)
end
it_behaves_like 'a valid token'
it { expect(payload['access']).not_to include(have_key('cdn_redirect')) }
end
end
end end
...@@ -71,7 +71,6 @@ end ...@@ -71,7 +71,6 @@ end
RSpec.shared_examples 'an accessible' do RSpec.shared_examples 'an accessible' do
before do before do
stub_feature_flags(container_registry_migration_phase1: false) stub_feature_flags(container_registry_migration_phase1: false)
stub_feature_flags(container_registry_cdn_redirect: false)
end end
let(:access) do let(:access) do
...@@ -164,7 +163,6 @@ RSpec.shared_examples 'a container registry auth service' do ...@@ -164,7 +163,6 @@ RSpec.shared_examples 'a container registry auth service' do
before do before do
stub_feature_flags(container_registry_migration_phase1: false) stub_feature_flags(container_registry_migration_phase1: false)
stub_feature_flags(container_registry_cdn_redirect: false)
end end
describe '.full_access_token' do describe '.full_access_token' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment