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
e90cce11
Commit
e90cce11
authored
Feb 03, 2020
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '197320-clear-cache-after-sentry-error-update' into 'master'"
This reverts merge request !23368
parent
bffc567b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
45 deletions
+7
-45
app/models/error_tracking/project_error_tracking_setting.rb
app/models/error_tracking/project_error_tracking_setting.rb
+0
-10
app/services/error_tracking/issue_update_service.rb
app/services/error_tracking/issue_update_service.rb
+7
-11
spec/models/error_tracking/project_error_tracking_setting_spec.rb
...els/error_tracking/project_error_tracking_setting_spec.rb
+0
-14
spec/services/error_tracking/issue_update_service_spec.rb
spec/services/error_tracking/issue_update_service_spec.rb
+0
-10
No files found.
app/models/error_tracking/project_error_tracking_setting.rb
View file @
e90cce11
...
@@ -128,10 +128,6 @@ module ErrorTracking
...
@@ -128,10 +128,6 @@ module ErrorTracking
end
end
end
end
def
expire_issues_cache
Rails
.
cache
.
delete_matched
(
expand_cache_key
(
'list_issues'
))
end
# http://HOST/api/0/projects/ORG/PROJECT
# http://HOST/api/0/projects/ORG/PROJECT
# ->
# ->
# http://HOST/ORG/PROJECT
# http://HOST/ORG/PROJECT
...
@@ -148,12 +144,6 @@ module ErrorTracking
...
@@ -148,12 +144,6 @@ module ErrorTracking
private
private
def
expand_cache_key
(
resource_prefix
)
klass_key
=
self
.
class
.
reactive_cache_key
.
call
(
self
).
join
(
':'
)
"
#{
klass_key
}
:
#{
resource_prefix
}
*"
end
def
add_gitlab_issue_details
(
issue
)
def
add_gitlab_issue_details
(
issue
)
issue
.
gitlab_commit
=
match_gitlab_commit
(
issue
.
first_release_version
)
issue
.
gitlab_commit
=
match_gitlab_commit
(
issue
.
first_release_version
)
issue
.
gitlab_commit_path
=
project_commit_path
(
project
,
issue
.
gitlab_commit
)
if
issue
.
gitlab_commit
issue
.
gitlab_commit_path
=
project_commit_path
(
project
,
issue
.
gitlab_commit
)
if
issue
.
gitlab_commit
...
...
app/services/error_tracking/issue_update_service.rb
View file @
e90cce11
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
module
ErrorTracking
module
ErrorTracking
class
IssueUpdateService
<
ErrorTracking
::
BaseService
class
IssueUpdateService
<
ErrorTracking
::
BaseService
include
::
Gitlab
::
Utils
::
StrongMemoize
private
private
def
perform
def
perform
...
@@ -14,14 +12,14 @@ module ErrorTracking
...
@@ -14,14 +12,14 @@ module ErrorTracking
compose_response
(
response
)
do
compose_response
(
response
)
do
response
[
:closed_issue_iid
]
=
update_related_issue
&
.
iid
response
[
:closed_issue_iid
]
=
update_related_issue
&
.
iid
project_error_tracking_setting
.
expire_issues_cache
end
end
end
end
def
update_related_issue
def
update_related_issue
return
if
related_issue
.
nil?
issue
=
related_issue
return
unless
issue
close_and_create_note
(
related_
issue
)
close_and_create_note
(
issue
)
end
end
def
close_and_create_note
(
issue
)
def
close_and_create_note
(
issue
)
...
@@ -45,12 +43,10 @@ module ErrorTracking
...
@@ -45,12 +43,10 @@ module ErrorTracking
end
end
def
related_issue
def
related_issue
strong_memoize
(
:related_issue
)
do
SentryIssueFinder
SentryIssueFinder
.
new
(
project
,
current_user:
current_user
)
.
new
(
project
,
current_user:
current_user
)
.
execute
(
params
[
:issue_id
])
.
execute
(
params
[
:issue_id
])
&
.
issue
&
.
issue
end
end
end
def
resolving?
def
resolving?
...
...
spec/models/error_tracking/project_error_tracking_setting_spec.rb
View file @
e90cce11
...
@@ -440,18 +440,4 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
...
@@ -440,18 +440,4 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
end
end
end
end
end
end
describe
'#expire_issues_cache'
,
:use_clean_rails_memory_store_caching
do
it
'clears the cache'
do
klass_key
=
subject
.
class
.
reactive_cache_key
.
call
(
subject
).
join
(
':'
)
key
=
"
#{
klass_key
}
:list_issues:some_suffix"
Rails
.
cache
.
write
(
key
,
1
)
expect
(
Rails
.
cache
.
exist?
(
key
)).
to
eq
(
true
)
subject
.
expire_issues_cache
expect
(
Rails
.
cache
.
exist?
(
key
)).
to
eq
(
false
)
end
end
end
end
spec/services/error_tracking/issue_update_service_spec.rb
View file @
e90cce11
...
@@ -40,16 +40,6 @@ describe ErrorTracking::IssueUpdateService do
...
@@ -40,16 +40,6 @@ describe ErrorTracking::IssueUpdateService do
result
result
end
end
it
'clears the reactive cache'
do
allow
(
error_tracking_setting
)
.
to
receive
(
:expire_issues_cache
)
result
expect
(
error_tracking_setting
)
.
to
have_received
(
:expire_issues_cache
)
end
context
'related issue and resolving'
do
context
'related issue and resolving'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:sentry_issue
)
{
create
(
:sentry_issue
,
issue:
issue
)
}
let
(
:sentry_issue
)
{
create
(
:sentry_issue
,
issue:
issue
)
}
...
...
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