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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ef73fe30
Commit
ef73fe30
authored
May 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::REVISION over reading HEAD sha from git
parent
a9a603e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
app/assets/javascripts/raven/index.js
app/assets/javascripts/raven/index.js
+2
-2
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-0
spec/javascripts/raven/index_spec.js
spec/javascripts/raven/index_spec.js
+5
-4
spec/javascripts/raven/raven_config_spec.js
spec/javascripts/raven/raven_config_spec.js
+17
-19
No files found.
app/assets/javascripts/raven/index.js
View file @
ef73fe30
...
@@ -6,9 +6,9 @@ const index = function index() {
...
@@ -6,9 +6,9 @@ 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
:
process
.
env
.
HEAD_COMMIT_SHA
,
release
:
gon
.
revision
,
tags
:
{
tags
:
{
HEAD_COMMIT_SHA
:
process
.
env
.
HEAD_COMMIT_SHA
,
revision
:
gon
.
revision
,
},
},
});
});
...
...
lib/gitlab/gon_helper.rb
View file @
ef73fe30
...
@@ -12,6 +12,7 @@ module Gitlab
...
@@ -12,6 +12,7 @@ module Gitlab
gon
.
katex_js_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.js'
)
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
.
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
.
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 @
ef73fe30
...
@@ -6,7 +6,7 @@ describe('RavenConfig options', () => {
...
@@ -6,7 +6,7 @@ describe('RavenConfig options', () => {
const
currentUserId
=
'
currentUserId
'
;
const
currentUserId
=
'
currentUserId
'
;
const
gitlabUrl
=
'
gitlabUrl
'
;
const
gitlabUrl
=
'
gitlabUrl
'
;
const
isProduction
=
'
isProduction
'
;
const
isProduction
=
'
isProduction
'
;
const
headCommitSHA
=
'
headCommitSHA
'
;
const
revision
=
'
revision
'
;
let
indexReturnValue
;
let
indexReturnValue
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
@@ -14,10 +14,11 @@ describe('RavenConfig options', () => {
...
@@ -14,10 +14,11 @@ describe('RavenConfig options', () => {
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
=
headCommitSHA
;
process
.
env
.
HEAD_COMMIT_SHA
=
revision
;
spyOn
(
RavenConfig
,
'
init
'
);
spyOn
(
RavenConfig
,
'
init
'
);
...
@@ -30,9 +31,9 @@ describe('RavenConfig options', () => {
...
@@ -30,9 +31,9 @@ describe('RavenConfig options', () => {
currentUserId
,
currentUserId
,
whitelistUrls
:
[
gitlabUrl
],
whitelistUrls
:
[
gitlabUrl
],
isProduction
,
isProduction
,
release
:
headCommitSHA
,
release
:
revision
,
tags
:
{
tags
:
{
HEAD_COMMIT_SHA
:
headCommitSHA
,
revision
,
},
},
});
});
});
});
...
...
spec/javascripts/raven/raven_config_spec.js
View file @
ef73fe30
...
@@ -25,7 +25,9 @@ describe('RavenConfig', () => {
...
@@ -25,7 +25,9 @@ describe('RavenConfig', () => {
});
});
describe
(
'
init
'
,
()
=>
{
describe
(
'
init
'
,
()
=>
{
const
options
=
{};
const
options
=
{
currentUserId
:
1
,
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
RavenConfig
,
'
configure
'
);
spyOn
(
RavenConfig
,
'
configure
'
);
...
@@ -54,34 +56,28 @@ describe('RavenConfig', () => {
...
@@ -54,34 +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
=
{
sentryDsn
:
'
//sentryDsn
'
,
whitelistUrls
:
[
'
//gitlabUrl
'
],
isProduction
:
true
,
release
:
'
revision
'
,
tags
:
{
revision
:
'
revision
'
,
},
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
options
=
{
sentryDsn
:
'
//sentryDsn
'
,
whitelistUrls
:
[
'
//gitlabUrl
'
],
isProduction
:
true
,
release
:
'
release
'
,
tags
:
{
HEAD_COMMIT_SHA
:
'
headCommitSha
'
,
},
};
ravenConfig
=
jasmine
.
createSpyObj
(
'
ravenConfig
'
,
[
'
shouldSendSample
'
]);
ravenConfig
=
jasmine
.
createSpyObj
(
'
ravenConfig
'
,
[
'
shouldSendSample
'
]);
raven
=
jasmine
.
createSpyObj
(
'
raven
'
,
[
'
install
'
]);
raven
=
jasmine
.
createSpyObj
(
'
raven
'
,
[
'
install
'
]);
...
@@ -116,6 +112,8 @@ describe('RavenConfig', () => {
...
@@ -116,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