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
e711c39f
Commit
e711c39f
authored
Jan 25, 2021
by
Ragnar Hardarson
Committed by
James Lopez
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PnP feature flag to bust cache
parent
592020ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
ee/app/services/fetch_subscription_plans_service.rb
ee/app/services/fetch_subscription_plans_service.rb
+7
-1
ee/config/feature_flags/development/pnp_subscription_plan_cache_key.yml
...ure_flags/development/pnp_subscription_plan_cache_key.yml
+7
-0
ee/spec/services/fetch_subscription_plans_service_spec.rb
ee/spec/services/fetch_subscription_plans_service_spec.rb
+2
-2
No files found.
ee/app/services/fetch_subscription_plans_service.rb
View file @
e711c39f
...
...
@@ -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
...
...
ee/config/feature_flags/development/pnp_subscription_plan_cache_key.yml
0 → 100644
View file @
e711c39f
---
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
ee/spec/services/fetch_subscription_plans_service_spec.rb
View file @
e711c39f
...
...
@@ -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
...
...
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