summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-05-01 23:30:13 +0000
committerStan Hu <stanhu@gmail.com>2019-05-01 23:30:13 +0000
commit97d3e170a20b54128f74e03df984cc51c4dfe6d2 (patch)
tree6df7be0ee22520bfb32f5198dbd7188d31ebaa5b
parentf5998875e5d697d421446ccd59938c583b54dee0 (diff)
parent1746f154c580915be7352dfbf0b809d42b07a32a (diff)
downloadgitlab-ce-97d3e170a20b54128f74e03df984cc51c4dfe6d2.tar.gz
Merge branch 'da-sentry-client-side-settings' into 'master'
Allow Sentry client-side DSN to be passed on gitlab.yml See merge request gitlab-org/gitlab-ce!27967
-rw-r--r--app/models/application_setting_implementation.rb2
-rw-r--r--app/views/admin/application_settings/_logging.html.haml1
-rw-r--r--changelogs/unreleased/da-sentry-client-side-settings.yml5
-rw-r--r--config/gitlab.yml.example1
-rw-r--r--config/initializers/1_settings.rb1
-rw-r--r--spec/support/shared_examples/application_setting_examples.rb4
6 files changed, 11 insertions, 3 deletions
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index 557215ff4dc..ee12a1d09f3 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -196,7 +196,7 @@ module ApplicationSettingImplementation
end
def clientside_sentry_dsn
- Gitlab.config.sentry.dsn || read_attribute(:clientside_sentry_dsn)
+ Gitlab.config.sentry.clientside_dsn || read_attribute(:clientside_sentry_dsn)
end
def performance_bar_allowed_group
diff --git a/app/views/admin/application_settings/_logging.html.haml b/app/views/admin/application_settings/_logging.html.haml
index 006ebf09576..1da5f6fccd6 100644
--- a/app/views/admin/application_settings/_logging.html.haml
+++ b/app/views/admin/application_settings/_logging.html.haml
@@ -5,7 +5,6 @@
%strong
NOTE:
These settings will be removed from the UI in a GitLab 12.0 release and made available within gitlab.yml.
- The specific client side DSN setting is already handled as a component from a Sentry perspective and will be removed.
In addition, you will be able to define a Sentry Environment to differentiate between multiple deployments. For example, development, staging, and production.
%fieldset
diff --git a/changelogs/unreleased/da-sentry-client-side-settings.yml b/changelogs/unreleased/da-sentry-client-side-settings.yml
new file mode 100644
index 00000000000..e36ac7c354b
--- /dev/null
+++ b/changelogs/unreleased/da-sentry-client-side-settings.yml
@@ -0,0 +1,5 @@
+---
+title: Allow Sentry client-side DSN to be passed on gitlab.yml
+merge_request: 27967
+author:
+type: added
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 06530194907..2f822805b25 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -320,6 +320,7 @@ production: &base
sentry:
# enabled: false
# dsn: https://<key>@sentry.io/<project>
+ # clientside_dsn: https://<key>@sentry.io/<project>
# environment: 'production' # e.g. development, staging, production
#
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 154de3bc1b0..d56bd7654af 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -224,6 +224,7 @@ Settings['sentry'] ||= Settingslogic.new({})
Settings.sentry['enabled'] ||= false
Settings.sentry['dsn'] ||= nil
Settings.sentry['environment'] ||= nil
+Settings.sentry['clientside_dsn'] ||= nil
#
# Pages
diff --git a/spec/support/shared_examples/application_setting_examples.rb b/spec/support/shared_examples/application_setting_examples.rb
index d8f7ba1185e..421303c97be 100644
--- a/spec/support/shared_examples/application_setting_examples.rb
+++ b/spec/support/shared_examples/application_setting_examples.rb
@@ -260,6 +260,7 @@ RSpec.shared_examples 'application settings examples' do
allow(Gitlab.config.sentry).to receive(:enabled).and_return(false)
allow(Gitlab.config.sentry).to receive(:dsn).and_return(nil)
+ allow(Gitlab.config.sentry).to receive(:clientside_dsn).and_return(nil)
expect(setting.sentry_enabled).to eq true
expect(setting.sentry_dsn).to eq 'https://b44a0828b72421a6d8e99efd68d44fa8@example.com/40'
@@ -277,12 +278,13 @@ RSpec.shared_examples 'application settings examples' do
allow(Gitlab.config.sentry).to receive(:enabled).and_return(true)
allow(Gitlab.config.sentry).to receive(:dsn).and_return('https://b44a0828b72421a6d8e99efd68d44fa8@example.com/42')
+ allow(Gitlab.config.sentry).to receive(:clientside_dsn).and_return('https://b44a0828b72421a6d8e99efd68d44fa8@example.com/43')
expect(setting).not_to receive(:read_attribute)
expect(setting.sentry_enabled).to eq true
expect(setting.sentry_dsn).to eq 'https://b44a0828b72421a6d8e99efd68d44fa8@example.com/42'
expect(setting.clientside_sentry_enabled).to eq true
- expect(setting.clientside_sentry_dsn). to eq 'https://b44a0828b72421a6d8e99efd68d44fa8@example.com/42'
+ expect(setting.clientside_sentry_dsn). to eq 'https://b44a0828b72421a6d8e99efd68d44fa8@example.com/43'
end
end
end