BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e07c7551
Commit
e07c7551
authored
May 24, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sentry-clientside-releases' into 'master'
Read HEAD commit and use as sentry releases value Closes #32535 See merge request !11565
parents
34939c89
ef73fe30
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
32 deletions
+37
-32
index.js
app/assets/javascripts/raven/index.js
+4
-0
raven_config.js
app/assets/javascripts/raven/raven_config.js
+2
-0
gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-0
index_spec.js
spec/javascripts/raven/index_spec.js
+11
-9
raven_config_spec.js
spec/javascripts/raven/raven_config_spec.js
+19
-23
No files found.
app/assets/javascripts/raven/index.js
View file @
e07c7551
...
...
@@ -6,6 +6,10 @@ const index = function index() {
currentUserId
:
gon
.
current_user_id
,
whitelistUrls
:
[
gon
.
gitlab_url
],
isProduction
:
process
.
env
.
NODE_ENV
,
release
:
gon
.
revision
,
tags
:
{
revision
:
gon
.
revision
,
},
});
return
RavenConfig
;
...
...
app/assets/javascripts/raven/raven_config.js
View file @
e07c7551
...
...
@@ -57,6 +57,8 @@ const RavenConfig = {
configure
()
{
Raven
.
config
(
this
.
options
.
sentryDsn
,
{
release
:
this
.
options
.
release
,
tags
:
this
.
options
.
tags
,
whitelistUrls
:
this
.
options
.
whitelistUrls
,
environment
:
this
.
options
.
isProduction
?
'production'
:
'development'
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
...
...
lib/gitlab/gon_helper.rb
View file @
e07c7551
...
...
@@ -12,6 +12,7 @@ module Gitlab
gon
.
katex_js_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.js'
)
gon
.
sentry_dsn
=
current_application_settings
.
clientside_sentry_dsn
if
current_application_settings
.
clientside_sentry_enabled
gon
.
gitlab_url
=
Gitlab
.
config
.
gitlab
.
url
gon
.
revision
=
Gitlab
::
REVISION
if
current_user
gon
.
current_user_id
=
current_user
.
id
...
...
spec/javascripts/raven/index_spec.js
View file @
e07c7551
...
...
@@ -2,25 +2,23 @@ import RavenConfig from '~/raven/raven_config';
import
index
from
'~/raven/index'
;
describe
(
'RavenConfig options'
,
()
=>
{
let
sentryDsn
;
let
currentUserId
;
let
gitlabUrl
;
let
isProduction
;
const
sentryDsn
=
'sentryDsn'
;
const
currentUserId
=
'currentUserId'
;
const
gitlabUrl
=
'gitlabUrl'
;
const
isProduction
=
'isProduction'
;
const
revision
=
'revision'
;
let
indexReturnValue
;
beforeEach
(()
=>
{
sentryDsn
=
'sentryDsn'
;
currentUserId
=
'currentUserId'
;
gitlabUrl
=
'gitlabUrl'
;
isProduction
=
'isProduction'
;
window
.
gon
=
{
sentry_dsn
:
sentryDsn
,
current_user_id
:
currentUserId
,
gitlab_url
:
gitlabUrl
,
revision
,
};
process
.
env
.
NODE_ENV
=
isProduction
;
process
.
env
.
HEAD_COMMIT_SHA
=
revision
;
spyOn
(
RavenConfig
,
'init'
);
...
...
@@ -33,6 +31,10 @@ describe('RavenConfig options', () => {
currentUserId
,
whitelistUrls
:
[
gitlabUrl
],
isProduction
,
release
:
revision
,
tags
:
{
revision
,
},
});
});
...
...
spec/javascripts/raven/raven_config_spec.js
View file @
e07c7551
...
...
@@ -25,17 +25,11 @@ describe('RavenConfig', () => {
});
describe
(
'init'
,
()
=>
{
let
options
;
const
options
=
{
currentUserId
:
1
,
};
beforeEach
(()
=>
{
options
=
{
sentryDsn
:
'//sentryDsn'
,
ravenAssetUrl
:
'//ravenAssetUrl'
,
currentUserId
:
1
,
whitelistUrls
:
[
'//gitlabUrl'
],
isProduction
:
true
,
};
spyOn
(
RavenConfig
,
'configure'
);
spyOn
(
RavenConfig
,
'bindRavenErrors'
);
spyOn
(
RavenConfig
,
'setUser'
);
...
...
@@ -62,30 +56,28 @@ describe('RavenConfig', () => {
it
(
'should not call setUser if there is no current user ID'
,
()
=>
{
RavenConfig
.
setUser
.
calls
.
reset
();
RavenConfig
.
init
({
sentryDsn
:
'//sentryDsn'
,
ravenAssetUrl
:
'//ravenAssetUrl'
,
currentUserId
:
undefined
,
whitelistUrls
:
[
'//gitlabUrl'
],
isProduction
:
true
,
});
options
.
currentUserId
=
undefined
;
RavenConfig
.
init
(
options
);
expect
(
RavenConfig
.
setUser
).
not
.
toHaveBeenCalled
();
});
});
describe
(
'configure'
,
()
=>
{
let
options
;
let
raven
;
let
ravenConfig
;
const
options
=
{
sentryDsn
:
'//sentryDsn'
,
whitelistUrls
:
[
'//gitlabUrl'
],
isProduction
:
true
,
release
:
'revision'
,
tags
:
{
revision
:
'revision'
,
},
};
beforeEach
(()
=>
{
options
=
{
sentryDsn
:
'//sentryDsn'
,
whitelistUrls
:
[
'//gitlabUrl'
],
isProduction
:
true
,
};
ravenConfig
=
jasmine
.
createSpyObj
(
'ravenConfig'
,
[
'shouldSendSample'
]);
raven
=
jasmine
.
createSpyObj
(
'raven'
,
[
'install'
]);
...
...
@@ -100,6 +92,8 @@ describe('RavenConfig', () => {
it
(
'should call Raven.config'
,
()
=>
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
release
:
options
.
release
,
tags
:
options
.
tags
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'production'
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
...
...
@@ -118,6 +112,8 @@ describe('RavenConfig', () => {
RavenConfig
.
configure
.
call
(
ravenConfig
);
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
release
:
options
.
release
,
tags
:
options
.
tags
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'development'
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
...
...
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