Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e2d5acb
Remove analytics lib and BOLT_DISABLE_ANALYTICS refs
op-ct Jun 30, 2026
d66f9c5
Remove analytics reporting from bolt executor
op-ct Jun 30, 2026
0b6825f
Remove analytics reporting from bolt cli
op-ct Jun 30, 2026
e990895
Remove analytics reporting from bolt app
op-ct Jun 30, 2026
309386f
Remove analytics from logger & plugin classes
op-ct Jun 30, 2026
79f0b40
Remove analytics from config :dagger:
op-ct Jun 30, 2026
7ee7d36
Permanently disable analytics in options :tada:
op-ct Jun 30, 2026
4efc881
:dagger:: applicator, yaml_plan eval, run
op-ct Jun 30, 2026
aa9c2b4
Remove analytics from inventory, mock_executor
op-ct Jun 30, 2026
6eab514
Remove (MANY) analytics from boltlib puppet funcs
op-ct Jun 30, 2026
dd56546
Remove analytics from bolt file module
op-ct Jun 30, 2026
ec11e1e
Remove analytics from ctrl, dir, prompt, system
op-ct Jun 30, 2026
9980be2
Remove analytics from "out" and "log" modules
op-ct Jun 30, 2026
b106be6
Remove analytics cruft from spec_helpers
op-ct Jun 30, 2026
9898db6
Remove analytic unit tests (config,cli)
op-ct Jun 30, 2026
2749b28
Remove analytic unit tests (executor)
op-ct Jun 30, 2026
efab3b1
Remove analytics unit tests (logger,app)
op-ct Jun 30, 2026
df62b4e
Remove analytics unit tests (evaluator)
op-ct Jun 30, 2026
0be0014
Remove analytics cruft from unit tests
op-ct Jun 30, 2026
822b4f8
Remove analytics unit tests
op-ct Jun 30, 2026
ee2afd7
Remove A LOT of boltlib analytics tests
op-ct Jun 30, 2026
2d6ab73
Update file:: function tests with new args sig
op-ct Jun 30, 2026
fa693a1
Remove analytics cruft from log:: function tests
op-ct Jun 30, 2026
203b9d0
:do_not_litter: Clean out:: and prompt tests
op-ct Jun 30, 2026
0b39a21
Rid schemas of refs to analytics
op-ct Jun 30, 2026
1a4b3b9
The (still-puppetlabsy) docker has spec tests?!
op-ct Jun 30, 2026
0dabf37
Remove analytics file from acceptance test
op-ct Jun 30, 2026
ff645c5
rm analytics.cruft
op-ct Jun 30, 2026
f028e75
Tidy up for Rubocop
op-ct Jun 30, 2026
e384c80
Add (previously) missing mocks
op-ct Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,6 @@ RSpec/IteratedExpectation:
- 'spec/unit/executor_spec.rb'
- 'spec/unit/fiber_executor_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/LeadingSubject:
Exclude:
- 'spec/unit/analytics_spec.rb'

# Offense count: 20
# This cop supports safe autocorrection (--autocorrect).
RSpec/MatchArray:
Expand Down Expand Up @@ -500,7 +494,6 @@ RSpec/MultipleDescribes:
Exclude:
- 'spec/integration/cli/cli_spec.rb'
- 'spec/integration/logging_spec.rb'
- 'spec/unit/analytics_spec.rb'
- 'spec/unit/config/options_spec.rb'

# Offense count: 648
Expand All @@ -514,7 +507,6 @@ RSpec/MultipleMemoizedHelpers:
RSpec/NamedSubject:
Exclude:
- 'bolt-modules/prompt/spec/functions/prompt_spec.rb'
- 'spec/unit/analytics_spec.rb'
- 'spec/unit/pal/yaml_plan/evaluator_spec.rb'
- 'spec/unit/plan_creator_spec.rb'
- 'spec/unit/plugin/env_var_spec.rb'
Expand All @@ -535,7 +527,6 @@ RSpec/NoExpectationExample:
Exclude:
- 'spec/integration/parallel_spec.rb'
- 'spec/integration/private_plan_spec.rb'
- 'spec/unit/analytics_spec.rb'
- 'spec/unit/pal/yaml_plan/evaluator_spec.rb'

# Offense count: 11
Expand Down Expand Up @@ -654,7 +645,6 @@ RSpec/SubjectDeclaration:
# Offense count: 20
RSpec/SubjectStub:
Exclude:
- 'spec/unit/analytics_spec.rb'
- 'spec/unit/transport/ssh/connection_spec.rb'

# Offense count: 1
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ def location_for(place, fake_version = nil)
end
end

# Disable analytics when running in development
ENV['BOLT_DISABLE_ANALYTICS'] = 'true'

# Disable warning that Bolt may be installed as a gem
ENV['BOLT_GEM'] = 'true'

Expand Down
2 changes: 0 additions & 2 deletions acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@

