Skip to content
代码片段 群组 项目
提交 a9d2bb2b 编辑于 作者: Terri Chu's avatar Terri Chu
浏览文件

Merge branch 'led/407169-make-new-setting-available-in-gon' into 'master'

Add sentry_clientside_traces_sample_rate setting to gon

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130144



Merged-by: default avatarTerri Chu <tchu@gitlab.com>
Approved-by: default avatarRadamanthus Batnag <rbatnag@gitlab.com>
Approved-by: default avatarTerri Chu <tchu@gitlab.com>
Reviewed-by: default avatarTerri Chu <tchu@gitlab.com>
Reviewed-by: default avatarSheldon Led <sheldonled@gitlab.com>
Reviewed-by: default avatarRadamanthus Batnag <rbatnag@gitlab.com>
Co-authored-by: default avatarSheldon Led <sheldonled@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -28,6 +28,7 @@ def add_gon_variables
current_user) && Gitlab::CurrentSettings.sentry_enabled
gon.sentry_dsn = Gitlab::CurrentSettings.sentry_clientside_dsn
gon.sentry_environment = Gitlab::CurrentSettings.sentry_environment
gon.sentry_clientside_traces_sample_rate = Gitlab::CurrentSettings.sentry_clientside_traces_sample_rate
end
gon.recaptcha_api_server_url = ::Recaptcha.configuration.api_server_url
......
......@@ -58,6 +58,7 @@
context 'when sentry is configured' do
let(:clientside_dsn) { 'https://xxx@sentry.example.com/1' }
let(:environment) { 'staging' }
let(:sentry_clientside_traces_sample_rate) { 0.5 }
context 'with legacy sentry configuration' do
before do
......@@ -77,6 +78,15 @@
stub_application_setting(sentry_enabled: true)
stub_application_setting(sentry_clientside_dsn: clientside_dsn)
stub_application_setting(sentry_environment: environment)
stub_application_setting(sentry_clientside_traces_sample_rate: sentry_clientside_traces_sample_rate)
end
it 'sets sentry dsn and environment from config' do
expect(gon).to receive(:sentry_dsn=).with(clientside_dsn)
expect(gon).to receive(:sentry_environment=).with(environment)
expect(gon).to receive(:sentry_clientside_traces_sample_rate=).with(sentry_clientside_traces_sample_rate)
helper.add_gon_variables
end
context 'when enable_new_sentry_clientside_integration is disabled' do
......@@ -87,19 +97,8 @@
it 'does not set sentry dsn and environment from config' do
expect(gon).not_to receive(:sentry_dsn=).with(clientside_dsn)
expect(gon).not_to receive(:sentry_environment=).with(environment)
helper.add_gon_variables
end
end
context 'when enable_new_sentry_clientside_integration is enabled' do
before do
stub_feature_flags(enable_new_sentry_clientside_integration: true)
end
it 'sets sentry dsn and environment from config' do
expect(gon).to receive(:sentry_dsn=).with(clientside_dsn)
expect(gon).to receive(:sentry_environment=).with(environment)
expect(gon).not_to receive(:sentry_clientside_traces_sample_rate=)
.with(sentry_clientside_traces_sample_rate)
helper.add_gon_variables
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册