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
4c20cd08
Commit
4c20cd08
authored
Sep 22, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sentry tracking to masking helper
parent
d519789a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
app/helpers/routing/pseudonymization_helper.rb
app/helpers/routing/pseudonymization_helper.rb
+2
-1
spec/helpers/routing/pseudonymization_helper_spec.rb
spec/helpers/routing/pseudonymization_helper_spec.rb
+14
-0
No files found.
app/helpers/routing/pseudonymization_helper.rb
View file @
4c20cd08
...
...
@@ -6,7 +6,8 @@ module Routing
return
unless
Feature
.
enabled?
(
:mask_page_urls
,
type: :ops
)
mask_params
(
Rails
.
application
.
routes
.
recognize_path
(
request
.
original_fullpath
))
rescue
ActionController
::
RoutingError
,
URI
::
InvalidURIError
rescue
ActionController
::
RoutingError
,
URI
::
InvalidURIError
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
url:
request
.
original_fullpath
)
nil
end
...
...
spec/helpers/routing/pseudonymization_helper_spec.rb
View file @
4c20cd08
...
...
@@ -129,6 +129,20 @@ RSpec.describe ::Routing::PseudonymizationHelper do
end
end
describe
'when it raises exception'
do
context
'calls error tracking exception'
do
it
'sends error to sentry'
do
allow
(
helper
).
to
receive
(
:mask_params
).
with
(
anything
).
and_raise
(
ActionController
::
RoutingError
,
'Some routing error'
)
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:track_exception
).
with
(
ActionController
::
RoutingError
,
url:
''
).
and_call_original
expect
(
helper
.
masked_page_url
).
to
be_nil
end
end
end
describe
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
mask_page_urls:
false
)
...
...
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