summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRoger Meier <r.meier@siemens.com>2019-04-30 22:06:08 +0200
committerRoger Meier <r.meier@siemens.com>2019-06-25 21:17:19 +0200
commit946ffc67b711b39512a789213779d2736fcc0049 (patch)
tree661cfd4c18767c9972ca7775e7c8e4d1f1586544 /app
parent76889a9956e76e300edc8993048c3cd5c3a24da0 (diff)
downloadgitlab-ce-946ffc67b711b39512a789213779d2736fcc0049.tar.gz
refactor: remove Sentry from application settings
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_settings_helper.rb4
-rw-r--r--app/models/application_setting.rb13
-rw-r--r--app/models/application_setting_implementation.rb21
-rw-r--r--app/views/admin/application_settings/_logging.html.haml38
-rw-r--r--app/views/admin/application_settings/reporting.html.haml11
-rw-r--r--app/views/layouts/_head.html.haml2
6 files changed, 5 insertions, 84 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index d837c42fd68..aaaa954047f 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -165,8 +165,6 @@ module ApplicationSettingsHelper
:authorized_keys_enabled,
:auto_devops_enabled,
:auto_devops_domain,
- :clientside_sentry_dsn,
- :clientside_sentry_enabled,
:container_registry_token_expire_delay,
:default_artifacts_expire_in,
:default_branch_protection,
@@ -235,8 +233,6 @@ module ApplicationSettingsHelper
:restricted_visibility_levels,
:rsa_key_restriction,
:send_user_confirmation_email,
- :sentry_dsn,
- :sentry_enabled,
:session_expire_delay,
:shared_runners_enabled,
:shared_runners_text,
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index bbe2d2e8fd4..cd645850af3 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -30,6 +30,10 @@ class ApplicationSetting < ApplicationRecord
ignore_column :circuitbreaker_check_interval
ignore_column :koding_url
ignore_column :koding_enabled
+ ignore_column :sentry_enabled
+ ignore_column :sentry_dsn
+ ignore_column :clientside_sentry_enabled
+ ignore_column :clientside_sentry_dsn
cache_markdown_field :sign_in_text
cache_markdown_field :help_page_text
@@ -75,14 +79,6 @@ class ApplicationSetting < ApplicationRecord
presence: true,
if: :recaptcha_enabled
- validates :sentry_dsn,
- presence: true,
- if: :sentry_enabled
-
- validates :clientside_sentry_dsn,
- presence: true,
- if: :clientside_sentry_enabled
-
validates :akismet_api_key,
presence: true,
if: :akismet_enabled
@@ -264,7 +260,6 @@ class ApplicationSetting < ApplicationRecord
encode: true
before_validation :ensure_uuid!
- before_validation :strip_sentry_values
before_save :ensure_runners_registration_token
before_save :ensure_health_check_access_token
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index cf328bcd994..df4caed175d 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -180,27 +180,6 @@ module ApplicationSettingImplementation
super(levels&.map { |level| Gitlab::VisibilityLevel.level_value(level) })
end
- def strip_sentry_values
- sentry_dsn.strip! if sentry_dsn.present?
- clientside_sentry_dsn.strip! if clientside_sentry_dsn.present?
- end
-
- def sentry_enabled
- Gitlab.config.sentry.enabled || read_attribute(:sentry_enabled)
- end
-
- def sentry_dsn
- Gitlab.config.sentry.dsn || read_attribute(:sentry_dsn)
- end
-
- def clientside_sentry_enabled
- Gitlab.config.sentry.enabled || read_attribute(:clientside_sentry_enabled)
- end
-
- def clientside_sentry_dsn
- Gitlab.config.sentry.clientside_dsn || read_attribute(:clientside_sentry_dsn)
- end
-
def performance_bar_allowed_group
Group.find_by_id(performance_bar_allowed_group_id)
end
diff --git a/app/views/admin/application_settings/_logging.html.haml b/app/views/admin/application_settings/_logging.html.haml
deleted file mode 100644
index d57066bba01..00000000000
--- a/app/views/admin/application_settings/_logging.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-= form_for @application_setting, url: reporting_admin_application_settings_path(anchor: 'js-logging-settings'), html: { class: 'fieldset-form' } do |f|
- = form_errors(@application_setting)
-
- %p
- %strong
- NOTE:
- These settings will be removed from the UI in a GitLab 12.0 release and made available within gitlab.yml.
- In addition, you will be able to define a Sentry Environment to differentiate between multiple deployments. For example, development, staging, and production.
-
- %fieldset
- .form-group
- .form-check
- = f.check_box :sentry_enabled, class: 'form-check-input'
- = f.label :sentry_enabled, class: 'form-check-label' do
- Enable Sentry
- .form-text.text-muted
- %p This setting requires a restart to take effect.
- Sentry is an error reporting and logging tool which is currently not shipped with GitLab, get it here:
- %a{ href: 'https://getsentry.com', target: '_blank', rel: 'noopener noreferrer' } https://getsentry.com
-
- .form-group
- = f.label :sentry_dsn, 'Sentry DSN', class: 'label-bold'
- = f.text_field :sentry_dsn, class: 'form-control'
-
- .form-group
- .form-check
- = f.check_box :clientside_sentry_enabled, class: 'form-check-input'
- = f.label :clientside_sentry_enabled, class: 'form-check-label' do
- Enable Clientside Sentry
- .form-text.text-muted
- Sentry can also be used for reporting and logging clientside exceptions.
- %a{ href: 'https://sentry.io/for/javascript/', target: '_blank', rel: 'noopener noreferrer' } https://sentry.io/for/javascript/
-
- .form-group
- = f.label :clientside_sentry_dsn, 'Clientside Sentry DSN', class: 'label-bold'
- = f.text_field :clientside_sentry_dsn, class: 'form-control'
-
- = f.submit 'Save changes', class: "btn btn-success"
diff --git a/app/views/admin/application_settings/reporting.html.haml b/app/views/admin/application_settings/reporting.html.haml
index 1c2d9ccdb2d..46e3d1c4570 100644
--- a/app/views/admin/application_settings/reporting.html.haml
+++ b/app/views/admin/application_settings/reporting.html.haml
@@ -23,14 +23,3 @@
= _('Set notification email for abuse reports.')
.settings-content
= render 'abuse'
-
-%section.settings.as-logging.no-animate#js-logging-settings{ class: ('expanded' if expanded_by_default?) }
- .settings-header
- %h4
- = _('Error Reporting and Logging')
- %button.btn.btn-default.js-settings-toggle{ type: 'button' }
- = expanded_by_default? ? _('Collapse') : _('Expand')
- %p
- = _('Enable Sentry for error reporting and logging.')
- .settings-content
- = render 'logging'
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 7535aee83a3..20b844f9fd8 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -46,7 +46,7 @@
= yield :library_javascripts
= javascript_include_tag locale_path unless I18n.locale == :en
- = webpack_bundle_tag "raven" if Gitlab::CurrentSettings.clientside_sentry_enabled
+ = webpack_bundle_tag "raven" if Gitlab.config.sentry.enabled
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts