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
181354e0
Commit
181354e0
authored
May 22, 2020
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serialize json.extra.raw_response to avoid field explosion in logs
parent
41b0588a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+1
-1
spec/lib/gitlab/bitbucket_import/importer_spec.rb
spec/lib/gitlab/bitbucket_import/importer_spec.rb
+4
-1
No files found.
lib/gitlab/bitbucket_import/importer.rb
View file @
181354e0
...
...
@@ -43,7 +43,7 @@ module Gitlab
def
store_pull_request_error
(
pull_request
,
ex
)
backtrace
=
Gitlab
::
BacktraceCleaner
.
clean_backtrace
(
ex
.
backtrace
)
error
=
{
type: :pull_request
,
iid:
pull_request
.
iid
,
errors:
ex
.
message
,
trace:
backtrace
,
raw_response:
pull_request
.
raw
}
error
=
{
type: :pull_request
,
iid:
pull_request
.
iid
,
errors:
ex
.
message
,
trace:
backtrace
,
raw_response:
pull_request
.
raw
&
.
to_json
}
Gitlab
::
ErrorTracking
.
log_exception
(
ex
,
error
)
...
...
spec/lib/gitlab/bitbucket_import/importer_spec.rb
View file @
181354e0
...
...
@@ -190,11 +190,14 @@ describe Gitlab::BitbucketImport::Importer do
context
'when importing a pull request throws an exception'
do
before
do
allow
(
pull_request
).
to
receive
(
:raw
).
and_return
(
'hello world'
)
allow
(
pull_request
).
to
receive
(
:raw
).
and_return
(
{
error:
"broken"
}
)
allow
(
subject
.
client
).
to
receive
(
:pull_request_comments
).
and_raise
(
Gitlab
::
HTTP
::
Error
)
end
it
'logs an error without the backtrace'
do
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:log_exception
)
.
with
(
instance_of
(
Gitlab
::
HTTP
::
Error
),
hash_including
(
raw_response:
'{"error":"broken"}'
))
subject
.
execute
expect
(
subject
.
errors
.
count
).
to
eq
(
1
)
...
...
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