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
af139873
Commit
af139873
authored
May 22, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply patch of sentry-clientside-releases
parent
65effeb2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
32 deletions
+37
-32
app/assets/javascripts/raven/index.js
app/assets/javascripts/raven/index.js
+4
-0
app/assets/javascripts/raven/raven_config.js
app/assets/javascripts/raven/raven_config.js
+2
-0
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-0
spec/javascripts/raven/index_spec.js
spec/javascripts/raven/index_spec.js
+11
-9
spec/javascripts/raven/raven_config_spec.js
spec/javascripts/raven/raven_config_spec.js
+19
-23
No files found.
app/assets/javascripts/raven/index.js
View file @
af139873
...
@@ -6,6 +6,10 @@ const index = function index() {
...
@@ -6,6 +6,10 @@ const index = function index() {
currentUserId
:
gon
.
current_user_id
,
currentUserId
:
gon
.
current_user_id
,
whitelistUrls
:
[
gon
.
gitlab_url
],
whitelistUrls
:
[
gon
.
gitlab_url
],
isProduction
:
process
.
env
.
NODE_ENV
,
isProduction
:
process
.
env
.
NODE_ENV
,
release
:
gon
.
revision
,
tags
:
{
revision
:
gon
.
revision
,
},
});
});
return
RavenConfig
;
return
RavenConfig
;
...
...
app/assets/javascripts/raven/raven_config.js
View file @
af139873
...
@@ -57,6 +57,8 @@ const RavenConfig = {
...
@@ -57,6 +57,8 @@ const RavenConfig = {
configure
()
{
configure
()
{
Raven
.
config
(
this
.
options
.
sentryDsn
,
{
Raven
.
config
(
this
.
options
.
sentryDsn
,
{
release
:
this
.
options
.
release
,
tags
:
this
.
options
.
tags
,
whitelistUrls
:
this
.
options
.
whitelistUrls
,
whitelistUrls
:
this
.
options
.
whitelistUrls
,
environment
:
this
.
options
.
isProduction
?
'
production
'
:
'
development
'
,
environment
:
this
.
options
.
isProduction
?
'
production
'
:
'
development
'
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
...
...
lib/gitlab/gon_helper.rb
View file @
af139873
...
@@ -13,6 +13,7 @@ module Gitlab
...
@@ -13,6 +13,7 @@ module Gitlab
gon
.
sentry_dsn
=
current_application_settings
.
clientside_sentry_dsn
if
current_application_settings
.
clientside_sentry_enabled
gon
.
sentry_dsn
=
current_application_settings
.
clientside_sentry_dsn
if
current_application_settings
.
clientside_sentry_enabled
gon
.
gitlab_url
=
Gitlab
.
config
.
gitlab
.
url
gon
.
gitlab_url
=
Gitlab
.
config
.
gitlab
.
url
gon
.
test
=
Rails
.
env
.
test?
gon
.
test
=
Rails
.
env
.
test?
gon
.
revision
=
Gitlab
::
REVISION
if
current_user
if
current_user
gon
.
current_user_id
=
current_user
.
id
gon
.
current_user_id
=
current_user
.
id
...
...
spec/javascripts/raven/index_spec.js
View file @
af139873
...
@@ -2,25 +2,23 @@ import RavenConfig from '~/raven/raven_config';
...
@@ -2,25 +2,23 @@ import RavenConfig from '~/raven/raven_config';
import
index
from
'
~/raven/index
'
;
import
index
from
'
~/raven/index
'
;
describe
(
'
RavenConfig options
'
,
()
=>
{
describe
(
'
RavenConfig options
'
,
()
=>
{
let
sentryDsn
;
const
sentryDsn
=
'
sentryDsn
'
;
let
currentUserId
;
const
currentUserId
=
'
currentUserId
'
;
let
gitlabUrl
;
const
gitlabUrl
=
'
gitlabUrl
'
;
let
isProduction
;
const
isProduction
=
'
isProduction
'
;
const
revision
=
'
revision
'
;
let
indexReturnValue
;
let
indexReturnValue
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
sentryDsn
=
'
sentryDsn
'
;
currentUserId
=
'
currentUserId
'
;
gitlabUrl
=
'
gitlabUrl
'
;
isProduction
=
'
isProduction
'
;
window
.
gon
=
{
window
.
gon
=
{
sentry_dsn
:
sentryDsn
,
sentry_dsn
:
sentryDsn
,
current_user_id
:
currentUserId
,
current_user_id
:
currentUserId
,
gitlab_url
:
gitlabUrl
,
gitlab_url
:
gitlabUrl
,
revision
,
};
};
process
.
env
.
NODE_ENV
=
isProduction
;
process
.
env
.
NODE_ENV
=
isProduction
;
process
.
env
.
HEAD_COMMIT_SHA
=
revision
;
spyOn
(
RavenConfig
,
'
init
'
);
spyOn
(
RavenConfig
,
'
init
'
);
...
@@ -33,6 +31,10 @@ describe('RavenConfig options', () => {
...
@@ -33,6 +31,10 @@ describe('RavenConfig options', () => {
currentUserId
,
currentUserId
,
whitelistUrls
:
[
gitlabUrl
],
whitelistUrls
:
[
gitlabUrl
],
isProduction
,
isProduction
,
release
:
revision
,
tags
:
{
revision
,
},
});
});
});
});
...
...
spec/javascripts/raven/raven_config_spec.js
View file @
af139873
...
@@ -25,17 +25,11 @@ describe('RavenConfig', () => {
...
@@ -25,17 +25,11 @@ describe('RavenConfig', () => {
});
});
describe
(
'
init
'
,
()
=>
{
describe
(
'
init
'
,
()
=>
{
let
options
;
const
options
=
{
beforeEach
(()
=>
{
options
=
{
sentryDsn
:
'
//sentryDsn
'
,
ravenAssetUrl
:
'
//ravenAssetUrl
'
,
currentUserId
:
1
,
currentUserId
:
1
,
whitelistUrls
:
[
'
//gitlabUrl
'
],
isProduction
:
true
,
};
};
beforeEach
(()
=>
{
spyOn
(
RavenConfig
,
'
configure
'
);
spyOn
(
RavenConfig
,
'
configure
'
);
spyOn
(
RavenConfig
,
'
bindRavenErrors
'
);
spyOn
(
RavenConfig
,
'
bindRavenErrors
'
);
spyOn
(
RavenConfig
,
'
setUser
'
);
spyOn
(
RavenConfig
,
'
setUser
'
);
...
@@ -62,30 +56,28 @@ describe('RavenConfig', () => {
...
@@ -62,30 +56,28 @@ describe('RavenConfig', () => {
it
(
'
should not call setUser if there is no current user ID
'
,
()
=>
{
it
(
'
should not call setUser if there is no current user ID
'
,
()
=>
{
RavenConfig
.
setUser
.
calls
.
reset
();
RavenConfig
.
setUser
.
calls
.
reset
();
RavenConfig
.
init
({
options
.
currentUserId
=
undefined
;
sentryDsn
:
'
//sentryDsn
'
,
ravenAssetUrl
:
'
//ravenAssetUrl
'
,
RavenConfig
.
init
(
options
);
currentUserId
:
undefined
,
whitelistUrls
:
[
'
//gitlabUrl
'
],
isProduction
:
true
,
});
expect
(
RavenConfig
.
setUser
).
not
.
toHaveBeenCalled
();
expect
(
RavenConfig
.
setUser
).
not
.
toHaveBeenCalled
();
});
});
});
});
describe
(
'
configure
'
,
()
=>
{
describe
(
'
configure
'
,
()
=>
{
let
options
;
let
raven
;
let
raven
;
let
ravenConfig
;
let
ravenConfig
;
const
options
=
{
beforeEach
(()
=>
{
options
=
{
sentryDsn
:
'
//sentryDsn
'
,
sentryDsn
:
'
//sentryDsn
'
,
whitelistUrls
:
[
'
//gitlabUrl
'
],
whitelistUrls
:
[
'
//gitlabUrl
'
],
isProduction
:
true
,
isProduction
:
true
,
release
:
'
revision
'
,
tags
:
{
revision
:
'
revision
'
,
},
};
};
beforeEach
(()
=>
{
ravenConfig
=
jasmine
.
createSpyObj
(
'
ravenConfig
'
,
[
'
shouldSendSample
'
]);
ravenConfig
=
jasmine
.
createSpyObj
(
'
ravenConfig
'
,
[
'
shouldSendSample
'
]);
raven
=
jasmine
.
createSpyObj
(
'
raven
'
,
[
'
install
'
]);
raven
=
jasmine
.
createSpyObj
(
'
raven
'
,
[
'
install
'
]);
...
@@ -100,6 +92,8 @@ describe('RavenConfig', () => {
...
@@ -100,6 +92,8 @@ describe('RavenConfig', () => {
it
(
'
should call Raven.config
'
,
()
=>
{
it
(
'
should call Raven.config
'
,
()
=>
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
release
:
options
.
release
,
tags
:
options
.
tags
,
whitelistUrls
:
options
.
whitelistUrls
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'
production
'
,
environment
:
'
production
'
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
...
@@ -118,6 +112,8 @@ describe('RavenConfig', () => {
...
@@ -118,6 +112,8 @@ describe('RavenConfig', () => {
RavenConfig
.
configure
.
call
(
ravenConfig
);
RavenConfig
.
configure
.
call
(
ravenConfig
);
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
release
:
options
.
release
,
tags
:
options
.
tags
,
whitelistUrls
:
options
.
whitelistUrls
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'
development
'
,
environment
:
'
development
'
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
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