Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
97633d56
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
97633d56
编写于
4月 28, 2017
作者:
L
Luke "Jared" Bennett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed specs
上级
0e8afe13
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
18 deletion
+24
-18
app/assets/javascripts/raven/raven_config.js
app/assets/javascripts/raven/raven_config.js
+1
-1
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+4
-1
config/application.rb
config/application.rb
+1
-0
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-1
spec/features/raven_js_spec.rb
spec/features/raven_js_spec.rb
+2
-2
spec/javascripts/raven/raven_config_spec.js
spec/javascripts/raven/raven_config_spec.js
+15
-13
未找到文件。
app/assets/javascripts/raven/raven_config.js
浏览文件 @
97633d56
...
...
@@ -61,7 +61,7 @@ const RavenConfig = {
environment
:
this
.
options
.
isProduction
?
'
production
'
:
'
development
'
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
ignoreUrls
:
this
.
IGNORE_URLS
,
shouldSendCallback
:
this
.
shouldSendSample
,
shouldSendCallback
:
this
.
shouldSendSample
.
bind
(
this
)
,
}).
install
();
},
...
...
app/views/layouts/_head.html.haml
浏览文件 @
97633d56
...
...
@@ -33,7 +33,10 @@
=
webpack_bundle_tag
"runtime"
=
webpack_bundle_tag
"common"
=
webpack_bundle_tag
"main"
=
webpack_bundle_tag
"raven"
if
Gitlab
.
config
.
clientside_sentry_enabled
=
webpack_bundle_tag
"raven"
if
current_application_settings
.
clientside_sentry_enabled
=
'LUKETEST'
=
current_application_settings
.
clientside_sentry_enabled
-
if
content_for?
(
:page_specific_javascripts
)
=
yield
:page_specific_javascripts
...
...
config/application.rb
浏览文件 @
97633d56
...
...
@@ -72,6 +72,7 @@ module Gitlab
runners_token
secret_token
sentry_dsn
clientside_sentry_enabled
clientside_sentry_dsn
variables
)
...
...
lib/gitlab/gon_helper.rb
浏览文件 @
97633d56
...
...
@@ -10,7 +10,7 @@ module Gitlab
gon
.
user_color_scheme
=
Gitlab
::
ColorSchemes
.
for_user
(
current_user
).
css_class
gon
.
katex_css_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.css'
)
gon
.
katex_js_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.js'
)
gon
.
sentry_dsn
=
Gitlab
.
config
.
clientside_sentry_dsn
if
Gitlab
.
config
.
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
.
is_production
=
Rails
.
env
.
production?
...
...
spec/features/raven_js_spec.rb
浏览文件 @
97633d56
...
...
@@ -10,8 +10,7 @@ feature 'RavenJS', :feature, :js do
end
it
'should load raven if sentry is enabled'
do
allow_any_instance_of
(
SentryHelper
).
to
receive_messages
(
sentry_dsn_public:
'https://key@domain.com/id'
,
sentry_enabled?:
true
)
stub_application_setting
(
clientside_sentry_dsn:
'https://key@domain.com/id'
,
clientside_sentry_enabled:
true
)
visit
new_user_session_path
...
...
@@ -19,6 +18,7 @@ feature 'RavenJS', :feature, :js do
end
def
has_requested_raven
p
page
.
driver
.
network_traffic
page
.
driver
.
network_traffic
.
one?
{
|
request
|
request
.
url
.
end_with?
(
raven_path
)}
end
end
spec/javascripts/raven/raven_config_spec.js
浏览文件 @
97633d56
...
...
@@ -77,6 +77,7 @@ describe('RavenConfig', () => {
describe
(
'
configure
'
,
()
=>
{
let
options
;
let
raven
;
let
ravenConfig
;
beforeEach
(()
=>
{
options
=
{
...
...
@@ -85,22 +86,25 @@ describe('RavenConfig', () => {
isProduction
:
true
,
};
ravenConfig
=
jasmine
.
createSpyObj
(
'
ravenConfig
'
,
[
'
shouldSendSample
'
]);
raven
=
jasmine
.
createSpyObj
(
'
raven
'
,
[
'
install
'
]);
spyOn
(
Raven
,
'
config
'
).
and
.
returnValue
(
raven
);
RavenConfig
.
configure
.
call
({
options
,
});
ravenConfig
.
options
=
options
;
ravenConfig
.
IGNORE_ERRORS
=
'
ignore_errors
'
;
ravenConfig
.
IGNORE_URLS
=
'
ignore_urls
'
;
RavenConfig
.
configure
.
call
(
ravenConfig
);
});
it
(
'
should call Raven.config
'
,
()
=>
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'
production
'
,
ignoreErrors
:
Raven
.
IGNORE_ERRORS
,
ignoreUrls
:
Raven
.
IGNORE_URLS
,
shouldSendCallback
:
Raven
.
shouldSendSample
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
ignoreUrls
:
ravenConfig
.
IGNORE_URLS
,
shouldSendCallback
:
jasmine
.
any
(
Function
)
,
});
});
...
...
@@ -109,18 +113,16 @@ describe('RavenConfig', () => {
});
it
(
'
should set .environment to development if isProduction is false
'
,
()
=>
{
options
.
isProduction
=
false
;
ravenConfig
.
options
.
isProduction
=
false
;
RavenConfig
.
configure
.
call
({
options
,
});
RavenConfig
.
configure
.
call
(
ravenConfig
);
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'
development
'
,
ignoreErrors
:
Raven
.
IGNORE_ERRORS
,
ignoreUrls
:
Raven
.
IGNORE_URLS
,
shouldSendCallback
:
Raven
.
shouldSendSample
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
ignoreUrls
:
ravenConfig
.
IGNORE_URLS
,
shouldSendCallback
:
jasmine
.
any
(
Function
)
,
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录