Commit e711c39f authored by Ragnar Hardarson's avatar Ragnar Hardarson Committed by James Lopez

Add PnP feature flag to bust cache

parent 592020ca
......@@ -42,7 +42,13 @@ class FetchSubscriptionPlansService
end
def cache_key
if Feature.enabled?(:subscription_plan_cache_key)
if Feature.enabled?(:pnp_subscription_plan_cache_key)
if @namespace_id.present?
"pnp-subscription-plan-#{@plan}-#{@namespace_id}"
else
"pnp-subscription-plan-#{@plan}"
end
elsif Feature.enabled?(:subscription_plan_cache_key)
if @namespace_id.present?
"subscription-plan-#{@plan}-#{@namespace_id}"
else
......
---
name: pnp_subscription_plan_cache_key
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52437
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/299068
type: development
group: group::fulfillment
default_enabled: false
......@@ -27,7 +27,7 @@ RSpec.describe FetchSubscriptionPlansService do
it 'uses only the plan within the cache key name' do
allow(Gitlab::HTTP).to receive(:get).and_return(response_mock)
expect(Rails.cache).to receive(:read).with("subscription-plan-#{plan}")
expect(Rails.cache).to receive(:read).with("pnp-subscription-plan-#{plan}")
execute_service
end
......@@ -53,7 +53,7 @@ RSpec.describe FetchSubscriptionPlansService do
it 'uses the namespace id within the cache key name' do
allow(Gitlab::HTTP).to receive(:get).and_return(response_mock)
expect(Rails.cache).to receive(:read).with("subscription-plan-#{plan}-#{namespace_id}")
expect(Rails.cache).to receive(:read).with("pnp-subscription-plan-#{plan}-#{namespace_id}")
execute_service
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