From 65b82e5b75e3dfaa9393939f08b90cf9affcc7d8 Mon Sep 17 00:00:00 2001 From: dstull Date: Tue, 13 Aug 2019 13:31:40 -0400 Subject: Add pendo tracking code backport from ee - This needs to be added in order to satisfy the idea of keeping the ce/ee codebases as much in line as possible. The pendo code will not be used in this codebase. --- app/views/layouts/_head.html.haml | 1 + config/initializers/1_settings.rb | 1 + spec/spec_helper.rb | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 271b73326fa..85c8192e855 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -79,3 +79,4 @@ = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id') = render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id') = render_if_exists 'layouts/snowplow' + = render_if_exists 'layouts/pendo' if Feature.enabled?(:pendo_tracking) diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 828732126b6..afec16228d5 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -209,6 +209,7 @@ Gitlab.ee do Settings.gitlab['mirror_max_delay'] ||= 300 Settings.gitlab['mirror_max_capacity'] ||= 30 Settings.gitlab['mirror_capacity_threshold'] ||= 15 + Settings.gitlab['pendo_api_key'] ||= ENV['GITLAB_PENDO_API_KEY'] end # diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bcc133790d1..1a930886411 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -145,6 +145,12 @@ RSpec.configure do |config| .with(:force_autodevops_on_by_default, anything) .and_return(false) + # Disable Pendo tracking features by default as we do not want tests to send + # data to Pendo. + # Once we move away from Feature flag use for Pendo into using our built in + # feature flag setup, we can remove this. + stub_feature_flags(pendo_tracking: false) + Gitlab::ThreadMemoryCache.cache_backend.clear end -- cgit v1.2.1