Commit 54543d71 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch...

Merge branch '337064-ci-minutes-feature-flag-remove-new_route_ci_minutes_purchase-feature-flag' into 'master'

Resolve "[CI Minutes] [Feature flag] Remove 'new_route_ci_minutes_purchase' feature flag"

See merge request gitlab-org/gitlab!79686
parents 43467502 d3015405
---
name: new_route_ci_minutes_purchase
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54934
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/322582
milestone: '13.10'
type: development
group: group::purchase
default_enabled: true
...@@ -48,8 +48,6 @@ class SubscriptionsController < ApplicationController ...@@ -48,8 +48,6 @@ class SubscriptionsController < ApplicationController
@active_subscription = result[:active_subscription] @active_subscription = result[:active_subscription]
return render_404 if @group.nil? return render_404 if @group.nil?
render_404 unless Feature.enabled?(:new_route_ci_minutes_purchase, @group, default_enabled: :yaml)
end end
def buy_storage def buy_storage
......
...@@ -58,7 +58,7 @@ module EE ...@@ -58,7 +58,7 @@ module EE
private private
def use_customers_dot_for_minutes_path?(namespace) def use_customers_dot_for_minutes_path?(namespace)
namespace.user_namespace? || ::Feature.disabled?(:new_route_ci_minutes_purchase, namespace, default_enabled: :yaml) namespace.user_namespace?
end end
def use_customers_dot_for_storage_path?(namespace) def use_customers_dot_for_storage_path?(namespace)
......
...@@ -86,7 +86,6 @@ RSpec.describe SubscriptionsController do ...@@ -86,7 +86,6 @@ RSpec.describe SubscriptionsController do
context 'with authenticated user' do context 'with authenticated user' do
before do before do
group.add_owner(user) group.add_owner(user)
stub_feature_flags(new_route_ci_minutes_purchase: group)
sign_in(user) sign_in(user)
end end
...@@ -135,14 +134,6 @@ RSpec.describe SubscriptionsController do ...@@ -135,14 +134,6 @@ RSpec.describe SubscriptionsController do
expect(assigns(:group)).to eq group expect(assigns(:group)).to eq group
expect(assigns(:account_id)).to eq nil expect(assigns(:account_id)).to eq nil
end end
context 'with :new_route_ci_minutes_purchase disabled' do
before do
stub_feature_flags(new_route_ci_minutes_purchase: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end end
end end
end end
......
...@@ -186,25 +186,11 @@ RSpec.describe 'Groups > Usage Quotas' do ...@@ -186,25 +186,11 @@ RSpec.describe 'Groups > Usage Quotas' do
end end
end end
describe 'new_route_ci_minutes_purchase feature flag' do context 'when purchasing CI minutes' do
context 'when is disabled' do it 'points to GitLab CI minutes purchase flow' do
before do visit_pipeline_quota_page
stub_feature_flags(new_route_ci_minutes_purchase: false)
end
it 'points to Customers Portal purchase flow' do
visit_pipeline_quota_page
expect(page).to have_link('Buy additional minutes', href: EE::SUBSCRIPTIONS_MORE_MINUTES_URL)
end
end
context 'when is enabled' do
it 'points to GitLab purchase flow' do
visit_pipeline_quota_page
expect(page).to have_link('Buy additional minutes', href: buy_minutes_subscriptions_path(selected_group: group.id)) expect(page).to have_link('Buy additional minutes', href: buy_minutes_subscriptions_path(selected_group: group.id))
end
end end
end end
......
...@@ -179,39 +179,12 @@ RSpec.describe EE::NamespacesHelper do ...@@ -179,39 +179,12 @@ RSpec.describe EE::NamespacesHelper do
it { is_expected.to eq buy_minutes_subscriptions_path(selected_group: namespace.id) } it { is_expected.to eq buy_minutes_subscriptions_path(selected_group: namespace.id) }
context 'new_route_ci_minutes_purchase' do context 'when called for a personal namespace' do
context 'when is disabled' do let(:user) { create(:user) }
before do let(:personal_namespace) { build_stubbed(:user_namespace) }
stub_feature_flags(new_route_ci_minutes_purchase: false)
end
it { is_expected.to eq EE::SUBSCRIPTIONS_MORE_MINUTES_URL }
end
context 'when new_route_ci_minutes_purchase is enabled only for a specific namespace' do
let(:enabled_namespace) { build_stubbed(:group) }
before do
stub_feature_flags(new_route_ci_minutes_purchase: false)
stub_feature_flags(new_route_ci_minutes_purchase: enabled_namespace)
end
it 'returns the default purchase path for the disabled namespace' do
expect(helper.buy_additional_minutes_path(namespace)).to eq EE::SUBSCRIPTIONS_MORE_MINUTES_URL
end
it 'returns GitLab purchase path for the disabled namespace' do
expect(helper.buy_additional_minutes_path(enabled_namespace)).to eq buy_minutes_subscriptions_path(selected_group: enabled_namespace.id)
end
end
context 'when called for a personal namespace' do it 'returns the default purchase' do
let(:user) { create(:user) } expect(helper.buy_additional_minutes_path(personal_namespace)).to eq EE::SUBSCRIPTIONS_MORE_MINUTES_URL
let(:personal_namespace) { build_stubbed(:user_namespace) }
it 'returns the default purchase' do
expect(helper.buy_additional_minutes_path(personal_namespace)).to eq EE::SUBSCRIPTIONS_MORE_MINUTES_URL
end
end end
end end
end end
...@@ -265,43 +238,14 @@ RSpec.describe EE::NamespacesHelper do ...@@ -265,43 +238,14 @@ RSpec.describe EE::NamespacesHelper do
let(:namespace) { create(:group) } let(:namespace) { create(:group) }
context 'new_route_ci_minutes_purchase' do it { is_expected.to eq '_self' }
context 'when is disabled' do
before do
stub_feature_flags(new_route_ci_minutes_purchase: false)
end
it { is_expected.to eq '_blank' }
end
context 'when is enabled' do
it { is_expected.to eq '_self' }
end
context 'when is enabled only for a specific namespace' do
let(:enabled_namespace) { build_stubbed(:group) }
before do
stub_feature_flags(new_route_ci_minutes_purchase: false)
stub_feature_flags(new_route_ci_minutes_purchase: enabled_namespace)
end
it 'returns _blank for the disabled namespace' do
expect(helper.buy_additional_minutes_target(namespace)).to eq '_blank'
end
it 'returns _self for the disabled namespace' do context 'when called for a personal namespace' do
expect(helper.buy_additional_minutes_target(enabled_namespace)).to eq '_self' let(:user) { create(:user) }
end let(:personal_namespace) { build_stubbed(:user_namespace) }
end
context 'when called for a personal namespace' do it 'returns _blank' do
let(:user) { create(:user) } expect(helper.buy_additional_minutes_target(personal_namespace)).to eq '_blank'
let(:personal_namespace) { build_stubbed(:user_namespace) }
it 'returns _blank' do
expect(helper.buy_additional_minutes_target(personal_namespace)).to eq '_blank'
end
end end
end end
end end
......
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