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
97a94ae7
Commit
97a94ae7
authored
Feb 05, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all direct accesses to Raven
Issue
https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/846
parent
dc99ae29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
22 deletions
+6
-22
ee/lib/gitlab/database/load_balancing/service_discovery.rb
ee/lib/gitlab/database/load_balancing/service_discovery.rb
+1
-1
ee/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb
.../gitlab/database/load_balancing/service_discovery_spec.rb
+2
-2
spec/models/upload_spec.rb
spec/models/upload_spec.rb
+1
-1
spec/requests/api/helpers_spec.rb
spec/requests/api/helpers_spec.rb
+2
-18
No files found.
ee/lib/gitlab/database/load_balancing/service_discovery.rb
View file @
97a94ae7
...
...
@@ -59,7 +59,7 @@ module Gitlab
rescue
=>
error
# Any exceptions that might occur should be reported to
# Sentry, instead of silently terminating this thread.
Raven
.
capture
_exception
(
error
)
Gitlab
::
ErrorTracking
.
track
_exception
(
error
)
Gitlab
::
AppLogger
.
error
(
"Service discovery encountered an error:
#{
error
.
message
}
"
...
...
ee/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb
View file @
97a94ae7
...
...
@@ -66,8 +66,8 @@ RSpec.describe Gitlab::Database::LoadBalancing::ServiceDiscovery do
.
to
receive
(
:refresh_if_necessary
)
.
and_raise
(
error
)
expect
(
Raven
)
.
to
receive
(
:
capture
_exception
)
expect
(
Gitlab
::
ErrorTracking
)
.
to
receive
(
:
track
_exception
)
.
with
(
error
)
expect
(
service
)
...
...
spec/models/upload_spec.rb
View file @
97a94ae7
...
...
@@ -221,7 +221,7 @@ RSpec.describe Upload do
it
'does not send a message to Sentry'
do
upload
=
described_class
.
new
(
path:
"
#{
__FILE__
}
-nope"
,
store:
ObjectStorage
::
Store
::
LOCAL
)
expect
(
Raven
).
not_to
receive
(
:capture_message
)
expect
(
Gitlab
::
ErrorTracking
).
not_to
receive
(
:track_exception
)
upload
.
exist?
end
...
...
spec/requests/api/helpers_spec.rb
View file @
97a94ae7
...
...
@@ -314,14 +314,13 @@ RSpec.describe API::Helpers do
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:sentry_dsn
).
and_return
(
Gitlab
.
config
.
sentry
.
dsn
)
Gitlab
::
ErrorTracking
.
configure
Raven
.
client
.
configuration
.
encoding
=
'json'
end
it
'does not report a MethodNotAllowed exception to Sentry'
do
exception
=
Grape
::
Exceptions
::
MethodNotAllowed
.
new
({
'X-GitLab-Test'
=>
'1'
})
allow
(
exception
).
to
receive
(
:backtrace
).
and_return
(
caller
)
expect
(
Raven
).
not_to
receive
(
:capture
_exception
).
with
(
exception
)
expect
(
Gitlab
::
ErrorTracking
).
not_to
receive
(
:track
_exception
).
with
(
exception
)
handle_api_exception
(
exception
)
end
...
...
@@ -330,8 +329,7 @@ RSpec.describe API::Helpers do
exception
=
RuntimeError
.
new
(
'test error'
)
allow
(
exception
).
to
receive
(
:backtrace
).
and_return
(
caller
)
expect
(
Raven
).
to
receive
(
:capture_exception
).
with
(
exception
,
tags:
a_hash_including
(
correlation_id:
'new-correlation-id'
),
extra:
{})
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:track_exception
).
with
(
exception
)
Labkit
::
Correlation
::
CorrelationId
.
use_id
(
'new-correlation-id'
)
do
handle_api_exception
(
exception
)
...
...
@@ -357,20 +355,6 @@ RSpec.describe API::Helpers do
expect
(
json_response
[
'message'
]).
to
start_with
(
"
\n
RuntimeError (Runtime Error!):"
)
end
end
context
'extra information'
do
# Sentry events are an array of the form [auth_header, data, options]
let
(
:event_data
)
{
Raven
.
client
.
transport
.
events
.
first
[
1
]
}
it
'sends the params, excluding confidential values'
do
expect
(
ProjectsFinder
).
to
receive
(
:new
).
and_raise
(
'Runtime Error!'
)
get
api
(
'/projects'
,
user
),
params:
{
password:
'dont_send_this'
,
other_param:
'send_this'
}
expect
(
event_data
).
to
include
(
'other_param=send_this'
)
expect
(
event_data
).
to
include
(
'password=********'
)
end
end
end
describe
'.authenticate_non_get!'
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