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
ab017f16
Commit
ab017f16
authored
Sep 08, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cache_merge_to_ref_calls feature flag
Changelog: performance
parent
3548b0bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
33 deletions
+4
-33
app/services/merge_requests/merge_to_ref_service.rb
app/services/merge_requests/merge_to_ref_service.rb
+1
-2
config/feature_flags/development/cache_merge_to_ref_calls.yml
...ig/feature_flags/development/cache_merge_to_ref_calls.yml
+0
-8
spec/services/merge_requests/merge_to_ref_service_spec.rb
spec/services/merge_requests/merge_to_ref_service_spec.rb
+3
-23
No files found.
app/services/merge_requests/merge_to_ref_service.rb
View file @
ab017f16
...
...
@@ -66,8 +66,7 @@ module MergeRequests
end
def
commit
(
cache_merge_to_ref_calls
=
false
)
if
cache_merge_to_ref_calls
&&
Feature
.
enabled?
(
:cache_merge_to_ref_calls
,
project
,
default_enabled:
false
)
if
cache_merge_to_ref_calls
Rails
.
cache
.
fetch
(
cache_key
,
expires_in:
1
.
day
)
do
extracted_merge_to_ref
end
...
...
config/feature_flags/development/cache_merge_to_ref_calls.yml
deleted
100644 → 0
View file @
3548b0bd
---
name
:
cache_merge_to_ref_calls
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67789
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/338251
milestone
:
'
14.2'
type
:
development
group
:
group::code review
default_enabled
:
false
spec/services/merge_requests/merge_to_ref_service_spec.rb
View file @
ab017f16
...
...
@@ -37,23 +37,21 @@ RSpec.describe MergeRequests::MergeToRefService do
expect
(
ref_head
.
id
).
to
eq
(
result
[
:commit_id
])
end
context
'cache_merge_to_ref_calls
flag enabled
'
,
:use_clean_rails_memory_store_caching
do
context
'cache_merge_to_ref_calls
parameter
'
,
:use_clean_rails_memory_store_caching
do
before
do
stub_feature_flags
(
cache_merge_to_ref_calls:
true
)
# warm the cache
#
service
.
execute
(
merge_request
,
true
)
end
context
'when
cache_merge_to_ref_calls parameter is
true'
do
context
'when true'
do
it
'caches the response'
,
:request_store
do
expect
{
3
.
times
{
service
.
execute
(
merge_request
,
true
)
}
}
.
not_to
change
(
Gitlab
::
GitalyClient
,
:get_request_count
)
end
end
context
'when
cache_merge_to_ref_calls parameter is
false'
do
context
'when false'
do
it
'does not cache the response'
,
:request_store
do
expect
(
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
at_least
(
3
).
times
.
and_call_original
...
...
@@ -61,24 +59,6 @@ RSpec.describe MergeRequests::MergeToRefService do
end
end
end
context
'cache_merge_to_ref_calls flag disabled'
,
:use_clean_rails_memory_store_caching
do
before
do
stub_feature_flags
(
cache_merge_to_ref_calls:
false
)
# warm the cache
#
service
.
execute
(
merge_request
,
true
)
end
[
true
,
false
].
each
do
|
cache_merge_to_ref_calls
|
it
'does not cache the response, regardless of cache_merge_to_ref_calls state'
,
:request_store
do
expect
(
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
at_least
(
3
).
times
.
and_call_original
3
.
times
{
service
.
execute
(
merge_request
,
cache_merge_to_ref_calls
)
}
end
end
end
end
shared_examples_for
'successfully evaluates pre-condition checks'
do
...
...
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