From 0925e74847756a65f95e790b1269d2be595be441 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 21 Nov 2025 12:11:00 -0800 Subject: [PATCH] Remove warning when using the plain gem We want to support this use case, so remove the warning. --- Gemfile | 3 --- lib/bolt/cli.rb | 18 ------------------ spec/unit/cli_spec.rb | 18 ------------------ 3 files changed, 39 deletions(-) diff --git a/Gemfile b/Gemfile index 58da7bd6f..c939bebd2 100644 --- a/Gemfile +++ b/Gemfile @@ -5,9 +5,6 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' # 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' - gemspec # Optional paint gem for rainbow outputter diff --git a/lib/bolt/cli.rb b/lib/bolt/cli.rb index add9e3314..8888848cd 100644 --- a/lib/bolt/cli.rb +++ b/lib/bolt/cli.rb @@ -411,7 +411,6 @@ def execute(options) # FINALIZING SETUP # - check_gem_install warn_inventory_overrides_cli(config, options) submit_screen_view(analytics, config, inventory, options) options[:targets] = process_target_list(plugins, @rerun, options) @@ -714,23 +713,6 @@ def execute(options) content end - # Check and warn if Bolt is installed as a gem. - # - private def check_gem_install - if ENV['BOLT_GEM'].nil? && incomplete_install? - msg = <<~MSG.chomp - Bolt might be installed as a gem. To use Bolt reliably and with all of its - dependencies, uninstall the 'bolt' gem and install Bolt as a package: - https://puppet.com/docs/bolt/latest/bolt_installing.html - - If you meant to install Bolt as a gem and want to disable this warning, - set the BOLT_GEM environment variable. - MSG - - Bolt::Logger.warn("gem_install", msg) - end - end - # Print a fatal error. Print using the outputter if it's configured. # Otherwise, mock the output by printing directly to stdout. # diff --git a/spec/unit/cli_spec.rb b/spec/unit/cli_spec.rb index 9857776f3..2358daddf 100644 --- a/spec/unit/cli_spec.rb +++ b/spec/unit/cli_spec.rb @@ -485,24 +485,6 @@ end end - describe 'checking for gem install' do - it 'displays a warning when Bolt is installed as a gem' do - with_env_vars('BOLT_GEM' => nil) do - allow(cli).to receive(:incomplete_install?).and_return(true) - expect(Bolt::Logger).to receive(:warn).with('gem_install', anything) - cli.execute({}) - end - end - - it 'does not display a warning when BOLT_GEM is set' do - with_env_vars('BOLT_GEM' => 'true') do - allow(cli).to receive(:incomplete_install?).and_return(true) - cli.execute({}) - expect(Bolt::Logger).not_to receive(:warn).with('gem_install', anything) - end - end - end - describe 'analytics' do before(:each) do allow(cli).to receive(:submit_screen_view).and_call_original