on bolt, "mkdir -p #{default_boltdir}"
create_remote_file(bolt, "#{default_boltdir}/inventory.yaml", inventory.to_yaml)

create_remote_file(bolt, "#{default_boltdir}/analytics.yaml", { 'disabled' => true }.to_yaml)
end
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/add_facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ def add_facts(target, facts)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

inventory.add_facts(target, facts)
end
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ def add_to_group(targets, group)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

inventory.add_to_group(inventory.get_targets(targets), group)
end
Expand Down
2 changes: 0 additions & 2 deletions bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def apply_prep(target_spec, options = {})
options = options.slice(*%w[_catch_errors _required_modules _run_as])
targets = inventory.get_targets(target_spec)

executor.report_function_call(self.class.name)

executor.log_action('install puppet and gather facts', targets) do
executor.without_default_logging do
install_results = install_agents(targets, options)
Expand Down
1 change: 0 additions & 1 deletion bolt-modules/boltlib/lib/puppet/functions/background.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def background(scope, name = nil, &block)
end

executor = Puppet.lookup(:bolt_executor)
executor.report_function_call(self.class.name)

plan_id = executor.get_current_plan_id(fiber: Fiber.current)
executor.create_future(scope: scope, name: name, plan_id: plan_id) do |newscope|
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ def catch_errors(error_types = nil)
action: self.class.name)
end

executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

begin
yield
rescue Puppet::PreformattedError => e
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/download_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ def download_file_with_description(source, destination, targets, description = n
FileUtils.rm_r(Dir.glob(destination + '*'), secure: true)
end

# Send Analytics Report
executor.report_function_call(self.class.name)

# Ensure that that given targets are all Target instances
targets = inventory.get_targets(targets)
if targets.empty?
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

def facts(target)
inventory = Puppet.lookup(:bolt_inventory)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

inventory.facts(target)
end
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ def from_args(msg, kind = nil, details = nil, issue_code = nil)
.from_issue_and_stack(Bolt::PAL::Issues::PLAN_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, action: 'fail_plan')
end

executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

raise Bolt::PlanFailure.new(msg, kind || 'bolt/plan-failure', details, issue_code)
end

Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/get_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ def get_resources(target_spec, resources)
end
end

# Send Analytics Report
executor.report_function_call(self.class.name)

targets = inventory.get_targets(target_spec)

executor.log_action('gather resources', targets) do
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/get_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

def get_target(name)
inventory = Puppet.lookup(:bolt_inventory)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

unless inventory.version > 1
raise Puppet::ParseErrorWithIssue
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/get_targets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

def get_targets(names)
inventory = Puppet.lookup(:bolt_inventory)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

inventory.get_targets(names)
end
Expand Down
1 change: 0 additions & 1 deletion bolt-modules/boltlib/lib/puppet/functions/parallelize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def parallelize(scope, data, &block)
end

executor = Puppet.lookup(:bolt_executor)
executor.report_function_call(self.class.name)

futures = data.map do |object|
# We're going to immediately wait for these futures, *and* don't want
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ def puppetdb_command_with_instance(command, version, payload, instance)
)
end

# Send analytics report.
Puppet.lookup(:bolt_executor).report_function_call(self.class.name)

puppetdb_client = Puppet.lookup(:bolt_pdb_client)

# Error if the PDB client does not implement :send_command
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ def puppetdb_fact(certnames)

def puppetdb_fact_with_instance(certnames, instance)
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

puppetdb_client.facts_for_node(certnames, instance)
end
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ def make_query(query)

def make_query_with_instance(query, instance)
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

puppetdb_client.make_query(query, nil, instance)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ def remove_from_group(target, group)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

inventory.remove_from_group(inventory.get_targets(target), group)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def resolve_references(references)
)
end

executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

plugins = Puppet.lookup(:bolt_inventory).plugins
plugins.resolve_references(references)
end
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@

def resource(target, type, title)
inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

