From c252c03401881fd7dbf7fab984285c402eb31d5f Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Sun, 9 Oct 2016 23:40:58 +0100 Subject: Added raven and raven-vue plugin, updated gon_helper with data needed for raven and created raven_config, required by application.js Added is_production to define sentry environment Removed as much jQuery as possible Added public_sentry_dsn application_settings helper method Use URI module instead of regex for public dsn Removed raven-vue and load raven on if sentry is enabled Add load_script spec added raven_config spec added class_spec_helper and tests added sentry_helper spec added feature spec --- lib/gitlab/gon_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index b8a5ac907a4..70ffb68c9ab 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -1,3 +1,5 @@ +include SentryHelper + module Gitlab module GonHelper def add_gon_variables @@ -10,6 +12,10 @@ module Gitlab gon.award_menu_url = emojis_path 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 = sentry_dsn_public if sentry_enabled? + gon.raven_asset_url = ActionController::Base.helpers.asset_path('raven.js') if sentry_enabled? + gon.gitlab_url = Gitlab.config.gitlab.url + gon.is_production = Rails.env.production? if current_user gon.current_user_id = current_user.id -- cgit v1.2.1 From cfd3d0fd377c3438c6ce8bc2f20b11f86b43a785 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Tue, 4 Apr 2017 14:58:45 +0100 Subject: [ci skip] Remove loadscript class in favour of backend conditional --- lib/gitlab/gon_helper.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 956e80b4a09..4de504e9bf9 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -13,7 +13,6 @@ module Gitlab 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 = sentry_dsn_public if sentry_enabled? - gon.raven_asset_url = ActionController::Base.helpers.asset_path('raven.js') if sentry_enabled? gon.gitlab_url = Gitlab.config.gitlab.url gon.is_production = Rails.env.production? -- cgit v1.2.1 From 284d4f76fee9f593cb67f3f2978ad4f49ef03c13 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 28 Apr 2017 13:23:34 +0100 Subject: Attempted adding separate clientside_sentry settings --- lib/gitlab/gon_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 4de504e9bf9..a8a2715e848 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -12,7 +12,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 = sentry_dsn_public if sentry_enabled? + gon.sentry_dsn = Gitlab.config.clientside_sentry_dsn if clientside_sentry_enabled? gon.gitlab_url = Gitlab.config.gitlab.url gon.is_production = Rails.env.production? -- cgit v1.2.1 From 8e8be5d1710f246bbb43c6c0bae82dead1139fde Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 28 Apr 2017 13:51:45 +0100 Subject: Fixed view to correct property --- lib/gitlab/gon_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index a8a2715e848..e7ae1d16698 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -12,7 +12,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 clientside_sentry_enabled? + gon.sentry_dsn = Gitlab.config.clientside_sentry_dsn if Gitlab.config.clientside_sentry_enabled gon.gitlab_url = Gitlab.config.gitlab.url gon.is_production = Rails.env.production? -- cgit v1.2.1 From 0e8afe1343497165bf609a840306ce26c6136a7b Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 28 Apr 2017 14:00:20 +0100 Subject: Remove unneeded helper include --- lib/gitlab/gon_helper.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index e7ae1d16698..34f74232db6 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -1,5 +1,3 @@ -include SentryHelper - module Gitlab module GonHelper def add_gon_variables -- cgit v1.2.1 From 97633d561681a5c0f55472c1372bedca5fe3bffe Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 28 Apr 2017 16:01:22 +0100 Subject: Fixed specs --- lib/gitlab/gon_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 34f74232db6..848b3352c63 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -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? -- cgit v1.2.1 From e5a7ed3ac36aaa1045353e589dae98a29ca72f1e Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 5 May 2017 15:55:55 +0100 Subject: Review changes --- lib/gitlab/gon_helper.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 848b3352c63..26473f99bc3 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -12,7 +12,6 @@ module Gitlab 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.gitlab_url = Gitlab.config.gitlab.url - gon.is_production = Rails.env.production? if current_user gon.current_user_id = current_user.id -- cgit v1.2.1