Skip to content

Commit 728806f

Browse files
authored
Merge pull request #144 from OpenVoxProject/disable_analytics
Disable analytics code
2 parents c1c515b + e858d0f commit 728806f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/bolt/analytics.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
# None of this currently works, as it's based on Perforce's old GA setup.
4+
# It is functionally disabled here, but the code remains in case we want
5+
# to revive it for Vox Pupuli later.
36
require_relative '../bolt/util'
47
require_relative '../bolt/version'
58
require 'find'
@@ -30,6 +33,8 @@ module Analytics
3033
}.freeze
3134

3235
def self.build_client(enabled = true)
36+
# Remove if we fix this for Vox analytics
37+
config = { 'disabled' => true }
3338
begin
3439
config_file = config_path
3540
config = enabled ? load_config(config_file) : {}
@@ -38,7 +43,8 @@ def self.build_client(enabled = true)
3843
end
3944

4045
if !enabled || config['disabled'] || ENV['BOLT_DISABLE_ANALYTICS']
41-
Bolt::Logger.debug "Analytics opt-out is set, analytics will be disabled"
46+
# Uncomment if we fix this for Vox analytics
47+
# Bolt::Logger.debug "Analytics opt-out is set, analytics will be disabled"
4248
NoopClient.new
4349
else
4450
unless config.key?('user-id')
@@ -76,7 +82,8 @@ def self.load_config(filename)
7682
if File.exist?(filename)
7783
Bolt::Util.read_optional_yaml_hash(filename, 'analytics')
7884
else
79-
unless ENV['BOLT_DISABLE_ANALYTICS']
85+
# Remove || true if we fix this for Vox analytics
86+
unless ENV['BOLT_DISABLE_ANALYTICS'] || true
8087
msg = <<~ANALYTICS
8188
Bolt collects data about how you use it. You can opt out of providing this data.
8289
To learn how to disable data collection, or see what data Bolt collects and why,

spec/unit/analytics_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper'
44
require 'bolt/analytics'
55

6-
describe Bolt::Analytics do
6+
describe Bolt::Analytics, skip: 'Analytics is currently disabled' do
77
let(:default_config) { {} }
88

99
before :each do |test|

0 commit comments

Comments
 (0)