inventory.resource(target, type, title)
end
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/run_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ def run_command_with_description(command, targets, description = nil, options =
executor = Puppet.lookup(:bolt_executor)
inventory = Puppet.lookup(:bolt_inventory)

# Send Analytics Report
executor.report_function_call(self.class.name)

# Ensure that given targets are all Target instances
targets = inventory.get_targets(targets)

Expand Down
2 changes: 0 additions & 2 deletions bolt-modules/boltlib/lib/puppet/functions/run_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def run_container(image, options = {})
.from_issue_and_stack(Bolt::PAL::Issues::PLAN_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, action: 'run_container')
end

# Send Analytics Report
executor = Puppet.lookup(:bolt_executor)
executor.report_function_call(self.class.name)

options = options.transform_keys { |k| k.sub(/^_/, '').to_sym }
validate_options(options)
Expand Down
13 changes: 0 additions & 13 deletions bolt-modules/boltlib/lib/puppet/functions/run_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ def run_inner_plan(scope, plan_name, targets, args = {})
options, params = args.partition { |k, _v| k.start_with?('_') }.map(&:to_h)
options = options.transform_keys { |k| k.sub(/^_/, '').to_sym }

# Bolt calls this function internally to trigger plans from the CLI. We
# don't want to count those invocations.
unless options[:bolt_api_call]
# Send Analytics Report
executor.report_function_call(self.class.name)
end

# Send Analytics Report for bundled content, this should capture plans run from both CLI and Plans
executor.report_bundled_content('Plan', plan_name)

loaders = closure_scope.compiler.loaders
# The perspective of the environment is wanted here (for now) to not have to
# require modules to have dependencies defined in meta data.
Expand All @@ -93,9 +83,6 @@ def run_inner_plan(scope, plan_name, targets, args = {})
end

closure = func.class.dispatcher.dispatchers[0]
if closure.model.is_a?(Bolt::PAL::YamlPlan)
executor.report_yaml_plan(closure.model.body)
end

# If a TargetSpec parameter is passed, ensure it is in inventory
inventory = Puppet.lookup(:bolt_inventory)
Expand Down
4 changes: 0 additions & 4 deletions bolt-modules/boltlib/lib/puppet/functions/run_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ def run_script_with_description(scope, script, targets, description = nil, optio
executor = Puppet.lookup(:bolt_executor)
inventory = Puppet.lookup(:bolt_inventory)

# Send Analytics Report
executor.report_function_call(self.class.name)

# Find the file path if it exists, otherwise return nil
found = Bolt::Util.find_file_from_scope(script, scope)
unless found && Puppet::FileSystem.exist?(found)
Expand All @@ -120,7 +117,6 @@ def run_script_with_description(scope, script, targets, description = nil, optio
Puppet::Pops::Issues::NOT_A_FILE, file: script
)
end
executor.report_file_source(self.class.name, script)
# Ensure that given targets are all Target instances)
targets = inventory.get_targets(targets)

Expand Down
14 changes: 0 additions & 14 deletions bolt-modules/boltlib/lib/puppet/functions/run_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ def run_task_with_description(task_name, targets, description, args = {})
executor = Puppet.lookup(:bolt_executor)
inventory = Puppet.lookup(:bolt_inventory)

# Bolt calls this function internally to trigger tasks from the CLI. We
# don't want to count those invocations.
unless options[:bolt_api_call]
# Send Analytics Report
executor.report_function_call(self.class.name)
end

# Report Analytics for bundled content, this should capture tasks run from
# both CLI and Plans.
executor.report_bundled_content('Task', task_name)

# Ensure that given targets are all Target instances.
targets = inventory.get_targets(targets)

Expand Down Expand Up @@ -138,9 +127,6 @@ def run_task_with_description(task_name, targets, description, args = {})
end
end

# Report whether the task was run in noop mode.
executor.report_noop_mode(executor.noop || options[:noop])

file_line = Puppet::Pops::PuppetStack.top_of_stack
result = if executor.in_parallel?
executor.run_in_thread do
Expand Down
7 changes: 0 additions & 7 deletions bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ def run_task_with_with_description(task_name, targets, description, options = {}
inventory = Puppet.lookup(:bolt_inventory)
error_set = []

# Report to analytics
executor.report_function_call(self.class.name)
executor.report_bundled_content('Task', task_name)

# Keep valid metaparameters, discarding everything else
options = options.select { |k, _v| k.start_with?('_') }
.transform_keys { |k| k.sub(/^_/, '').to_sym }
Expand Down Expand Up @@ -182,9 +178,6 @@ def run_task_with_with_description(task_name, targets, description, options = {}
end
end

# Report whether the task was run in noop mode.
executor.report_noop_mode(executor.noop || options[:noop])

# Combine the results from the task run with any failing results that were
# generated earlier when creating the target mapping
file_line = Puppet::Pops::PuppetStack.top_of_stack
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/set_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def set_config(target, key_or_key_path, value = true)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

unless inventory.version > 1
raise Puppet::ParseErrorWithIssue
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/set_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def set_feature(target, feature, value = true)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

inventory.set_feature(target, feature, value)

Expand Down
2 changes: 0 additions & 2 deletions bolt-modules/boltlib/lib/puppet/functions/set_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ def set_resources(target, resources)
)
end

# Send Analytics Report
Puppet.lookup(:bolt_executor).report_function_call(self.class.name)
inventory = Puppet.lookup(:bolt_inventory)

resources.uniq.map do |resource|
Expand Down
3 changes: 0 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/set_var.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ def set_var(target, key, value)
end

inventory = Puppet.lookup(:bolt_inventory)
executor = Puppet.lookup(:bolt_executor)
# Send Analytics Report
executor.report_function_call(self.class.name)

var_hash = { key => value }
inventory.set_var(target, var_hash)
Expand Down
Loading
Loading