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
8784dedb
Commit
8784dedb
authored
Aug 03, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Sentry reporting to job log acitons
parent
858320c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
app/assets/javascripts/jobs/store/actions.js
app/assets/javascripts/jobs/store/actions.js
+9
-5
app/assets/javascripts/jobs/utils.js
app/assets/javascripts/jobs/utils.js
+9
-0
No files found.
app/assets/javascripts/jobs/store/actions.js
View file @
8784dedb
...
...
@@ -13,6 +13,7 @@ import {
scrollUp
,
}
from
'
~/lib/utils/scroll_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
reportToSentry
}
from
'
../utils
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
const
init
=
({
dispatch
},
{
endpoint
,
logState
,
pagePath
})
=>
{
...
...
@@ -175,11 +176,14 @@ export const fetchTrace = ({ dispatch, state }) =>
dispatch
(
'
startPollingTrace
'
);
}
})
.
catch
((
e
)
=>
e
.
response
.
status
===
httpStatusCodes
.
FORBIDDEN
?
dispatch
(
'
receiveTraceUnauthorizedError
'
)
:
dispatch
(
'
receiveTraceError
'
),
);
.
catch
((
e
)
=>
{
if
(
e
.
response
.
status
===
httpStatusCodes
.
FORBIDDEN
)
{
dispatch
(
'
receiveTraceUnauthorizedError
'
);
}
else
{
reportToSentry
(
'
job_actions
'
,
e
);
dispatch
(
'
receiveTraceError
'
);
}
});
export
const
startPollingTrace
=
({
dispatch
,
commit
})
=>
{
const
traceTimeout
=
setTimeout
(()
=>
{
...
...
app/assets/javascripts/jobs/utils.js
View file @
8784dedb
import
*
as
Sentry
from
'
@sentry/browser
'
;
/**
* capture anything starting with http:// or https://
* https?:\/\/
...
...
@@ -10,3 +12,10 @@
*/
export
const
linkRegex
=
/
(
https
?
:
\/\/[^
"<>()
\\
^`{|}
\s]
+
[^
"<>()
\\
^`{|}
\s
.,:;!?
])
/g
;
export
default
{
linkRegex
};
export
const
reportToSentry
=
(
component
,
failureType
)
=>
{
Sentry
.
withScope
((
scope
)
=>
{
scope
.
setTag
(
'
component
'
,
component
);
Sentry
.
captureException
(
failureType
);
});
};
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