From e2d5acb4f0ea1f21f7f2647170057b106d894091 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:14:06 +0000 Subject: [PATCH 01/30] Remove analytics lib and BOLT_DISABLE_ANALYTICS refs --- Gemfile | 3 - developer-docs/analytics.md | 86 ------ lib/bolt/analytics.rb | 240 ----------------- packaging/docker/puppet-bolt/Dockerfile | 1 - spec/fixtures/modules/analytics/plans/init.pp | 5 - spec/unit/analytics_spec.rb | 252 ------------------ 6 files changed, 587 deletions(-) delete mode 100644 developer-docs/analytics.md delete mode 100644 lib/bolt/analytics.rb delete mode 100644 spec/fixtures/modules/analytics/plans/init.pp delete mode 100644 spec/unit/analytics_spec.rb diff --git a/Gemfile b/Gemfile index 59539ed46..1b7e8f97c 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/developer-docs/analytics.md b/developer-docs/analytics.md deleted file mode 100644 index 2c28aed6c..000000000 --- a/developer-docs/analytics.md +++ /dev/null @@ -1,86 +0,0 @@ -# Bolt analytics - -Bolt submits requests to Google Analytics when run, unless analytics are disabled. - -## Submitting analytics requests - -Use the `Bolt::Analytics::Client` instance to submit analytics requests. There -should only be one instance of this class that is passed around for the -lifecycle of the application. Do not create a new instance for your code. - -The client will make a request with a specific tracking id embedded in the -code. That is the Google Analytics project the data will be associated with. - -We only use two kinds of requests: `event` and `screen_view`. - -### Events - -An event is the simplest request in GA. It represents that _something_ happened -and is defined by a `category` and an `action`. It can optionally have a -`label` and a `value`. As a general rule, do not use `value` as GA doesn't -provide useful mechanisms to process it. - -For example: `Plan, call_function, run_task`. This event has a category, an -action and a label. The category tells us that this was some type of Plan -event, the action tells us what the event was, and the label tells us more -detail about what happened. - -Almost all data we collect is in the form of events. - -### Screen views - -We use screen view requests to indicate when a Bolt CLI command is run. We -automatically include a number of custom dimensions describing the environment, -like what kind of project directory is being used, how many nodes and groups -are in the inventory, etc. - -There shouldn't generally be a need to add new screen view requests. - -### Custom dimensions - -Events and screen views can include custom dimensions to collect arbitrary -additional data associated with the request. These fields *must* be defined in -Google Analytics in order to be collected. In the API, the dimensions are named -`cd1`, `cd2`, etc, with `cd` meaning "custom dimension". We automatically -include `cd1` (operating system) with every request. - -Add new custom dimensions from the admin section of GA under the Bolt -"Property". The index of the custom dimension must match the key used in code. - -We generally use the event action and label to specify _what_ happened and -custom dimensions to annotate _how_ it happened. - -## Testing new analytics - -Requests to Google Analytics always return a success code, even if the data is -invalid. Therefore, simply testing that the request succeeded is not sufficient -to verify that the new analytics are working. - -We have a "Bolt Development" project in Google Analytics to use for testing. -Change the tracking id in `analytics.rb` from `[...]-1` to `[...]-2` and your -data will be sent to the development project. Testing against the development -project helps us avoid polluting a new custom dimension before the -implementation is finalized. It also skirts the fact that the main Bolt project -automatically filters out any data sent from a Puppet IP address. - -Bolt's `Gemfile` automatically sets `BOLT_DISABLE_ANALYTICS` so that analytics -won't be sent. To work around that, you can either remove that line of code or -create a `Gemfile.local` (which will be loaded automatically) containing: - -```rb -ENV.delete('BOLT_DISABLE_ANALYTICS') -``` - -That will undo the ENV var and allow analytics to be sent. - -Run Bolt a few times to submit data, and check the "Realtime" tab in the GA -console to ensure your requests are being received. - -You should then use Data Studio to create a chart demonstrating that the new -analytics can actually be used to answer the question they are intended to -answer. You'll need to _wait_ for data to appear. Requests are processed -asynchronously by GA and it can take a while for it to appear in Data Studio, -especially if you've added new custom dimensions. - -Modeling the data in Data Studio before merging the change helps ensure that -the data is being collected in a form that suits the problem it's meant to solve. diff --git a/lib/bolt/analytics.rb b/lib/bolt/analytics.rb deleted file mode 100644 index 4b922d408..000000000 --- a/lib/bolt/analytics.rb +++ /dev/null @@ -1,240 +0,0 @@ -# frozen_string_literal: true - -# None of this currently works, as it's based on Perforce's old GA setup. -# It is functionally disabled here, but the code remains in case we want -# to revive it for Vox Pupuli later. -require_relative '../bolt/util' -require_relative '../bolt/version' -require 'find' -require 'json' -require 'logging' -require 'securerandom' - -module Bolt - module Analytics - PROTOCOL_VERSION = 1 - APPLICATION_NAME = 'bolt' - TRACKING_ID = 'UA-120367942-1' - TRACKING_URL = 'https://google-analytics.com/collect' - CUSTOM_DIMENSIONS = { - operating_system: :cd1, - inventory_nodes: :cd2, - inventory_groups: :cd3, - target_nodes: :cd4, - output_format: :cd5, - statement_count: :cd6, - resource_mean: :cd7, - plan_steps: :cd8, - return_type: :cd9, - inventory_version: :cd10, - boltdir_type: :cd11, - puppet_plan_count: :cd12, - yaml_plan_count: :cd13 - }.freeze - - def self.build_client(enabled = true) - # Remove if we fix this for Vox analytics - config = { 'disabled' => true } - begin - config_file = config_path - config = enabled ? load_config(config_file) : {} - rescue ArgumentError - config = { 'disabled' => true } - end - - if !enabled || config['disabled'] || ENV['BOLT_DISABLE_ANALYTICS'] - # Uncomment if we fix this for Vox analytics - # Bolt::Logger.debug "Analytics opt-out is set, analytics will be disabled" - NoopClient.new - else - unless config.key?('user-id') - config['user-id'] = SecureRandom.uuid - write_config(config_file, config) - end - - Client.new(config['user-id']) - end - rescue StandardError => e - Bolt::Logger.debug "Failed to initialize analytics client, analytics will be disabled: #{e}" - NoopClient.new - end - - def self.config_path - path = File.expand_path(File.join('~', '.puppetlabs', 'etc', 'bolt', 'analytics.yaml')) - old_path = File.expand_path(File.join('~', '.puppetlabs', 'bolt', 'analytics.yaml')) - - if File.exist?(path) - if File.exist?(old_path) - message = "Detected analytics configuration files at '#{old_path}' and '#{path}'. Loading " \ - "analytics configuration from '#{path}'." - Bolt::Logger.warn_once('duplicate_analytics', message) - end - - path - elsif File.exist?(old_path) - old_path - else - path - end - end - - def self.load_config(filename) - if File.exist?(filename) - Bolt::Util.read_optional_yaml_hash(filename, 'analytics') - else - # Remove || true if we fix this for Vox analytics - unless ENV['BOLT_DISABLE_ANALYTICS'] || true - msg = <<~ANALYTICS - Bolt collects data about how you use it. You can opt out of providing this data. - To learn how to disable data collection, or see what data Bolt collects and why, - see http://pup.pt/bolt-analytics - ANALYTICS - Bolt::Logger.warn_once('analytics_opt_out', msg) - end - - {} - end - end - - def self.write_config(filename, config) - FileUtils.mkdir_p(File.dirname(filename)) - File.write(filename, config.to_yaml) - rescue StandardError => e - Bolt::Logger.warn_once('unwriteable_file', "Could not write analytics configuration to #{filename}.") - # This will get caught by build_client and create a NoopClient - raise e - end - - class Client - attr_reader :user_id - attr_accessor :bundled_content - - def initialize(user_id) - # lazy-load expensive gem code - require 'concurrent/configuration' - require 'concurrent/future' - require 'httpclient' - require 'locale' - - @logger = Bolt::Logger.logger(self) - @http = HTTPClient.new - @user_id = user_id - @executor = Concurrent.global_io_executor - @os = compute_os - @bundled_content = {} - end - - def screen_view(screen, **kwargs) - custom_dimensions = Bolt::Util.walk_keys(kwargs) do |k| - CUSTOM_DIMENSIONS[k] || raise("Unknown analytics key '#{k}'") - end - - screen_view_params = { - # Type - t: 'screenview', - # Screen Name - cd: screen - }.merge(custom_dimensions) - - submit(base_params.merge(screen_view_params)) - end - - def report_bundled_content(mode, name) - if bundled_content[mode.split.first]&.include?(name) - event('Bundled Content', mode, label: name) - end - end - - def event(category, action, label: nil, value: nil, **kwargs) - custom_dimensions = Bolt::Util.walk_keys(kwargs) do |k| - CUSTOM_DIMENSIONS[k] || raise("Unknown analytics key '#{k}'") - end - - event_params = { - # Type - t: 'event', - # Event Category - ec: category, - # Event Action - ea: action - }.merge(custom_dimensions) - - # Event Label - event_params[:el] = label if label - # Event Value - event_params[:ev] = value if value - - submit(base_params.merge(event_params)) - end - - def submit(params) - # Handle analytics submission in the background to avoid blocking the - # app or polluting the log with errors - Concurrent::Future.execute(executor: @executor) do - @logger.trace "Submitting analytics: #{JSON.pretty_generate(params)}" - @http.post(TRACKING_URL, params) - @logger.trace "Completed analytics submission" - end - end - - # These parameters have terrible names. See this page for complete documentation: - # https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters - def base_params - { - v: PROTOCOL_VERSION, - # Client ID - cid: @user_id, - # Tracking ID - tid: TRACKING_ID, - # Application Name - an: APPLICATION_NAME, - # Application Version - av: Bolt::VERSION, - # Anonymize IPs - aip: true, - # User locale - ul: Locale.current.to_rfc, - # Custom Dimension 1 (Operating System) - cd1: @os - } - end - - def compute_os - require 'facter' - os = Facter.value('os') - "#{os['name']} #{os.dig('release', 'major')}" - end - - # If the user is running a very fast command, there may not be time for - # analytics submission to complete before the command is finished. In - # that case, we give a little buffer for any stragglers to finish up. - # 250ms strikes a balance between accomodating slower networks while not - # introducing a noticeable "hang". - def finish - @executor.shutdown - @executor.wait_for_termination(0.25) - end - end - - class NoopClient - attr_accessor :bundled_content - - def initialize - @logger = Bolt::Logger.logger(self) - @bundled_content = [] - end - - def screen_view(screen, **_kwargs) - @logger.trace "Skipping submission of '#{screen}' screenview because analytics is disabled" - end - - def report_bundled_content(mode, name); end - - def event(category, action, **_kwargs) - @logger.trace "Skipping submission of '#{category} #{action}' event because analytics is disabled" - end - - def finish; end - end - end -end diff --git a/packaging/docker/puppet-bolt/Dockerfile b/packaging/docker/puppet-bolt/Dockerfile index a72aaa7c7..e8ab26567 100644 --- a/packaging/docker/puppet-bolt/Dockerfile +++ b/packaging/docker/puppet-bolt/Dockerfile @@ -6,7 +6,6 @@ ARG build_date ENV BOLT_VERSION="$version" ENV UBUNTU_CODENAME="jammy" -ENV BOLT_DISABLE_ANALYTICS="true" ENV LANG="C.UTF-8" LABEL org.label-schema.maintainer="Puppet Release Team " \ diff --git a/spec/fixtures/modules/analytics/plans/init.pp b/spec/fixtures/modules/analytics/plans/init.pp deleted file mode 100644 index 7e92fc931..000000000 --- a/spec/fixtures/modules/analytics/plans/init.pp +++ /dev/null @@ -1,5 +0,0 @@ -plan analytics ( $nodes ) { - run_task('service', $nodes, name => "puppet", action => status, _catch_errors => true) - run_task('identity', $nodes, name => "puppet", action => status, _catch_errors => true) - -} diff --git a/spec/unit/analytics_spec.rb b/spec/unit/analytics_spec.rb deleted file mode 100644 index d6d1a19c9..000000000 --- a/spec/unit/analytics_spec.rb +++ /dev/null @@ -1,252 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require 'bolt/analytics' - -describe Bolt::Analytics, skip: 'Analytics is currently disabled' do - let(:default_config) { {} } - - before :each do |test| - # We use a hard override to disable analytics for tests, but that obviously - # interferes with these tests... - ENV.delete('BOLT_DISABLE_ANALYTICS') - - # Ensure these tests will never read or write a local config - allow(subject).to receive(:load_config).and_return(default_config) unless test.metadata[:load_config] - allow(subject).to receive(:write_config) - end - - it 'creates a NoopClient if analytics is disabled in analytics file' do - default_config.replace('disabled' => true) - expect(subject).not_to receive(:write_config) - - expect(subject.build_client).to be_instance_of(Bolt::Analytics::NoopClient) - end - - it 'creates a NoopClient if analytics is disabled in config' do - expect(subject).not_to receive(:write_config) - expect(subject.build_client(false)).to be_instance_of(Bolt::Analytics::NoopClient) - end - - it 'creates a NoopClient if reading config fails' do - allow(File).to receive(:expand_path).and_call_original - allow(File) - .to receive(:expand_path) - .with('~/.puppetlabs/bolt/analytics.yaml') - .and_raise(ArgumentError, "couldn't find login name -- expanding `~'") - expect(subject).not_to receive(:write_config) - - expect(subject.build_client).to be_instance_of(Bolt::Analytics::NoopClient) - end - - it 'creates a regular Client if analytics is not disabled' do - expect(subject.build_client).to be_instance_of(Bolt::Analytics::Client) - end - - it 'uses the uuid in the config if it exists' do - uuid = SecureRandom.uuid - default_config.replace('user-id' => uuid) - - expect(subject.build_client.user_id).to eq(uuid) - end - - it "assigns the user a uuid if one doesn't exist" do - uuid = SecureRandom.uuid - allow(SecureRandom).to receive(:uuid).and_return(uuid) - - expect(subject).to receive(:write_config).with(kind_of(String), include('user-id' => uuid)) - - expect(subject.build_client.user_id).to eq(uuid) - end - - context 'without analytics.yaml' do - before(:each) do - allow(subject).to receive(:load_config).and_call_original - allow(File).to receive(:exist?).and_return(false) - allow(subject).to receive(:write_config) - end - - it 'warns when running with analytics enabled for the first time' do - expect(Bolt::Logger).to receive(:warn_once) do |id, message| - expect(id).to eq('analytics_opt_out') - expect(message).to match(/Bolt collects data about how you use it/) - end - - subject.build_client(true) - end - - it 'does not warn when running with analytics disabled' do - expect(Bolt::Logger).not_to receive(:warn_once) do |id, message| - expect(id).to eq('analytics_opt_out') - expect(message).to match(/Bolt collects data about how you use it/) - end - - subject.build_client(false) - end - end - - context 'config file' do - let(:path) { File.expand_path(File.join('~', '.puppetlabs', 'etc', 'bolt', 'analytics.yaml')) } - let(:old_path) { File.expand_path(File.join('~', '.puppetlabs', 'bolt', 'analytics.yaml')) } - - it 'loads config from user-level config directory' do - allow(File).to receive(:exist?).with(path).and_return(true) - allow(File).to receive(:exist?).with(old_path).and_return(false) - - expect(subject).to receive(:write_config).with(path, anything) - - subject.build_client - end - - it 'falls back to the default project directory' do - allow(File).to receive(:exist?).with(path).and_return(false) - allow(File).to receive(:exist?).with(old_path).and_return(true) - - expect(subject).to receive(:write_config).with(old_path, anything) - - subject.build_client - end - - it 'writes new config to the user-level config directory' do - allow(File).to receive(:exist?).with(path).and_return(false) - allow(File).to receive(:exist?).with(old_path).and_return(false) - - expect(subject).to receive(:write_config).with(path, anything) - - subject.build_client - end - - it 'errors if new config cannot be written' do - allow(subject).to receive(:write_config).and_call_original - allow(File).to receive(:write) - .and_raise(Errno::EACCES, "Permission denied") - - subject.build_client - - expect(@log_output.readlines).to include(/Could not write analytics/) - end - - it 'warns when user-level config and default project config both exist' do - allow(File).to receive(:exist?).with(path).and_return(true) - allow(File).to receive(:exist?).with(old_path).and_return(true) - - expect(subject).to receive(:write_config).with(path, anything) - - subject.build_client - - expect(@log_output.readlines).to include(/Detected analytics configuration files/) - end - - it 'returns an empty hash if config file is empty', :load_config do - Tempfile.create('analytics.yaml', Dir.pwd) do |file| - expect(subject.load_config(file)).to eq({}) - end - end - end -end - -describe Bolt::Analytics::Client do - let(:uuid) { SecureRandom.uuid } - let(:base_params) do - { - v: 1, - an: 'bolt', - av: Bolt::VERSION, - cid: uuid, - tid: 'UA-120367942-1', - ul: Locale.current.to_rfc, - aip: true, - cd1: 'CentOS 7' - } - end - - before :each do - allow_any_instance_of(described_class).to receive(:compute_os).and_return('CentOS 7') - end - - subject { described_class.new(uuid) } - - describe "#screen_view" do - it 'properly formats the screenview' do - params = base_params.merge(t: 'screenview', cd: 'job_run') - - expect(subject).to receive(:submit).with params - - subject.screen_view('job_run') - end - - it 'sets custom dimensions correctly' do - params = base_params.merge(t: 'screenview', cd: 'job_run', cd2: 12, cd3: 17) - - expect(subject).to receive(:submit).with params - - subject.screen_view('job_run', inventory_nodes: 12, inventory_groups: 17) - end - - it 'raises an error if an unknown custom dimension is specified' do - expect { subject.screen_view('job_run', random_field: 'foo') }.to raise_error(/Unknown analytics key/) - end - end - - describe "#report_bundled_content" do - before(:each) { subject.bundled_content = { 'Plan' => ['my_plan'] } } - - it 'reports bundled content' do - expect(subject).to receive(:event).with('Bundled Content', 'Plan', label: 'my_plan') - subject.report_bundled_content('Plan', 'my_plan') - end - - it 'does not report other content' do - expect(subject).not_to receive(:event) - subject.report_bundled_content('Plan', 'other_plan') - end - end - - describe "#event" do - it 'properly formats the event' do - params = base_params.merge(t: 'event', ec: 'run', ea: 'task') - - expect(subject).to receive(:submit).with params - - subject.event('run', 'task') - end - - it 'sends the event label if supplied' do - params = base_params.merge(t: 'event', ec: 'run', ea: 'task', el: 'happy') - - expect(subject).to receive(:submit).with params - - subject.event('run', 'task', label: 'happy') - end - - it 'sends the event metric if supplied' do - params = base_params.merge(t: 'event', ec: 'run', ea: 'task', ev: 12) - - expect(subject).to receive(:submit).with params - - subject.event('run', 'task', value: 12) - end - end -end - -describe Bolt::Analytics::NoopClient do - describe "#screen_view" do - it 'succeeds' do - subject.screen_view('job_run') - end - end - - describe "#event" do - it 'succeeds' do - subject.event('run', 'task') - end - - it 'succeeds with a label' do - subject.event('run', 'task', label: 'happy') - end - - it 'succeeds with a metric' do - subject.event('run', 'task', value: 12) - end - end -end From d66f9c57868690ce4c60e09da09dbae2a06af8b1 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:21:11 +0000 Subject: [PATCH 02/30] Remove analytics reporting from bolt executor --- lib/bolt/executor.rb | 60 -------------------------------------------- 1 file changed, 60 deletions(-) diff --git a/lib/bolt/executor.rb b/lib/bolt/executor.rb index 6e9fc9c79..d07f04cde 100644 --- a/lib/bolt/executor.rb +++ b/lib/bolt/executor.rb @@ -6,7 +6,6 @@ require 'logging' require 'pathname' require 'set' -require_relative '../bolt/analytics' require_relative '../bolt/config' require_relative '../bolt/fiber_executor' require_relative '../bolt/puppetdb' @@ -41,13 +40,11 @@ class Executor attr_accessor :run_as def initialize(concurrency = 1, - analytics = Bolt::Analytics::NoopClient.new, noop = false, modified_concurrency = false, future = {}) # lazy-load expensive gem code require 'concurrent' - @analytics = analytics @logger = Bolt::Logger.logger(self) @transports = Bolt::TRANSPORTS.each_with_object({}) do |(key, val), coll| @@ -61,7 +58,6 @@ def initialize(concurrency = 1, end end end - @reported_transports = Set.new @subscribers = {} @publisher = Concurrent::SingleThreadExecutor.new @publisher.post { Thread.current[:name] = 'event-publisher' } @@ -141,7 +137,6 @@ def queue_execute(targets) targets.group_by(&:transport).flat_map do |protocol, protocol_targets| transport = transport(protocol) - report_transport(transport, protocol_targets.count) transport.batches(protocol_targets).flat_map do |batch| batch_promises = Array(batch).each_with_object({}) do |target, h| h[target] = Concurrent::Promise.new(executor: :immediate) @@ -226,59 +221,6 @@ def log_plan(plan_name) results end - private def report_transport(transport, count) - name = transport.class.name.split('::').last.downcase - unless @reported_transports.include?(name) - @analytics&.event('Transport', 'initialize', label: name, value: count) - end - @reported_transports.add(name) - end - - def report_function_call(function) - @analytics&.event('Plan', 'call_function', label: function) - end - - def report_bundled_content(mode, name) - @analytics.report_bundled_content(mode, name) - end - - def report_file_source(plan_function, source) - label = Pathname.new(source).absolute? ? 'absolute' : 'module' - @analytics&.event('Plan', plan_function, label: label) - end - - def report_noop_mode(noop) - @analytics&.event('Task', 'noop', label: (!!noop).to_s) - end - - def report_apply(statement_count, resource_counts) - data = { statement_count: statement_count } - - unless resource_counts.empty? - sum = resource_counts.inject(0) { |accum, i| accum + i } - # Intentionally rounded to an integer. High precision isn't useful. - data[:resource_mean] = sum / resource_counts.length - end - - @analytics&.event('Apply', 'ast', **data) - end - - def report_yaml_plan(plan) - steps = plan.steps.count - return_type = case plan.return - when Bolt::PAL::YamlPlan::EvaluableString - 'expression' - when nil - nil - else - 'value' - end - - @analytics&.event('Plan', 'yaml', plan_steps: steps, return_type: return_type) - rescue StandardError => e - @logger.trace { "Failed to submit analytics event: #{e.message}" } - end - def with_node_logging(description, batch, log_level = :info) @logger.send(log_level, "#{description} on #{batch.map(&:safe_name)}") publish_event(type: :start_spin) @@ -307,8 +249,6 @@ def run_script(targets, script, arguments, options = {}, position = []) options[:run_as] = run_as if run_as && !options.key?(:run_as) options[:script_interpreter] = (future || {}).fetch('script_interpreter', false) - @analytics&.event('Future', 'script_interpreter', label: options[:script_interpreter].to_s) - batch_execute(targets) do |transport, batch| with_node_logging("Running script #{script} with '#{arguments.to_json}'", batch) do transport.batch_script(batch, script, arguments, options, position, &method(:publish_event)) From 0b6825fa1f3da8ea0046914d1ee502aadcd9c56d Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:33:19 +0000 Subject: [PATCH 03/30] Remove analytics reporting from bolt cli Second-guessed myself and had to double-check a few times that the Bolt::Logger analytics aren't used for anything else, but they seem to just be there for the GA stuff, so :dagger::dagger::dagger: --- lib/bolt/cli.rb | 83 +------------------------------------------------ 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/lib/bolt/cli.rb b/lib/bolt/cli.rb index e1182cc03..01d5579e1 100644 --- a/lib/bolt/cli.rb +++ b/lib/bolt/cli.rb @@ -9,7 +9,6 @@ require 'io/console' require 'logging' require 'optparse' -require_relative '../bolt/analytics' require_relative '../bolt/application' require_relative '../bolt/bolt_option_parser' require_relative '../bolt/config' @@ -371,21 +370,12 @@ def execute(options) @rerun = Bolt::Rerun.new(config.rerunfile, config.save_rerun) - # TODO: Subscribe this to the executor. - analytics = begin - client = Bolt::Analytics.build_client(config.analytics) - client.bundled_content = bundled_content(options) - client - end - Bolt::Logger.configure(config.log, config.color, config.disable_warnings) Bolt::Logger.stream = config.stream - Bolt::Logger.analytics = analytics Bolt::Logger.flush_queue executor = Bolt::Executor.new( config.concurrency, - analytics, options[:noop], config.modified_concurrency, config.future @@ -401,7 +391,7 @@ def execute(options) config.project ) - plugins = Bolt::Plugin.new(config, pal, analytics) + plugins = Bolt::Plugin.new(config, pal) inventory = Bolt::Inventory.from_config(config, plugins) @@ -413,7 +403,6 @@ def execute(options) check_gem_install warn_inventory_overrides_cli(config, options) - submit_screen_view(analytics, config, inventory, options) options[:targets] = process_target_list(plugins, @rerun, options) # TODO: Fix casing issue in Windows. @@ -455,7 +444,6 @@ def execute(options) end application = Bolt::Application.new( - analytics: analytics, config: config, executor: executor, inventory: inventory, @@ -464,8 +452,6 @@ def execute(options) ) process_command(application, command, action, options) - ensure - analytics&.finish end end end @@ -692,28 +678,6 @@ def execute(options) end end - # List content that ships with Bolt. - # - # @param options [Hash] The CLI options. - # - private def bundled_content(options) - # We only need to enumerate bundled content when running a task or plan - content = { 'Plan' => [], - 'Task' => [], - 'Plugin' => Bolt::Plugin::BUILTIN_PLUGINS } - if %w[plan task].include?(options[:subcommand]) && options[:action] == 'run' - default_content = Bolt::PAL.new(Bolt::Config::Modulepath.new([]), nil, nil) - content['Plan'] = default_content.list_plans.each_with_object([]) do |iter, col| - col << iter&.first - end - content['Task'] = default_content.list_tasks.each_with_object([]) do |iter, col| - col << iter&.first - end - end - - content - end - # Check and warn if Bolt is installed as a gem. # private def check_gem_install @@ -776,51 +740,6 @@ def execute(options) Hash[vars.map { |a| a.split('=', 2) }] end - # TODO: See if this can be moved to Bolt::Analytics. - # - # Submit a screen view to the analytics client. - # - # @param analytics [Bolt::Analytics] The analytics client. - # @param config [Bolt::Config] The config. - # @param inventory [Bolt::Inventory] The inventory. - # @param options [Hash] The CLI options. - # - private def submit_screen_view(analytics, config, inventory, options) - screen = "#{options[:subcommand]}_#{options[:action]}" - - if options[:action] == 'show' && options[:object] - screen += '_object' - end - - pp_count, yaml_count = if File.exist?(config.project.plans_path) - %w[pp yaml].map do |extension| - Find.find(config.project.plans_path.to_s) - .grep(/.*\.#{extension}/) - .length - end - else - [0, 0] - end - - screen_view_fields = { - output_format: config.format, - boltdir_type: config.project.type, - puppet_plan_count: pp_count, - yaml_plan_count: yaml_count - } - - if options.key?(:targets) - screen_view_fields.merge!( - target_nodes: options[:targets].count, - inventory_nodes: inventory.node_names.count, - inventory_groups: inventory.group_names.count, - inventory_version: inventory.version - ) - end - - analytics.screen_view(screen, **screen_view_fields) - end - # Issue a deprecation warning if the user is running an unsupported version # of PowerShell on the controller. # From e990895744a650022b00a8a1b15f95ed9a13e1eb Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:37:18 +0000 Subject: [PATCH 04/30] Remove analytics reporting from bolt app More :dagger::dagger::dagger:... --- lib/bolt/application.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/bolt/application.rb b/lib/bolt/application.rb index 672389249..141c9a16f 100644 --- a/lib/bolt/application.rb +++ b/lib/bolt/application.rb @@ -7,18 +7,16 @@ module Bolt class Application - attr_reader :analytics, :config, :executor, :inventory, :logger, :pal, :plugins - private :analytics, :config, :executor, :inventory, :logger, :pal, :plugins + attr_reader :config, :executor, :inventory, :logger, :pal, :plugins + private :config, :executor, :inventory, :logger, :pal, :plugins def initialize( - analytics:, config:, executor:, inventory:, pal:, plugins: ) - @analytics = analytics @config = config @executor = executor @inventory = inventory @@ -163,8 +161,6 @@ def list_guides # def show_guide(topic) if (path = load_guides[topic]) - analytics.event('Guide', 'known_topic', label: topic) - begin guide = Bolt::Util.read_yaml_hash(path, 'guide') rescue SystemCallError => e @@ -179,7 +175,6 @@ def show_guide(topic) Bolt::Util.symbolize_top_level_keys(guide) else - analytics.event('Guide', 'unknown_topic', label: topic) raise Bolt::Error.new( "Unknown topic '#{topic}'. For a list of available topics, run 'bolt guide'.", 'bolt/unknown-topic' From 309386f55a546a6717197c40ad4321754f1ee5c3 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:39:13 +0000 Subject: [PATCH 05/30] Remove analytics from logger & plugin classes --- lib/bolt/logger.rb | 6 ------ lib/bolt/plugin.rb | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/bolt/logger.rb b/lib/bolt/logger.rb index 37b883f59..2184774ad 100644 --- a/lib/bolt/logger.rb +++ b/lib/bolt/logger.rb @@ -106,10 +106,6 @@ def self.logger(name) Logging.logger[name] end - def self.analytics=(analytics) - @analytics = analytics - end - def self.console_layout(color) color_scheme = :bolt if color Logging.layouts.pattern( @@ -242,12 +238,10 @@ def self.flush_queue end private_class_method def self.do_deprecate(msg, id) - @analytics&.event('Warn', 'deprecation', label: id) do_warn(msg, id) end private_class_method def self.do_deprecate_once(msg, id) - @analytics&.event('Warn', 'deprecation', label: id) do_warn_once(msg, id) end end diff --git a/lib/bolt/plugin.rb b/lib/bolt/plugin.rb index 2b6a74f6b..e317c65ab 100644 --- a/lib/bolt/plugin.rb +++ b/lib/bolt/plugin.rb @@ -135,9 +135,8 @@ def boltdir attr_reader :pal, :plugin_context attr_writer :plugin_hooks - def initialize(config, pal, analytics = Bolt::Analytics::NoopClient.new, load_plugins: true) + def initialize(config, pal, load_plugins: true) @config = config - @analytics = analytics @plugin_context = PluginContext.new(config, pal, self) @plugins = {} @pal = pal @@ -227,8 +226,6 @@ def get_hook(plugin_name, hook) raise PluginError::Unknown, plugin_name unless plugin raise PluginError::UnsupportedHook.new(plugin_name, hook) unless plugin.hooks.include?(hook) - @analytics.report_bundled_content("Plugin #{hook}", plugin_name) - plugin.method(hook) end From 79f0b40a2d352a81e91f16fc6b6e910f2e472f19 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:41:33 +0000 Subject: [PATCH 06/30] Remove analytics from config :dagger: --- lib/bolt/config.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/bolt/config.rb b/lib/bolt/config.rb index e0856798c..784009ae4 100644 --- a/lib/bolt/config.rb +++ b/lib/bolt/config.rb @@ -169,7 +169,6 @@ def initialize(project, config_data, overrides = {}) @config_files = [] default_data = { - 'analytics' => false, 'apply-settings' => {}, 'color' => true, 'compile-concurrency' => Etc.nprocessors, @@ -265,8 +264,6 @@ def merge_config_layers(*config_data) # Disabled warnings are concatenated when 'disable-warnings' val1.concat(val2) - when 'analytics' - val1 && val2 # All other values are overwritten else val2 @@ -473,10 +470,6 @@ def disable_warnings Set.new(@project.disable_warnings + @data['disable-warnings']) end - def analytics - @data['analytics'] - end - # Check if there is a case-insensitive match to the path def check_path_case(type, paths) return if paths.nil? From 7ee7d365a69b4bbaa1d78ceeb36ca0345b6038c6 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:43:53 +0000 Subject: [PATCH 07/30] Permanently disable analytics in options :tada: Signed-off-by: Chris Tessmer --- lib/bolt/config/options.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/bolt/config/options.rb b/lib/bolt/config/options.rb index ed59be3d7..e748dfcd8 100644 --- a/lib/bolt/config/options.rb +++ b/lib/bolt/config/options.rb @@ -117,13 +117,6 @@ module Options # Definitions used to validate config options. # https://github.com/puppetlabs/bolt/blob/main/schemas/README.md OPTIONS = { - "analytics" => { - description: "Whether to disable analytics. Setting this option to 'false' in the system-wide " \ - "or user-level configuration will disable analytics for all projects, even if this " \ - "option is set to 'true' at the project level.", - type: [TrueClass, FalseClass], - _example: false - }, "apply-settings" => { description: "A map of Puppet settings to use when applying Puppet code using the `apply` " \ "plan function or the `bolt apply` command.", @@ -626,7 +619,6 @@ module Options # Options that are available in a bolt-defaults.yaml file DEFAULTS_OPTIONS = %w[ - analytics color compile-concurrency concurrency @@ -647,7 +639,6 @@ module Options # Options that are available in a bolt-project.yaml file PROJECT_OPTIONS = %w[ - analytics apply-settings color compile-concurrency From 4efc881b4705be8ea04db02dc5da94ad54db5206 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:46:52 +0000 Subject: [PATCH 08/30] :dagger:: applicator, yaml_plan eval, run Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- lib/bolt/applicator.rb | 18 ------------------ lib/bolt/pal/yaml_plan/evaluator.rb | 3 +-- lib/bolt_spec/run.rb | 16 +++++++--------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/lib/bolt/applicator.rb b/lib/bolt/applicator.rb index 6fe54b58d..8b6f7c692 100644 --- a/lib/bolt/applicator.rb +++ b/lib/bolt/applicator.rb @@ -186,8 +186,6 @@ def apply(args, apply_body, scope) type0 = Puppet.lookup(:pal_script_compiler).type('TargetSpec') Puppet::Pal.assert_type(type0, args[0], 'apply targets') - @executor.report_function_call('apply') - options = {} if args.count > 1 type1 = Puppet.lookup(:pal_script_compiler).type('Hash[String, Data]') @@ -202,18 +200,6 @@ def apply(args, apply_body, scope) apply_ast(apply_body, targets, options, plan_vars) end - # Count the number of top-level statements in the AST. - def count_statements(ast) - case ast - when Puppet::Pops::Model::Program - count_statements(ast.body) - when Puppet::Pops::Model::BlockExpression - ast.statements.count - else - 1 - end - end - def apply_ast(raw_ast, targets, options, plan_vars = {}) ast = Puppet::Pops::Serialization::ToDataConverter.convert(raw_ast, rich_data: true, symbol_to_string: true) # Serialize as pcore for *Result* objects @@ -313,10 +299,6 @@ def apply_ast(raw_ast, targets, options, plan_vars = {}) @executor.await_results(result_promises) end - # Allow for report to exclude event metrics (apply_result doesn't require it to be present) - resource_counts = r.ok_set.map { |result| result.event_metrics&.fetch('total') }.compact - @executor.report_apply(count_statements(raw_ast), resource_counts) - if !r.ok && !options[:catch_errors] raise Bolt::ApplyFailure, r end diff --git a/lib/bolt/pal/yaml_plan/evaluator.rb b/lib/bolt/pal/yaml_plan/evaluator.rb index aaa5f85e3..789cb8d4e 100644 --- a/lib/bolt/pal/yaml_plan/evaluator.rb +++ b/lib/bolt/pal/yaml_plan/evaluator.rb @@ -6,9 +6,8 @@ module Bolt class PAL class YamlPlan class Evaluator - def initialize(analytics = Bolt::Analytics::NoopClient.new) + def initialize @logger = Bolt::Logger.logger(self) - @analytics = analytics @evaluator = Puppet::Pops::Parser::EvaluatingParser.new end diff --git a/lib/bolt_spec/run.rb b/lib/bolt_spec/run.rb index cb34d724a..6a2e9d57a 100644 --- a/lib/bolt_spec/run.rb +++ b/lib/bolt_spec/run.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'bolt/analytics' require 'bolt/config' require 'bolt/executor' require 'bolt/inventory' @@ -159,7 +158,6 @@ def initialize(config_data, inventory_data, project_path) @config_data = config_data || {} @inventory_data = inventory_data || {} @project_path = project_path - @analytics = Bolt::Analytics::NoopClient.new end def config @@ -194,43 +192,43 @@ def resolve_targets(target_spec) # Adapted from CLI def run_task(task_name, targets, params, noop: false) - executor = Bolt::Executor.new(config.concurrency, @analytics, noop) + executor = Bolt::Executor.new(config.concurrency, noop) pal.run_task(task_name, targets, params, executor, inventory, nil) { |_ev| nil } end # Adapted from CLI does not handle nodes or plan_job reporting def run_plan(plan_name, params, noop: false) - executor = Bolt::Executor.new(config.concurrency, @analytics, noop) + executor = Bolt::Executor.new(config.concurrency, noop) pal.run_plan(plan_name, params, executor, inventory, puppetdb_client) end def run_command(command, targets, options) - executor = Bolt::Executor.new(config.concurrency, @analytics) + executor = Bolt::Executor.new(config.concurrency) targets = inventory.get_targets(targets) executor.run_command(targets, command, options) end def run_script(script, targets, arguments, options = {}) - executor = Bolt::Executor.new(config.concurrency, @analytics) + executor = Bolt::Executor.new(config.concurrency) targets = inventory.get_targets(targets) executor.run_script(targets, script, arguments, options) end def download_file(source, dest, targets, options = {}) - executor = Bolt::Executor.new(config.concurrency, @analytics) + executor = Bolt::Executor.new(config.concurrency) targets = inventory.get_targets(targets) executor.download_file(targets, source, dest, options) end def upload_file(source, dest, targets, options = {}) - executor = Bolt::Executor.new(config.concurrency, @analytics) + executor = Bolt::Executor.new(config.concurrency) targets = inventory.get_targets(targets) executor.upload_file(targets, source, dest, options) end def apply_manifest(code, targets, filename = nil, noop = false) ast = pal.parse_manifest(code, filename) - executor = Bolt::Executor.new(config.concurrency, @analytics, noop) + executor = Bolt::Executor.new(config.concurrency, noop) targets = inventory.get_targets(targets) pal.in_plan_compiler(executor, inventory, puppetdb_client) do |compiler| From aa9c2b46039f831fd21251e3e54f505446225a95 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 16:47:57 +0000 Subject: [PATCH 09/30] Remove analytics from inventory, mock_executor Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- lib/bolt/inventory/inventory.rb | 2 -- lib/bolt_spec/plans/mock_executor.rb | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/lib/bolt/inventory/inventory.rb b/lib/bolt/inventory/inventory.rb index bfbe50937..80eba432e 100644 --- a/lib/bolt/inventory/inventory.rb +++ b/lib/bolt/inventory/inventory.rb @@ -92,8 +92,6 @@ def group_names_for(target_name) def target_names groups.all_targets end - # alias for analytics - alias node_names target_names def get_targets(targets, ext_glob: false) target_array = expand_targets(targets, ext_glob: ext_glob) diff --git a/lib/bolt_spec/plans/mock_executor.rb b/lib/bolt_spec/plans/mock_executor.rb index 964ed1345..c4148c92f 100644 --- a/lib/bolt_spec/plans/mock_executor.rb +++ b/lib/bolt_spec/plans/mock_executor.rb @@ -335,18 +335,6 @@ def handle_event(_event); end def prompt(_prompt, _options); end - def report_function_call(_function); end - - def report_bundled_content(_mode, _name); end - - def report_file_source(_plan_function, _source); end - - def report_apply(_statements, _resources); end - - def report_yaml_plan(_plan); end - - def report_noop_mode(_mode); end - def shutdown; end def subscribe(_subscriber, _types = nil); end From 6eab514186f3d7fb847e5446a892404d7343ba08 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 17:08:23 +0000 Subject: [PATCH 10/30] Remove (MANY) analytics from boltlib puppet funcs Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- .../boltlib/lib/puppet/functions/add_facts.rb | 3 --- .../boltlib/lib/puppet/functions/add_to_group.rb | 3 --- .../boltlib/lib/puppet/functions/apply_prep.rb | 2 -- .../boltlib/lib/puppet/functions/background.rb | 1 - .../boltlib/lib/puppet/functions/catch_errors.rb | 4 ---- .../boltlib/lib/puppet/functions/download_file.rb | 3 --- bolt-modules/boltlib/lib/puppet/functions/facts.rb | 4 ---- .../boltlib/lib/puppet/functions/fail_plan.rb | 4 ---- .../boltlib/lib/puppet/functions/get_resources.rb | 3 --- .../boltlib/lib/puppet/functions/get_target.rb | 4 ---- .../boltlib/lib/puppet/functions/get_targets.rb | 4 ---- .../boltlib/lib/puppet/functions/parallelize.rb | 1 - .../lib/puppet/functions/puppetdb_command.rb | 3 --- .../boltlib/lib/puppet/functions/puppetdb_fact.rb | 4 ---- .../boltlib/lib/puppet/functions/puppetdb_query.rb | 4 ---- .../lib/puppet/functions/remove_from_group.rb | 3 --- .../lib/puppet/functions/resolve_references.rb | 4 ---- .../boltlib/lib/puppet/functions/resource.rb | 3 --- .../boltlib/lib/puppet/functions/run_command.rb | 3 --- .../boltlib/lib/puppet/functions/run_container.rb | 2 -- .../boltlib/lib/puppet/functions/run_plan.rb | 13 ------------- .../boltlib/lib/puppet/functions/run_script.rb | 4 ---- .../boltlib/lib/puppet/functions/run_task.rb | 14 -------------- .../boltlib/lib/puppet/functions/run_task_with.rb | 7 ------- .../boltlib/lib/puppet/functions/set_config.rb | 3 --- .../boltlib/lib/puppet/functions/set_feature.rb | 3 --- .../boltlib/lib/puppet/functions/set_resources.rb | 2 -- .../boltlib/lib/puppet/functions/set_var.rb | 3 --- .../boltlib/lib/puppet/functions/upload_file.rb | 4 ---- bolt-modules/boltlib/lib/puppet/functions/vars.rb | 4 ---- bolt-modules/boltlib/lib/puppet/functions/wait.rb | 1 - .../lib/puppet/functions/wait_until_available.rb | 3 --- .../puppet/functions/without_default_logging.rb | 2 -- .../boltlib/lib/puppet/functions/write_file.rb | 2 -- 34 files changed, 127 deletions(-) diff --git a/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb b/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb index 2fc4f3298..a8d3c0bdc 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb b/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb index 01db08c8d..2df59785e 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb b/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb index e7d7fe2f2..697753069 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/background.rb b/bolt-modules/boltlib/lib/puppet/functions/background.rb index 1b6bee569..272e50b0f 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/background.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/background.rb @@ -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| diff --git a/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb b/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb index 9629541af..469459271 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/download_file.rb b/bolt-modules/boltlib/lib/puppet/functions/download_file.rb index 06c7500ca..0fda9ba93 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/download_file.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/download_file.rb @@ -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? diff --git a/bolt-modules/boltlib/lib/puppet/functions/facts.rb b/bolt-modules/boltlib/lib/puppet/functions/facts.rb index 4c6782ffc..c30e9ba21 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/facts.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/facts.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb b/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb index c997d9e93..e52653d26 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb b/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb index 6517a4388..c2d98f5d8 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/get_target.rb b/bolt-modules/boltlib/lib/puppet/functions/get_target.rb index 1870b9114..653b47955 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/get_target.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/get_target.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb b/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb index a5e38f8a4..fc6bfc609 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb b/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb index a349ec26d..5ebc19bde 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb index 9e04a2644..08fe321d6 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb index 1f7ef45db..5a96b99dc 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb index a85f54190..57ee6f893 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb b/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb index 1ae979f4c..15fccb316 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb b/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb index ebd8a5ac2..08dc1fa26 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/resource.rb b/bolt-modules/boltlib/lib/puppet/functions/resource.rb index 16672a74a..5555c43e5 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/resource.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/resource.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_command.rb b/bolt-modules/boltlib/lib/puppet/functions/run_command.rb index 6869eff75..1d7c50dd1 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_command.rb @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_container.rb b/bolt-modules/boltlib/lib/puppet/functions/run_container.rb index 1d6f0a836..a2c71cf89 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_container.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_container.rb @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb b/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb index 1b926c1f0..4eaf47775 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb @@ -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. @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_script.rb b/bolt-modules/boltlib/lib/puppet/functions/run_script.rb index 43e9fe6a4..9494f65df 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_script.rb @@ -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) @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_task.rb b/bolt-modules/boltlib/lib/puppet/functions/run_task.rb index 419426979..89089dafd 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_task.rb @@ -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) @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb b/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb index be3b2ad3b..2b8d3761f 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb @@ -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 } @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/set_config.rb b/bolt-modules/boltlib/lib/puppet/functions/set_config.rb index 3c6997ef0..9d97c7c4f 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/set_config.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/set_config.rb @@ -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 diff --git a/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb b/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb index acb39f0fa..046fb5c69 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb b/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb index 8882c5b0f..ea21c13c3 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb @@ -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| diff --git a/bolt-modules/boltlib/lib/puppet/functions/set_var.rb b/bolt-modules/boltlib/lib/puppet/functions/set_var.rb index 6da253439..f523972e7 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/set_var.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/set_var.rb @@ -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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb b/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb index 6dfd58261..4c97e489d 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb @@ -67,9 +67,6 @@ def upload_file_with_description(scope, source, destination, targets, descriptio 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(source, scope) unless found && Puppet::FileSystem.exist?(found) @@ -77,7 +74,6 @@ def upload_file_with_description(scope, source, destination, targets, descriptio Puppet::Pops::Issues::NO_SUCH_FILE_OR_DIRECTORY, file: source ) end - executor.report_file_source(self.class.name, source) # Ensure that that given targets are all Target instances targets = inventory.get_targets(targets) if targets.empty? diff --git a/bolt-modules/boltlib/lib/puppet/functions/vars.rb b/bolt-modules/boltlib/lib/puppet/functions/vars.rb index ae81b1faa..b9ae1bebc 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/vars.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/vars.rb @@ -19,10 +19,6 @@ def vars(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.vars(target) end diff --git a/bolt-modules/boltlib/lib/puppet/functions/wait.rb b/bolt-modules/boltlib/lib/puppet/functions/wait.rb index 878b03b35..2937318e4 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/wait.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/wait.rb @@ -120,7 +120,6 @@ def inner_wait(futures: nil, timeout: nil, options: {}) valid[:timeout] = timeout if timeout executor = Puppet.lookup(:bolt_executor) - executor.report_function_call(self.class.name) # If we get a single Future, make sure it's an array. If we didn't get any # futures pass that on to wait so we can continue collecting any futures diff --git a/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb b/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb index 091e6c27c..d9738c964 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb @@ -37,9 +37,6 @@ def wait_until_available(targets, options = nil) 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) diff --git a/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb b/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb index c784d72c1..325d07baa 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb @@ -29,8 +29,6 @@ def without_default_logging end executor = Puppet.lookup(:bolt_executor) - # Send Analytics Report - executor.report_function_call(self.class.name) executor.without_default_logging do yield diff --git a/bolt-modules/boltlib/lib/puppet/functions/write_file.rb b/bolt-modules/boltlib/lib/puppet/functions/write_file.rb index afed995f0..04825dd75 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/write_file.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/write_file.rb @@ -32,8 +32,6 @@ def write_file(content, destination, target_spec, options = {}) end executor = Puppet.lookup(:bolt_executor) - # Send Analytics Report - executor.report_function_call(self.class.name) inventory = Puppet.lookup(:bolt_inventory) targets = inventory.get_targets(target_spec) From dd565464128380f7c0628056d6abd68b8d39e036 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 17:09:38 +0000 Subject: [PATCH 11/30] Remove analytics from bolt file module Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/file/lib/puppet/functions/file/delete.rb | 3 --- bolt-modules/file/lib/puppet/functions/file/exists.rb | 4 ---- bolt-modules/file/lib/puppet/functions/file/join.rb | 3 --- bolt-modules/file/lib/puppet/functions/file/read.rb | 5 ----- bolt-modules/file/lib/puppet/functions/file/readable.rb | 4 ---- bolt-modules/file/lib/puppet/functions/file/write.rb | 3 --- 6 files changed, 22 deletions(-) diff --git a/bolt-modules/file/lib/puppet/functions/file/delete.rb b/bolt-modules/file/lib/puppet/functions/file/delete.rb index 919778a22..3021fdccf 100644 --- a/bolt-modules/file/lib/puppet/functions/file/delete.rb +++ b/bolt-modules/file/lib/puppet/functions/file/delete.rb @@ -12,9 +12,6 @@ end def delete(filename) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - File.delete(filename) nil end diff --git a/bolt-modules/file/lib/puppet/functions/file/exists.rb b/bolt-modules/file/lib/puppet/functions/file/exists.rb index d8cb46fd2..a1e05ea1c 100644 --- a/bolt-modules/file/lib/puppet/functions/file/exists.rb +++ b/bolt-modules/file/lib/puppet/functions/file/exists.rb @@ -17,10 +17,6 @@ end def exists(scope, filename) - # Send Analytics Report - executor = Puppet.lookup(:bolt_executor) {} - executor&.report_function_call(self.class.name) - # Find the file path if it exists, otherwise return nil found = Bolt::Util.find_file_from_scope(filename, scope) found ? Puppet::FileSystem.exist?(found) : false diff --git a/bolt-modules/file/lib/puppet/functions/file/join.rb b/bolt-modules/file/lib/puppet/functions/file/join.rb index 3d9e289a0..ee47a844d 100644 --- a/bolt-modules/file/lib/puppet/functions/file/join.rb +++ b/bolt-modules/file/lib/puppet/functions/file/join.rb @@ -12,9 +12,6 @@ end def join(*paths) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - File.join(paths) end end diff --git a/bolt-modules/file/lib/puppet/functions/file/read.rb b/bolt-modules/file/lib/puppet/functions/file/read.rb index 05f06f839..12775c104 100644 --- a/bolt-modules/file/lib/puppet/functions/file/read.rb +++ b/bolt-modules/file/lib/puppet/functions/file/read.rb @@ -16,10 +16,6 @@ end def read(scope, filename) - # Send Analytics Report - executor = Puppet.lookup(:bolt_executor) {} - executor&.report_function_call(self.class.name) - # Find the file path if it exists, otherwise return nil found = Bolt::Util.find_file_from_scope(filename, scope) unless found && Puppet::FileSystem.exist?(found) @@ -27,7 +23,6 @@ def read(scope, filename) Puppet::Pops::Issues::NO_SUCH_FILE_OR_DIRECTORY, file: filename ) end - executor&.report_file_source(self.class.name, filename) File.read(found) end end diff --git a/bolt-modules/file/lib/puppet/functions/file/readable.rb b/bolt-modules/file/lib/puppet/functions/file/readable.rb index 575a97fcf..2122dcc71 100644 --- a/bolt-modules/file/lib/puppet/functions/file/readable.rb +++ b/bolt-modules/file/lib/puppet/functions/file/readable.rb @@ -17,10 +17,6 @@ end def readable(scope, filename) - # Send Analytics Report - executor = Puppet.lookup(:bolt_executor) {} - executor&.report_function_call(self.class.name) - # Find the file path if it exists, otherwise return nil found = Bolt::Util.find_file_from_scope(filename, scope) found ? File.readable?(found) : false diff --git a/bolt-modules/file/lib/puppet/functions/file/write.rb b/bolt-modules/file/lib/puppet/functions/file/write.rb index f4144d86b..34813909d 100644 --- a/bolt-modules/file/lib/puppet/functions/file/write.rb +++ b/bolt-modules/file/lib/puppet/functions/file/write.rb @@ -15,9 +15,6 @@ end def write(filename, content) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - File.write(filename, content) nil end From ec11e1e90b4c7722225c5c8200f4248dcc9a9b76 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 17:10:23 +0000 Subject: [PATCH 12/30] Remove analytics from ctrl, dir, prompt, system Holy cow, they really sent analytics on EVERYTHING, didn't they? This might appreciably speed up execution... :thinking: Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb | 3 --- bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb | 3 --- bolt-modules/dir/lib/puppet/functions/dir/children.rb | 2 -- bolt-modules/prompt/lib/puppet/functions/prompt.rb | 3 --- bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb | 3 --- bolt-modules/system/lib/puppet/functions/system/env.rb | 3 --- 6 files changed, 17 deletions(-) diff --git a/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb b/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb index 96bb554c0..0df861ef1 100644 --- a/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb +++ b/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb @@ -25,9 +25,6 @@ end def do_until(options = {}) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - limit = options['limit'] || 0 interval = options['interval'] diff --git a/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb b/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb index 528710534..33af66d2e 100644 --- a/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb +++ b/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb @@ -11,9 +11,6 @@ end def sleeper(period) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - sleep(period) nil end diff --git a/bolt-modules/dir/lib/puppet/functions/dir/children.rb b/bolt-modules/dir/lib/puppet/functions/dir/children.rb index 699abcc7c..7e64a128a 100644 --- a/bolt-modules/dir/lib/puppet/functions/dir/children.rb +++ b/bolt-modules/dir/lib/puppet/functions/dir/children.rb @@ -17,8 +17,6 @@ end def children(scope, dirname) - # Send Analytics Report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) modname, subpath = dirname.split(File::SEPARATOR, 2) mod_path = scope.compiler.environment.module(modname)&.path diff --git a/bolt-modules/prompt/lib/puppet/functions/prompt.rb b/bolt-modules/prompt/lib/puppet/functions/prompt.rb index 61d9a8c54..8d1cfcf93 100644 --- a/bolt-modules/prompt/lib/puppet/functions/prompt.rb +++ b/bolt-modules/prompt/lib/puppet/functions/prompt.rb @@ -45,9 +45,6 @@ def prompt(prompt, options = {}) options = options.transform_keys(&:to_sym) executor = Puppet.lookup(:bolt_executor) - # Send analytics report - executor.report_function_call(self.class.name) - # Require default to be a string value if options.key?(:default) && !options[:default].is_a?(String) raise Bolt::ValidationError, "Option 'default' must be a string" diff --git a/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb b/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb index 3edc29730..c36761f93 100644 --- a/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb +++ b/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb @@ -57,9 +57,6 @@ def prompt_menu(prompt, menu, options = {}) options = options.transform_keys(&:to_sym) executor = Puppet.lookup(:bolt_executor) - # Send analytics report - executor.report_function_call(self.class.name) - # Error if there are no options if menu.empty? raise Bolt::ValidationError, "Menu cannot be empty" diff --git a/bolt-modules/system/lib/puppet/functions/system/env.rb b/bolt-modules/system/lib/puppet/functions/system/env.rb index 0e0ba90bf..92c46c947 100644 --- a/bolt-modules/system/lib/puppet/functions/system/env.rb +++ b/bolt-modules/system/lib/puppet/functions/system/env.rb @@ -12,9 +12,6 @@ end def env(name) - # Send analytics report - Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) - ENV[name] end end From 9980be21426940f280938f335bc88793e4d5c751 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 17:13:26 +0000 Subject: [PATCH 13/30] Remove analytics from "out" and "log" modules You guys reported **`out`**? _Seriously?!_ There's a certain elegance to logging `log`. Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/log/lib/puppet/functions/log/debug.rb | 1 - bolt-modules/log/lib/puppet/functions/log/error.rb | 1 - bolt-modules/log/lib/puppet/functions/log/fatal.rb | 1 - bolt-modules/log/lib/puppet/functions/log/info.rb | 1 - bolt-modules/log/lib/puppet/functions/log/trace.rb | 1 - bolt-modules/log/lib/puppet/functions/log/warn.rb | 1 - bolt-modules/out/lib/puppet/functions/out/message.rb | 1 - bolt-modules/out/lib/puppet/functions/out/verbose.rb | 1 - 8 files changed, 8 deletions(-) diff --git a/bolt-modules/log/lib/puppet/functions/log/debug.rb b/bolt-modules/log/lib/puppet/functions/log/debug.rb index b63394880..727ad6526 100644 --- a/bolt-modules/log/lib/puppet/functions/log/debug.rb +++ b/bolt-modules/log/lib/puppet/functions/log/debug.rb @@ -30,7 +30,6 @@ def log_debug(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :debug, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/log/lib/puppet/functions/log/error.rb b/bolt-modules/log/lib/puppet/functions/log/error.rb index 8700df970..56b142627 100644 --- a/bolt-modules/log/lib/puppet/functions/log/error.rb +++ b/bolt-modules/log/lib/puppet/functions/log/error.rb @@ -31,7 +31,6 @@ def log_error(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :error, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/log/lib/puppet/functions/log/fatal.rb b/bolt-modules/log/lib/puppet/functions/log/fatal.rb index 1d7f7f676..bba24a99b 100644 --- a/bolt-modules/log/lib/puppet/functions/log/fatal.rb +++ b/bolt-modules/log/lib/puppet/functions/log/fatal.rb @@ -31,7 +31,6 @@ def log_fatal(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :fatal, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/log/lib/puppet/functions/log/info.rb b/bolt-modules/log/lib/puppet/functions/log/info.rb index ffc01dbcb..b790c75fa 100644 --- a/bolt-modules/log/lib/puppet/functions/log/info.rb +++ b/bolt-modules/log/lib/puppet/functions/log/info.rb @@ -30,7 +30,6 @@ def log_info(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :info, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/log/lib/puppet/functions/log/trace.rb b/bolt-modules/log/lib/puppet/functions/log/trace.rb index 5c018c605..0b0fd6332 100644 --- a/bolt-modules/log/lib/puppet/functions/log/trace.rb +++ b/bolt-modules/log/lib/puppet/functions/log/trace.rb @@ -30,7 +30,6 @@ def log_trace(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :trace, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/log/lib/puppet/functions/log/warn.rb b/bolt-modules/log/lib/puppet/functions/log/warn.rb index 8056bbf72..aaf8fd6ac 100644 --- a/bolt-modules/log/lib/puppet/functions/log/warn.rb +++ b/bolt-modules/log/lib/puppet/functions/log/warn.rb @@ -32,7 +32,6 @@ def log_warn(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :log, level: :warn, message: Bolt::Util::Format.stringify(message)) end diff --git a/bolt-modules/out/lib/puppet/functions/out/message.rb b/bolt-modules/out/lib/puppet/functions/out/message.rb index 18627c865..18a1ddff2 100644 --- a/bolt-modules/out/lib/puppet/functions/out/message.rb +++ b/bolt-modules/out/lib/puppet/functions/out/message.rb @@ -27,7 +27,6 @@ def output_message(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :message, message: Bolt::Util::Format.stringify(message), level: :info) end diff --git a/bolt-modules/out/lib/puppet/functions/out/verbose.rb b/bolt-modules/out/lib/puppet/functions/out/verbose.rb index 81695b054..c134d328e 100644 --- a/bolt-modules/out/lib/puppet/functions/out/verbose.rb +++ b/bolt-modules/out/lib/puppet/functions/out/verbose.rb @@ -26,7 +26,6 @@ def output_verbose(message) end Puppet.lookup(:bolt_executor).tap do |executor| - executor.report_function_call(self.class.name) executor.publish_event(type: :verbose, message: Bolt::Util::Format.stringify(message), level: :debug) end From b106be655cd0a9b56abc995c567c787ca7496828 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 18:57:00 +0000 Subject: [PATCH 14/30] Remove analytics cruft from spec_helpers Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/spec_helper.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8755b13d7..536a06fac 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -65,9 +65,6 @@ end config.before :each do - # Disable analytics while running tests - ENV['BOLT_DISABLE_ANALYTICS'] = 'true' - # Ignore local bolt-project.yaml files allow(Bolt::Project).to receive(:create_project) .and_call_original @@ -82,8 +79,7 @@ # Reset logger after every test. config.after :each do - Bolt::Logger.stream = nil - Bolt::Logger.analytics = nil + Bolt::Logger.stream = nil YARD::Registry.clear if defined?(YARD::Registry) end From 9898db648e82886f5d019e80c5c6b45b03043812 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:02:46 +0000 Subject: [PATCH 15/30] Remove analytic unit tests (config,cli) Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/cli_spec.rb | 99 ---------------------------------------- spec/unit/config_spec.rb | 18 -------- 2 files changed, 117 deletions(-) diff --git a/spec/unit/cli_spec.rb b/spec/unit/cli_spec.rb index 9857776f3..18bc356b4 100644 --- a/spec/unit/cli_spec.rb +++ b/spec/unit/cli_spec.rb @@ -22,11 +22,7 @@ # place. allow(Bolt::Logger).to receive(:configure) - # Disable analytics screen view. It doesn't like doubles. :( - allow_any_instance_of(described_class).to receive(:submit_screen_view) - # Stub all the things. - allow(Bolt::Analytics).to receive(:build_client).and_return(analytics) allow(Bolt::Application).to receive(:new).and_return(application) allow(Bolt::Config).to receive(:from_project).and_return(config) allow(Bolt::Executor).to receive(:new).and_return(executor) @@ -44,7 +40,6 @@ # Allow doubles to receive all messages. Messages to doubles will return the # double. # https://relishapp.com/rspec/rspec-mocks/docs/basics/null-object-doubles - let(:analytics) { double('analytics').as_null_object } let(:application) { double('application').as_null_object } let(:config) { double('config').as_null_object } let(:executor) { double('executor').as_null_object } @@ -503,66 +498,6 @@ end end - describe 'analytics' do - before(:each) do - allow(cli).to receive(:submit_screen_view).and_call_original - allow(File).to receive(:exist?).and_return(false) - end - - it 'submits a screen view' do - allow(analytics).to receive(:screen_view) do |screen, fields| - expect(screen).to eq('command_run') - expect(fields).to include( - output_format: anything, - boltdir_type: anything, - puppet_plan_count: anything, - yaml_plan_count: anything - ) - end - - cli.execute({ subcommand: 'command', action: 'run' }) - end - - it 'submits a screen view with inventory information' do - allow(analytics).to receive(:screen_view) do |screen, fields| - expect(screen).to eq('task_run') - expect(fields).to include( - target_nodes: anything, - inventory_nodes: anything, - inventory_groups: anything, - inventory_version: anything - ) - end - - cli.execute({ subcommand: 'task', action: 'run', targets: [] }) - end - - it 'counts Puppet language and YAML plans in the project' do - with_project do |project| - FileUtils.mkdir_p(project.path + 'plans') - FileUtils.touch(project.path + 'plans' + 'puppet.pp') - FileUtils.touch(project.path + 'plans' + 'yaml.yaml') - - allow(config).to receive(:project).and_return(project) - allow(File).to receive(:exist?).and_call_original - - allow(analytics).to receive(:screen_view) do |_screen, fields| - expect(fields).to include( - puppet_plan_count: 1, - yaml_plan_count: 1 - ) - end - - cli.execute({}) - end - end - - it 'completes analytics submission' do - expect(analytics).to receive(:finish) - cli.execute({}) - end - end - describe 'CLI overrides' do let(:options) { { transport: 'ssh' } } @@ -606,40 +541,6 @@ end end - describe 'bundled content' do - before(:each) do - allow(pal).to receive(:list_plans).and_return([%w[plan description]]) - allow(pal).to receive(:list_tasks).and_return([%w[task description]]) - end - - it 'calculates bundled content for a plan' do - expect(analytics).to receive(:bundled_content=) do |content| - expect(content['Plan']).not_to be_empty - expect(content['Task']).not_to be_empty - end - - cli.execute(subcommand: 'plan', action: 'run', object: 'plan') - end - - it 'calculates bundled content for a task' do - expect(analytics).to receive(:bundled_content=) do |content| - expect(content['Plan']).not_to be_empty - expect(content['Task']).not_to be_empty - end - - cli.execute(subcommand: 'task', action: 'run', object: 'task') - end - - it 'does not calculate bundled content for other commands' do - expect(analytics).to receive(:bundled_content=) do |content| - expect(content['Plan']).to be_empty - expect(content['Task']).to be_empty - end - - cli.execute(subcommand: 'command', action: 'run', object: 'command') - end - end - context '--clear-cache' do let(:plan_cache) { 'plan_cache' } let(:plugin_cache) { 'plugin_cache' } diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index 62ce2f4f6..91be52c2e 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -386,24 +386,6 @@ } ) end - - context 'analytics' do - it 'defaults to disabled' do - expect(config.analytics).to eq(false) - end - - it 'overrides a true value with false' do - system_config['analytics'] = true - project_config['analytics'] = false - expect(config.analytics).to eq(false) - end - - it 'does not override a false value' do - system_config['analytics'] = false - project_config['analytics'] = true - expect(config.analytics).to eq(false) - end - end end describe '#modulepath' do From 2749b28f76133921b2581e3f1a27c51386933eb3 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:04:28 +0000 Subject: [PATCH 16/30] Remove analytic unit tests (executor) Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/executor_spec.rb | 66 ++------------------------------------ 1 file changed, 3 insertions(+), 63 deletions(-) diff --git a/spec/unit/executor_spec.rb b/spec/unit/executor_spec.rb index 7d997c395..2484e5023 100644 --- a/spec/unit/executor_spec.rb +++ b/spec/unit/executor_spec.rb @@ -10,8 +10,7 @@ describe "Bolt::Executor" do include BoltSpec::Task - let(:analytics) { Bolt::Analytics::NoopClient.new } - let(:executor) { Bolt::Executor.new(1, analytics).subscribe(collector) } + let(:executor) { Bolt::Executor.new(1).subscribe(collector) } let(:collector) { BoltSpec::EventCollector.new } let(:command) { "hostname" } let(:script) { '/path/to/script.sh' } @@ -617,7 +616,7 @@ def mock_node_results inventory.get_targets(%w[node1 node2 node3]) } - let(:executor) { Bolt::Executor.new(2, analytics) } + let(:executor) { Bolt::Executor.new(2) } it "batch_execute only creates 2 threads" do value = { @@ -692,7 +691,7 @@ def mock_node_results end context 'with modified default concurrency' do - let(:executor) { Bolt::Executor.new(2, analytics, false, true).subscribe(collector) } + let(:executor) { Bolt::Executor.new(2, false, true).subscribe(collector) } let(:collector) { BoltSpec::EventCollector.new } it "doesn't warn if concurrency limit isn't reached" do @@ -715,63 +714,4 @@ def mock_node_results expect(@log_output.readlines).not_to include(/The ulimit is low, which might cause file limit issues/) end end - - context 'reporting analytics data' do - let(:targets) { - inventory.get_targets(['ssh://node1', 'ssh://node2', 'winrm://node3', 'jail://node4']) - } - - it 'reports one event for each transport used' do - expect(analytics).to receive(:event).with('Transport', 'initialize', label: 'ssh', value: 2).once - expect(analytics).to receive(:event).with('Transport', 'initialize', label: 'winrm', value: 1).once - expect(analytics).to receive(:event).with('Transport', 'initialize', label: 'jail', value: 1).once - - executor.batch_execute(targets) {} - executor.batch_execute(targets) {} - end - - context "#report_function_call" do - it 'reports an event for the given function' do - expect(analytics).to receive(:event).with('Plan', 'call_function', label: 'add_facts') - - executor.report_function_call('add_facts') - end - end - - context "#report_bundled_content" do - let(:executor) { Bolt::Executor.new(2, analytics) } - - before :each do - analytics.bundled_content = %w[canary facts] - end - - it 'reports an event when bundled plan is used' do - expect(analytics).to receive(:report_bundled_content).with('Plan', 'canary') - - executor.report_bundled_content('Plan', 'canary') - end - - it 'reports an event when bundled task is used' do - expect(analytics).to receive(:report_bundled_content).with('Task', 'facts') - - executor.report_bundled_content('Task', 'facts') - end - end - - context "#report_file_source" do - let(:executor) { Bolt::Executor.new(2, analytics) } - - it 'reports when a file path is absolute' do - expect(analytics).to receive(:event).with('Plan', 'run_script', label: 'absolute') - - executor.report_file_source('run_script', '/foo/bar') - end - - it 'reports when a file path is module' do - expect(analytics).to receive(:event).with('Plan', 'run_script', label: 'module') - - executor.report_file_source('run_script', 'my_module/my_file') - end - end - end end From efab3b1d251fcb848e89b16a7c973126799039af Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:08:16 +0000 Subject: [PATCH 17/30] Remove analytics unit tests (logger,app) Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/application_spec.rb | 2 -- spec/unit/logger_spec.rb | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index aa211e8c5..fba0aa84b 100644 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -8,7 +8,6 @@ describe Bolt::Application do include BoltSpec::Files - let(:analytics) { double('analytics').as_null_object } let(:config) { double('config').as_null_object } let(:executor) { double('executor').as_null_object } let(:inventory) { double('inventory', get_targets: targets).as_null_object } @@ -18,7 +17,6 @@ let(:application) do described_class.new( - analytics: analytics, config: config, executor: executor, inventory: inventory, diff --git a/spec/unit/logger_spec.rb b/spec/unit/logger_spec.rb index aafcc8ce5..f5cdcc67f 100644 --- a/spec/unit/logger_spec.rb +++ b/spec/unit/logger_spec.rb @@ -39,17 +39,6 @@ def initialize(*args) end end - describe '::deprecate' do - let(:analytics) { Bolt::Analytics::NoopClient.new } - - it 'submits an analytics event' do - allow(Bolt::Logger).to receive(:configured?).and_return(true) - expect(analytics).to receive(:event).with('Warn', 'deprecation', { label: "We've got clearance Clarence" }) - Bolt::Logger.analytics = analytics - Bolt::Logger.deprecate("We've got clearance Clarence", "Roger Roger") - end - end - describe '::configure' do let(:appenders) { { From df62b4ebe6be9abb39f286debe5043ca891c8ef6 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:08:47 +0000 Subject: [PATCH 18/30] Remove analytics unit tests (evaluator) Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/pal/yaml_plan/evaluator_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/unit/pal/yaml_plan/evaluator_spec.rb b/spec/unit/pal/yaml_plan/evaluator_spec.rb index ff0267a9e..b7eb1e09a 100644 --- a/spec/unit/pal/yaml_plan/evaluator_spec.rb +++ b/spec/unit/pal/yaml_plan/evaluator_spec.rb @@ -23,7 +23,6 @@ before :each do # Make sure we don't accidentally call any run functions allow(scope).to receive(:call_function) - allow_any_instance_of(Bolt::Analytics::NoopClient).to receive(:event) end def call_plan(plan, params = {}) From 0be00140bd39ce0012b34766597ab2121f6623b0 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:09:33 +0000 Subject: [PATCH 19/30] Remove analytics cruft from unit tests Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/plugin/module_spec.rb | 1 - spec/unit/plugin/puppet_library_spec.rb | 1 - spec/unit/plugin_spec.rb | 1 - 3 files changed, 3 deletions(-) diff --git a/spec/unit/plugin/module_spec.rb b/spec/unit/plugin/module_spec.rb index 283b3af53..a88526f21 100644 --- a/spec/unit/plugin/module_spec.rb +++ b/spec/unit/plugin/module_spec.rb @@ -4,7 +4,6 @@ require 'bolt_spec/config' require 'bolt_spec/files' require 'bolt/plugin' -require 'bolt/analytics' describe Bolt::Plugin::Module do include BoltSpec::Config diff --git a/spec/unit/plugin/puppet_library_spec.rb b/spec/unit/plugin/puppet_library_spec.rb index 6488b1ea3..8a08714be 100644 --- a/spec/unit/plugin/puppet_library_spec.rb +++ b/spec/unit/plugin/puppet_library_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' require 'bolt_spec/files' require 'bolt/plugin' -require 'bolt/analytics' require 'bolt_spec/plans' describe Bolt::Plugin::Module do diff --git a/spec/unit/plugin_spec.rb b/spec/unit/plugin_spec.rb index f1100c265..fe77f5ee7 100644 --- a/spec/unit/plugin_spec.rb +++ b/spec/unit/plugin_spec.rb @@ -7,7 +7,6 @@ require 'bolt/pal' require 'bolt/plugin' require 'bolt/plugin/env_var' -require 'bolt/analytics' describe Bolt::Plugin do include BoltSpec::Config From 822b4f827c72488720eb05659c8a3d3aeec32463 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:10:43 +0000 Subject: [PATCH 20/30] Remove analytics unit tests Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/integration/modules/write_file_spec.rb | 9 --------- spec/unit/applicator_spec.rb | 1 - 2 files changed, 10 deletions(-) diff --git a/spec/integration/modules/write_file_spec.rb b/spec/integration/modules/write_file_spec.rb index a2460ce5b..01e86c283 100644 --- a/spec/integration/modules/write_file_spec.rb +++ b/spec/integration/modules/write_file_spec.rb @@ -52,15 +52,6 @@ expect(data['value']['stdout']).to match(/#{content}/) end end - - it 'reports multiple function calls to analytics' do - with_tempfile_containing('inventory', YAML.dump(inventory), '.yaml') do |inv| - expect_any_instance_of(Bolt::Executor).to receive(:report_function_call).with('write_file') - expect_any_instance_of(Bolt::Executor).to receive(:report_function_call).with('file::write') - expect_any_instance_of(Bolt::Executor).to receive(:report_function_call).with('upload_file') - run_cli_json(%W[plan run write_file -i #{inv.path} -m #{modulepath}] + params) - end - end end describe 'over ssh', ssh: true do diff --git a/spec/unit/applicator_spec.rb b/spec/unit/applicator_spec.rb index 91f5198be..f1e88e153 100644 --- a/spec/unit/applicator_spec.rb +++ b/spec/unit/applicator_spec.rb @@ -112,7 +112,6 @@ allow(env_loader).to receive(:load).with(:type, 'applyresult').and_return(double('applyresult')) allow(Puppet::Pal).to receive(:assert_type) allow(Puppet::Pops::Serialization::ToDataConverter).to receive(:convert).and_return(ast) - allow(applicator).to receive(:count_statements) end let(:scope) { double('scope') } From ee2afd7776b1a301dc05d5a9be7e311cb7959749 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:21:32 +0000 Subject: [PATCH 21/30] Remove A LOT of boltlib analytics tests Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- .../boltlib/spec/functions/add_facts_spec.rb | 5 ---- .../spec/functions/add_to_group_spec.rb | 5 ---- .../boltlib/spec/functions/apply_prep_spec.rb | 1 - .../boltlib/spec/functions/background_spec.rb | 8 ----- .../spec/functions/catch_errors_spec.rb | 6 ---- .../spec/functions/download_file_spec.rb | 16 ---------- .../boltlib/spec/functions/facts_spec.rb | 5 ---- .../boltlib/spec/functions/fail_plan_spec.rb | 9 ------ .../boltlib/spec/functions/get_target_spec.rb | 5 ---- .../spec/functions/get_targets_spec.rb | 5 ---- .../spec/functions/parallelize_spec.rb | 8 ----- .../spec/functions/puppetdb_command_spec.rb | 6 ---- .../spec/functions/remove_from_group_spec.rb | 5 ---- .../boltlib/spec/functions/resource_spec.rb | 5 ---- .../spec/functions/run_command_spec.rb | 11 ------- .../spec/functions/run_container_spec.rb | 8 ----- .../boltlib/spec/functions/run_plan_spec.rb | 11 ------- .../boltlib/spec/functions/run_script_spec.rb | 12 -------- .../boltlib/spec/functions/run_task_spec.rb | 29 ------------------- .../spec/functions/run_task_with_spec.rb | 16 ---------- .../boltlib/spec/functions/set_config_spec.rb | 5 ---- .../spec/functions/set_feature_spec.rb | 5 ---- .../spec/functions/set_resources_spec.rb | 5 ---- .../boltlib/spec/functions/set_var_spec.rb | 5 ---- .../spec/functions/upload_file_spec.rb | 12 -------- .../boltlib/spec/functions/vars_spec.rb | 5 ---- .../boltlib/spec/functions/wait_spec.rb | 8 ----- 27 files changed, 221 deletions(-) diff --git a/bolt-modules/boltlib/spec/functions/add_facts_spec.rb b/bolt-modules/boltlib/spec/functions/add_facts_spec.rb index f8dfe10eb..767f9cf5e 100644 --- a/bolt-modules/boltlib/spec/functions/add_facts_spec.rb +++ b/bolt-modules/boltlib/spec/functions/add_facts_spec.rb @@ -31,11 +31,6 @@ "'add_facts' parameter 'facts' expects a Hash value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('add_facts') - is_expected.to run.with_params(target, {}) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/add_to_group_spec.rb b/bolt-modules/boltlib/spec/functions/add_to_group_spec.rb index e8d907abd..239fa71ff 100644 --- a/bolt-modules/boltlib/spec/functions/add_to_group_spec.rb +++ b/bolt-modules/boltlib/spec/functions/add_to_group_spec.rb @@ -30,11 +30,6 @@ "'add_to_group' parameter 'group' expects a String value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('add_to_group') - is_expected.to run.with_params(target, group) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/apply_prep_spec.rb b/bolt-modules/boltlib/spec/functions/apply_prep_spec.rb index 0f6871fba..2a097f4b7 100644 --- a/bolt-modules/boltlib/spec/functions/apply_prep_spec.rb +++ b/bolt-modules/boltlib/spec/functions/apply_prep_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'bolt/analytics' require 'bolt/executor' require 'bolt/inventory' require 'bolt/plugin' diff --git a/bolt-modules/boltlib/spec/functions/background_spec.rb b/bolt-modules/boltlib/spec/functions/background_spec.rb index f286fca8c..1d5ec2ae4 100644 --- a/bolt-modules/boltlib/spec/functions/background_spec.rb +++ b/bolt-modules/boltlib/spec/functions/background_spec.rb @@ -21,14 +21,6 @@ Puppet.pop_context end - it 'reports the function call to analytics' do - expect(executor).to receive(:report_function_call).with('background') - - is_expected.to(run - .with_params(name) - .with_lambda { 'a' + 'b' }) - end - it 'returns the PlanFuture the executor creates' do expect(executor).to receive(:create_future) .with(hash_including(scope: anything, name: name)) diff --git a/bolt-modules/boltlib/spec/functions/catch_errors_spec.rb b/bolt-modules/boltlib/spec/functions/catch_errors_spec.rb index 09b965d41..cd42194ca 100644 --- a/bolt-modules/boltlib/spec/functions/catch_errors_spec.rb +++ b/bolt-modules/boltlib/spec/functions/catch_errors_spec.rb @@ -16,12 +16,6 @@ Puppet.pop_context end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('catch_errors') - is_expected.to(run - .with_lambda { 'abcd' }) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/download_file_spec.rb b/bolt-modules/boltlib/spec/functions/download_file_spec.rb index 839e3779b..7487dc434 100644 --- a/bolt-modules/boltlib/spec/functions/download_file_spec.rb +++ b/bolt-modules/boltlib/spec/functions/download_file_spec.rb @@ -180,22 +180,6 @@ .and_return(result_set) end - it 'reports the call to analytics' do - expect(executor).to receive(:download_file) - .with([target], source, project_destination, {}, []) - .and_return(result_set) - - allow(inventory).to receive(:get_targets) - .with(hostname) - .and_return([target]) - - expect(executor).to receive(:report_function_call) - .with('download_file') - - is_expected.to run - .with_params(source, destination, hostname) - .and_return(result_set) - end context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/facts_spec.rb b/bolt-modules/boltlib/spec/functions/facts_spec.rb index 061b0272f..f7f29dbb4 100644 --- a/bolt-modules/boltlib/spec/functions/facts_spec.rb +++ b/bolt-modules/boltlib/spec/functions/facts_spec.rb @@ -22,9 +22,4 @@ it 'should return an empty hash if no facts are set' do is_expected.to run.with_params(target).and_return({}) end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('facts') - is_expected.to run.with_params(target) - end end diff --git a/bolt-modules/boltlib/spec/functions/fail_plan_spec.rb b/bolt-modules/boltlib/spec/functions/fail_plan_spec.rb index 18eeb1768..8d3f78139 100644 --- a/bolt-modules/boltlib/spec/functions/fail_plan_spec.rb +++ b/bolt-modules/boltlib/spec/functions/fail_plan_spec.rb @@ -26,15 +26,6 @@ is_expected.to run.with_params(error).and_raise_error(Bolt::PlanFailure) end - it 'reports the call to analytics' do - executor = Bolt::Executor.new - expect(executor).to receive(:report_function_call).with('fail_plan') - - Puppet.override(bolt_executor: executor) do - is_expected.to run.with_params('foo').and_raise_error(Bolt::PlanFailure) - end - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/get_target_spec.rb b/bolt-modules/boltlib/spec/functions/get_target_spec.rb index 5e4e708be..79308dfe4 100644 --- a/bolt-modules/boltlib/spec/functions/get_target_spec.rb +++ b/bolt-modules/boltlib/spec/functions/get_target_spec.rb @@ -45,10 +45,5 @@ it 'errors on unknown types' do is_expected.to run.with_params(double('anything')).and_raise_error(ArgumentError) end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('get_target') - is_expected.to run.with_params(hostname).and_return(target) - end end end diff --git a/bolt-modules/boltlib/spec/functions/get_targets_spec.rb b/bolt-modules/boltlib/spec/functions/get_targets_spec.rb index f7ba11e67..66f50c715 100644 --- a/bolt-modules/boltlib/spec/functions/get_targets_spec.rb +++ b/bolt-modules/boltlib/spec/functions/get_targets_spec.rb @@ -47,10 +47,5 @@ it 'errors on unknown types' do is_expected.to run.with_params(double('anything')).and_raise_error(ArgumentError) end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('get_targets') - is_expected.to run.with_params(hostname).and_return([target]) - end end end diff --git a/bolt-modules/boltlib/spec/functions/parallelize_spec.rb b/bolt-modules/boltlib/spec/functions/parallelize_spec.rb index ece901949..72e691bdb 100644 --- a/bolt-modules/boltlib/spec/functions/parallelize_spec.rb +++ b/bolt-modules/boltlib/spec/functions/parallelize_spec.rb @@ -26,14 +26,6 @@ Puppet.pop_context end - it 'reports the function call to analytics' do - expect(executor).to receive(:report_function_call).with('parallelize') - - is_expected.to(run - .with_params(array) - .with_lambda { |obj| 'e' + obj }) - end - it 'returns the results from the executor' do is_expected.to(run .with_params(array) diff --git a/bolt-modules/boltlib/spec/functions/puppetdb_command_spec.rb b/bolt-modules/boltlib/spec/functions/puppetdb_command_spec.rb index 66c59090b..fb9c7de14 100644 --- a/bolt-modules/boltlib/spec/functions/puppetdb_command_spec.rb +++ b/bolt-modules/boltlib/spec/functions/puppetdb_command_spec.rb @@ -38,12 +38,6 @@ .and_raise_error(/PuppetDB client .* does not implement :send_command/) end - it 'reports the call to analytics' do - expect(pdb_client).to receive(:send_command).and_return('uuid') - expect(executor).to receive(:report_function_call).with('puppetdb_command') - is_expected.to run.with_params(command, version, payload) - end - context 'without tasks enabled' do let(:tasks) { false } diff --git a/bolt-modules/boltlib/spec/functions/remove_from_group_spec.rb b/bolt-modules/boltlib/spec/functions/remove_from_group_spec.rb index 0332ee4ff..d74e7644b 100644 --- a/bolt-modules/boltlib/spec/functions/remove_from_group_spec.rb +++ b/bolt-modules/boltlib/spec/functions/remove_from_group_spec.rb @@ -38,11 +38,6 @@ "'remove_from_group' parameter 'group' expects a String value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('remove_from_group') - is_expected.to run.with_params(target1, parent) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/resource_spec.rb b/bolt-modules/boltlib/spec/functions/resource_spec.rb index 79bf97fa3..b0800e897 100644 --- a/bolt-modules/boltlib/spec/functions/resource_spec.rb +++ b/bolt-modules/boltlib/spec/functions/resource_spec.rb @@ -30,9 +30,4 @@ is_expected.to run.with_params(*hash.values) .and_return(resource) end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('resource') - is_expected.to run.with_params(target, 'Foo', 'bar') - end end diff --git a/bolt-modules/boltlib/spec/functions/run_command_spec.rb b/bolt-modules/boltlib/spec/functions/run_command_spec.rb index c8d25ab6e..65cfa8b2f 100644 --- a/bolt-modules/boltlib/spec/functions/run_command_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_command_spec.rb @@ -65,17 +65,6 @@ .and_return(result_set) end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('run_command') - expect(executor).to receive(:run_command) - .with([target], command, {}, []) - .and_return(result_set) - expect(inventory).to receive(:get_targets).with(hostname).and_return([target]) - - is_expected.to run - .with_params(command, hostname) - .and_return(result_set) - end context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/run_container_spec.rb b/bolt-modules/boltlib/spec/functions/run_container_spec.rb index 496c2b1b4..55fc892e2 100644 --- a/bolt-modules/boltlib/spec/functions/run_container_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_container_spec.rb @@ -163,14 +163,6 @@ def image end end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('run_container') - - is_expected.to run - .with_params(image, { 'cmd' => 'whoami', 'rm' => true }) - .and_return(result) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/run_plan_spec.rb b/bolt-modules/boltlib/spec/functions/run_plan_spec.rb index 0e40d164d..3af9d1c14 100644 --- a/bolt-modules/boltlib/spec/functions/run_plan_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_plan_spec.rb @@ -58,17 +58,6 @@ end end - it 'reports the function call to analytics' do - expect(executor).to receive(:report_function_call).with('run_plan') - expect(executor).to receive(:report_bundled_content).with('Plan', 'test::run_me').once - is_expected.to run.with_params('test::run_me').and_return('worked2') - end - - it 'skips reporting the function call to analytics if called internally from Bolt' do - expect(executor).not_to receive(:report_function_call) - is_expected.to run.with_params('test::run_me', '_bolt_api_call' => true).and_return('worked2') - end - context 'using the name of the module' do it 'the plans/init.pp is found and called' do is_expected.to run.with_params('test').and_return('worked4') diff --git a/bolt-modules/boltlib/spec/functions/run_script_spec.rb b/bolt-modules/boltlib/spec/functions/run_script_spec.rb index 8338dd1c2..c07c7eb52 100644 --- a/bolt-modules/boltlib/spec/functions/run_script_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_script_spec.rb @@ -188,18 +188,6 @@ .and_return(result_set) end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('run_script') - expect(executor).to receive(:run_script) - .with([target], full_path, [], {}, []) - .and_return(result_set) - expect(inventory).to receive(:get_targets).with(hostname).and_return([target]) - - is_expected.to run - .with_params('test/uploads/hostname.sh', hostname) - .and_return(result_set) - end - context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/run_task_spec.rb b/bolt-modules/boltlib/spec/functions/run_task_spec.rb index d6568e0e8..eea711ee0 100644 --- a/bolt-modules/boltlib/spec/functions/run_task_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_task_spec.rb @@ -173,35 +173,6 @@ def mock_task(executable, input_method) .and_return(Bolt::ResultSet.new([])) end - it 'reports the function call and task name to analytics' do - expect(executor).to receive(:report_function_call).with('run_task') - expect(executor).to receive(:report_bundled_content).with('Task', 'Test::Echo').once - executable = File.join(tasks_root, 'echo.sh') - - expect(executor).to receive(:run_task) - .with([target], mock_task(executable, nil), default_args, {}, []) - .and_return(result_set) - expect(inventory).to receive(:get_targets).with(hostname).and_return([target]) - - is_expected.to run - .with_params('Test::Echo', hostname, default_args) - .and_return(result_set) - end - - it 'skips reporting the function call to analytics if called internally from Bolt' do - expect(executor).not_to receive(:report_function_call).with('run_task') - executable = File.join(tasks_root, 'echo.sh') - - expect(executor).to receive(:run_task) - .with([target], mock_task(executable, nil), default_args, kind_of(Hash), []) - .and_return(result_set) - expect(inventory).to receive(:get_targets).with(hostname).and_return([target]) - - is_expected.to run - .with_params('Test::Echo', hostname, default_args.merge('_bolt_api_call' => true)) - .and_return(result_set) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/run_task_with_spec.rb b/bolt-modules/boltlib/spec/functions/run_task_with_spec.rb index b492e7909..980205881 100644 --- a/bolt-modules/boltlib/spec/functions/run_task_with_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_task_with_spec.rb @@ -186,22 +186,6 @@ def mock_task(executable, input_method) .and_return(Bolt::ResultSet.new([]))) end - it 'reports the function call and task name to analytics' do - expect(executor).to receive(:report_function_call).with('run_task_with') - expect(executor).to receive(:report_bundled_content).with('Task', 'Test::Echo').once - executable = File.join(tasks_root, 'echo.sh') - - expect(executor).to receive(:run_task_with) - .with(target_mapping, mock_task(executable, nil), {}, []) - .and_return(result_set) - expect(inventory).to receive(:get_targets).with(hosts).and_return(targets) - - is_expected.to(run - .with_params('Test::Echo', hosts) - .with_lambda { |_| task_params } - .and_return(result_set)) - end - context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/set_config_spec.rb b/bolt-modules/boltlib/spec/functions/set_config_spec.rb index ae6d54ed1..78892d2c4 100644 --- a/bolt-modules/boltlib/spec/functions/set_config_spec.rb +++ b/bolt-modules/boltlib/spec/functions/set_config_spec.rb @@ -43,9 +43,4 @@ .and_raise_error(ArgumentError, /'set_config' parameter 'key_or_key_path' expects a value of type String/) end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('set_config') - is_expected.to run.with_params(target, 'a', 'b').and_return(target) - end end diff --git a/bolt-modules/boltlib/spec/functions/set_feature_spec.rb b/bolt-modules/boltlib/spec/functions/set_feature_spec.rb index 5dfd40c23..c6e961697 100644 --- a/bolt-modules/boltlib/spec/functions/set_feature_spec.rb +++ b/bolt-modules/boltlib/spec/functions/set_feature_spec.rb @@ -31,11 +31,6 @@ "'set_feature' parameter 'feature' expects a String value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('set_feature') - is_expected.to run.with_params(target, feature, true).and_return(target) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/set_resources_spec.rb b/bolt-modules/boltlib/spec/functions/set_resources_spec.rb index 8ea59844c..c2d4a5d89 100644 --- a/bolt-modules/boltlib/spec/functions/set_resources_spec.rb +++ b/bolt-modules/boltlib/spec/functions/set_resources_spec.rb @@ -92,11 +92,6 @@ is_expected.to run.with_params(target, resource).and_return([resource]) end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('set_resources') - is_expected.to run.with_params(target, resource).and_return([resource]) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/set_var_spec.rb b/bolt-modules/boltlib/spec/functions/set_var_spec.rb index 291325c35..6351c31fc 100644 --- a/bolt-modules/boltlib/spec/functions/set_var_spec.rb +++ b/bolt-modules/boltlib/spec/functions/set_var_spec.rb @@ -30,11 +30,6 @@ "'set_var' parameter 'key' expects a String value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('set_var') - is_expected.to run.with_params(target, 'a', 'b').and_return(target) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/boltlib/spec/functions/upload_file_spec.rb b/bolt-modules/boltlib/spec/functions/upload_file_spec.rb index f1bf0bae7..2d432fb92 100644 --- a/bolt-modules/boltlib/spec/functions/upload_file_spec.rb +++ b/bolt-modules/boltlib/spec/functions/upload_file_spec.rb @@ -166,18 +166,6 @@ .and_return(result_set) end - it 'reports the call to analytics' do - expect(executor).to receive(:upload_file) - .with([target], full_path, destination, {}, []) - .and_return(result_set) - allow(inventory).to receive(:get_targets).with(hostname).and_return([target]) - expect(executor).to receive(:report_function_call).with('upload_file') - - is_expected.to run - .with_params('test/uploads/index.html', destination, hostname) - .and_return(result_set) - end - context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/vars_spec.rb b/bolt-modules/boltlib/spec/functions/vars_spec.rb index ef8c9301a..da9a3ea5a 100644 --- a/bolt-modules/boltlib/spec/functions/vars_spec.rb +++ b/bolt-modules/boltlib/spec/functions/vars_spec.rb @@ -27,9 +27,4 @@ inventory.set_var(target, 'a' => 'b') is_expected.to run.with_params(target).and_return('a' => 'b') end - - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('vars') - is_expected.to run.with_params(target).and_return({}) - end end diff --git a/bolt-modules/boltlib/spec/functions/wait_spec.rb b/bolt-modules/boltlib/spec/functions/wait_spec.rb index 9e0795e11..9805f6206 100644 --- a/bolt-modules/boltlib/spec/functions/wait_spec.rb +++ b/bolt-modules/boltlib/spec/functions/wait_spec.rb @@ -23,14 +23,6 @@ Puppet.pop_context end - it 'reports the function call to analytics' do - expect(executor).to receive(:report_function_call).with('wait') - expect(executor).to receive(:wait).with([future]).and_return(result) - - is_expected.to(run - .with_params(future)) - end - context 'with no futures' do it "passes 'nil' to the executor" do expect(executor).to receive(:wait).with(nil).and_return(result) From 2d6ab732ccb6c0f146d8fad852a7216f33ad706e Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:23:51 +0000 Subject: [PATCH 22/30] Update file:: function tests with new args sig Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/file/spec/functions/file/exists_spec.rb | 8 +------- bolt-modules/file/spec/functions/file/join_spec.rb | 5 ----- bolt-modules/file/spec/functions/file/read_spec.rb | 7 +------ bolt-modules/file/spec/functions/file/readable_spec.rb | 7 +------ 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/bolt-modules/file/spec/functions/file/exists_spec.rb b/bolt-modules/file/spec/functions/file/exists_spec.rb index 823cdca95..b48d4cac6 100644 --- a/bolt-modules/file/spec/functions/file/exists_spec.rb +++ b/bolt-modules/file/spec/functions/file/exists_spec.rb @@ -64,13 +64,7 @@ end context "with an executor" do - # *Why* didn't we use kwargs - let(:executor) { - Bolt::Executor.new(1, - Bolt::Analytics::NoopClient.new, - false, - false) - } + let(:executor) { Bolt::Executor.new(1, false, false) } include_examples 'file loading' end diff --git a/bolt-modules/file/spec/functions/file/join_spec.rb b/bolt-modules/file/spec/functions/file/join_spec.rb index a13ae0785..5f9fa1c45 100644 --- a/bolt-modules/file/spec/functions/file/join_spec.rb +++ b/bolt-modules/file/spec/functions/file/join_spec.rb @@ -18,9 +18,4 @@ it 'joins file paths' do is_expected.to run.with_params('foo', 'bar', 'bak').and_return('foo/bar/bak') end - - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('file::join') - is_expected.to run.with_params('foo', 'bar', 'bak') - end end diff --git a/bolt-modules/file/spec/functions/file/read_spec.rb b/bolt-modules/file/spec/functions/file/read_spec.rb index c4bc78ed1..b6f08a967 100644 --- a/bolt-modules/file/spec/functions/file/read_spec.rb +++ b/bolt-modules/file/spec/functions/file/read_spec.rb @@ -65,12 +65,7 @@ end context "with an executor" do - let(:executor) { - Bolt::Executor.new(1, - Bolt::Analytics::NoopClient.new, - false, - false) - } + let(:executor) { Bolt::Executor.new(1, false, false) } include_examples 'file loading' end diff --git a/bolt-modules/file/spec/functions/file/readable_spec.rb b/bolt-modules/file/spec/functions/file/readable_spec.rb index c1efb79b5..72ea694d9 100644 --- a/bolt-modules/file/spec/functions/file/readable_spec.rb +++ b/bolt-modules/file/spec/functions/file/readable_spec.rb @@ -64,12 +64,7 @@ end context "with an executor" do - let(:executor) { - Bolt::Executor.new(1, - Bolt::Analytics::NoopClient.new, - false, - false) - } + let(:executor) { Bolt::Executor.new(1, false, false) } include_examples 'file loading' end From fa693a17846f12758918ae9166a1bf3b6ac422ab Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:27:50 +0000 Subject: [PATCH 23/30] Remove analytics cruft from log:: function tests Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/log/spec/functions/log/debug_spec.rb | 7 +------ bolt-modules/log/spec/functions/log/error_spec.rb | 7 +------ bolt-modules/log/spec/functions/log/fatal_spec.rb | 7 +------ bolt-modules/log/spec/functions/log/info_spec.rb | 7 +------ bolt-modules/log/spec/functions/log/trace_spec.rb | 7 +------ bolt-modules/log/spec/functions/log/warn_spec.rb | 7 +------ 6 files changed, 6 insertions(+), 36 deletions(-) diff --git a/bolt-modules/log/spec/functions/log/debug_spec.rb b/bolt-modules/log/spec/functions/log/debug_spec.rb index db41f3e9d..23df1f419 100644 --- a/bolt-modules/log/spec/functions/log/debug_spec.rb +++ b/bolt-modules/log/spec/functions/log/debug_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::debug' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a debug message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::debug') - is_expected.to run.with_params('This is a debug message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/log/spec/functions/log/error_spec.rb b/bolt-modules/log/spec/functions/log/error_spec.rb index 370f0fd35..82d1226b3 100644 --- a/bolt-modules/log/spec/functions/log/error_spec.rb +++ b/bolt-modules/log/spec/functions/log/error_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::error' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is an error message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::error') - is_expected.to run.with_params('This is an error message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/log/spec/functions/log/fatal_spec.rb b/bolt-modules/log/spec/functions/log/fatal_spec.rb index ec0f13575..2131fb3ce 100644 --- a/bolt-modules/log/spec/functions/log/fatal_spec.rb +++ b/bolt-modules/log/spec/functions/log/fatal_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::fatal' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a fatal message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::fatal') - is_expected.to run.with_params('This is a fatal message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/log/spec/functions/log/info_spec.rb b/bolt-modules/log/spec/functions/log/info_spec.rb index 6f73b5128..eac68a025 100644 --- a/bolt-modules/log/spec/functions/log/info_spec.rb +++ b/bolt-modules/log/spec/functions/log/info_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::info' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is an info message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::info') - is_expected.to run.with_params('This is an info message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/log/spec/functions/log/trace_spec.rb b/bolt-modules/log/spec/functions/log/trace_spec.rb index 9e810c33a..b7d7bd2c1 100644 --- a/bolt-modules/log/spec/functions/log/trace_spec.rb +++ b/bolt-modules/log/spec/functions/log/trace_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::trace' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a trace message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::trace') - is_expected.to run.with_params('This is a trace message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/log/spec/functions/log/warn_spec.rb b/bolt-modules/log/spec/functions/log/warn_spec.rb index 6b65213cf..07d93c6c1 100644 --- a/bolt-modules/log/spec/functions/log/warn_spec.rb +++ b/bolt-modules/log/spec/functions/log/warn_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'log::warn' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a warn message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('log::warn') - is_expected.to run.with_params('This is a warn message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } From 203b9d0927bfb88706cb0dc9836a8902fb398b5a Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:31:08 +0000 Subject: [PATCH 24/30] :do_not_litter: Clean out:: and prompt tests Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/out/spec/functions/out/message_spec.rb | 7 +------ bolt-modules/out/spec/functions/out/verbose_spec.rb | 7 +------ bolt-modules/prompt/spec/functions/prompt/menu_spec.rb | 6 ------ bolt-modules/prompt/spec/functions/prompt_spec.rb | 6 ------ 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/bolt-modules/out/spec/functions/out/message_spec.rb b/bolt-modules/out/spec/functions/out/message_spec.rb index 43f33a8b9..3059c86a6 100644 --- a/bolt-modules/out/spec/functions/out/message_spec.rb +++ b/bolt-modules/out/spec/functions/out/message_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'out::message' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('out::message') - is_expected.to run.with_params('This is a message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/out/spec/functions/out/verbose_spec.rb b/bolt-modules/out/spec/functions/out/verbose_spec.rb index 1da12a2a3..2c85dc5c8 100644 --- a/bolt-modules/out/spec/functions/out/verbose_spec.rb +++ b/bolt-modules/out/spec/functions/out/verbose_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'out::verbose' do - let(:executor) { double('executor', report_function_call: nil, publish_event: nil) } + let(:executor) { double('executor', publish_event: nil) } let(:tasks_enabled) { true } before(:each) do @@ -26,11 +26,6 @@ is_expected.to run.with_params('This is a message') end - it 'reports function call to analytics' do - expect(executor).to receive(:report_function_call).with('out::verbose') - is_expected.to run.with_params('This is a message') - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/prompt/spec/functions/prompt/menu_spec.rb b/bolt-modules/prompt/spec/functions/prompt/menu_spec.rb index a9aaae73a..47fb80249 100644 --- a/bolt-modules/prompt/spec/functions/prompt/menu_spec.rb +++ b/bolt-modules/prompt/spec/functions/prompt/menu_spec.rb @@ -77,12 +77,6 @@ .and_raise_error(/Default value 'durian' is not one of the provided menu options/) end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('prompt::menu') - expect(executor).to receive(:prompt).with("(1) apple\nSelect a fruit", {}).and_return('1') - is_expected.to run.with_params('Select a fruit', ['apple']) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } diff --git a/bolt-modules/prompt/spec/functions/prompt_spec.rb b/bolt-modules/prompt/spec/functions/prompt_spec.rb index 754153aad..e2407a82a 100644 --- a/bolt-modules/prompt/spec/functions/prompt_spec.rb +++ b/bolt-modules/prompt/spec/functions/prompt_spec.rb @@ -52,12 +52,6 @@ "'prompt' parameter 'prompt' expects a String value, got Integer") end - it 'reports the call to analytics' do - expect(executor).to receive(:report_function_call).with('prompt') - expect(executor).to receive(:prompt).with(prompt, {}).and_return(response) - is_expected.to run.with_params(prompt) - end - context 'without tasks enabled' do let(:tasks_enabled) { false } From 0b39a211f2c31cd1698f66d67388bddabf6e8144 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:32:48 +0000 Subject: [PATCH 25/30] Rid schemas of refs to analytics Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- schemas/bolt-defaults.schema.json | 7 ------- schemas/bolt-project.schema.json | 7 ------- 2 files changed, 14 deletions(-) diff --git a/schemas/bolt-defaults.schema.json b/schemas/bolt-defaults.schema.json index 27aeabd10..505c52d4a 100644 --- a/schemas/bolt-defaults.schema.json +++ b/schemas/bolt-defaults.schema.json @@ -4,9 +4,6 @@ "description": "Bolt Defaults bolt-defaults.yaml Schema", "type": "object", "properties": { - "analytics": { - "$ref": "#/definitions/analytics" - }, "color": { "$ref": "#/definitions/color" }, @@ -57,10 +54,6 @@ } }, "definitions": { - "analytics": { - "description": "Whether to disable analytics. Setting this option to 'false' in the system-wide or user-level configuration will disable analytics for all projects, even if this option is set to 'true' at the project level.", - "type": "boolean" - }, "color": { "description": "Whether to use colored output when printing messages to the console.", "type": "boolean" diff --git a/schemas/bolt-project.schema.json b/schemas/bolt-project.schema.json index d65c33b33..359e05f9f 100644 --- a/schemas/bolt-project.schema.json +++ b/schemas/bolt-project.schema.json @@ -4,9 +4,6 @@ "description": "Bolt Project bolt-project.yaml Schema", "type": "object", "properties": { - "analytics": { - "$ref": "#/definitions/analytics" - }, "apply-settings": { "$ref": "#/definitions/apply-settings" }, @@ -87,10 +84,6 @@ } }, "definitions": { - "analytics": { - "description": "Whether to disable analytics. Setting this option to 'false' in the system-wide or user-level configuration will disable analytics for all projects, even if this option is set to 'true' at the project level.", - "type": "boolean" - }, "apply-settings": { "description": "A map of Puppet settings to use when applying Puppet code using the `apply` plan function or the `bolt apply` command.", "type": "object", From 1a4b3b98930f2762084de1df9932287056d03c8e Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:38:48 +0000 Subject: [PATCH 26/30] The (still-puppetlabsy) docker has spec tests?! Removed analytics cruft from there, too Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- packaging/docker/puppet-bolt/spec/dockerfile_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packaging/docker/puppet-bolt/spec/dockerfile_spec.rb b/packaging/docker/puppet-bolt/spec/dockerfile_spec.rb index 190bb2e66..a61964428 100644 --- a/packaging/docker/puppet-bolt/spec/dockerfile_spec.rb +++ b/packaging/docker/puppet-bolt/spec/dockerfile_spec.rb @@ -30,12 +30,6 @@ teardown_container(container) end - it 'should run a bolt command and analytics should be disabled' do - result = run_command("docker run -i #{@image} command run whoami -t localhost --log-level debug 2>&1") - expect(result[:stdout]).to match(/root/) - expect(result[:stdout]).to match(/Analytics opt-out is set, analytics will be disabled/) - end - it 'should support logging UTF-8 characters' do result = run_command("docker run -i #{@image} command run 'echo Hello! 😆' -t localhost --log-level debug 2>&1") expect(result[:stdout]).to match(/Hello! 😆/) From 0dabf37c193d69ba48b6beee584282647110fc85 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:40:08 +0000 Subject: [PATCH 27/30] Remove analytics file from acceptance test Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb b/acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb index 1e16d80ad..1e5063431 100644 --- a/acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb +++ b/acceptance/setup/common/pre-suite/050_build_bolt_inventory.rb @@ -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 From ff645c51cd2e501072bfca46a1d776ffe2a941df Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:42:07 +0000 Subject: [PATCH 28/30] rm analytics.cruft It's probably silly to remove references from a generated file, but a) it's checked in and b) I _really_ want "grep -r analytics" to stop showing it Signed-off-by: Chris Tessmer --- .rubocop_todo.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d7f7aca5b..fbbfe71f4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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: @@ -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 @@ -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' @@ -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 @@ -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 From f028e7564e8f80a761493f1a9199279b0eac5fdd Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 19:59:11 +0000 Subject: [PATCH 29/30] Tidy up for Rubocop Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- bolt-modules/boltlib/spec/functions/download_file_spec.rb | 1 - bolt-modules/boltlib/spec/functions/run_command_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/bolt-modules/boltlib/spec/functions/download_file_spec.rb b/bolt-modules/boltlib/spec/functions/download_file_spec.rb index 7487dc434..731420e66 100644 --- a/bolt-modules/boltlib/spec/functions/download_file_spec.rb +++ b/bolt-modules/boltlib/spec/functions/download_file_spec.rb @@ -180,7 +180,6 @@ .and_return(result_set) end - context 'with description' do let(:message) { 'test message' } diff --git a/bolt-modules/boltlib/spec/functions/run_command_spec.rb b/bolt-modules/boltlib/spec/functions/run_command_spec.rb index 65cfa8b2f..82e9e9032 100644 --- a/bolt-modules/boltlib/spec/functions/run_command_spec.rb +++ b/bolt-modules/boltlib/spec/functions/run_command_spec.rb @@ -65,7 +65,6 @@ .and_return(result_set) end - context 'with description' do let(:message) { 'test message' } From e384c806d26fdf880bb6c951a52bf378e720a4e0 Mon Sep 17 00:00:00 2001 From: Chris Tessmer Date: Tue, 30 Jun 2026 22:40:07 +0000 Subject: [PATCH 30/30] Add (previously) missing mocks Tests used short-circuit before getting here Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer --- spec/unit/applicator_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/unit/applicator_spec.rb b/spec/unit/applicator_spec.rb index f1e88e153..59ec1e88a 100644 --- a/spec/unit/applicator_spec.rb +++ b/spec/unit/applicator_spec.rb @@ -123,6 +123,7 @@ allow(mock_logger).to receive(:level=).with(any_args) allow(mock_logger).to receive(:debug).with(any_args) allow(mock_logger).to receive(:trace).with(any_args) + allow(mock_logger).to receive(:info).with(any_args) end let(:mock_logger) { instance_double("Logging.logger") } @@ -150,6 +151,8 @@ allow(mock_logger).to receive(:[]).and_return(mock_logger) allow(mock_logger).to receive(:level=).with(any_args) allow(mock_logger).to receive(:debug).with(any_args) + allow(mock_logger).to receive(:info).with(any_args) + allow(mock_logger).to receive(:trace).with(any_args) end let(:mock_logger) { instance_double("Logging.logger") }