diff --git a/CHANGELOG.md b/CHANGELOG.md index cd971b65..a2ccaa6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,6 @@ _Please add entries here for your pull requests that are not yet released._ ### Added -- Added `--clean` option to `run:detached` command to delete workload when disconnecting. [PR 129](https://github.com/shakacode/heroku-to-control-plane/pull/129) by [Rafael Gomes](https://github.com/rafaelgomesxyz). - Added `--domain` option to `maintenance`, `maintenance:on` and `maintenance:off` commands. [PR 131](https://github.com/shakacode/heroku-to-control-plane/pull/131) by [Rafael Gomes](https://github.com/rafaelgomesxyz). - Added `default_domain` config to specify domain for `maintenance`, `maintenance:on` and `maintenance:off` commands. [PR 131](https://github.com/shakacode/heroku-to-control-plane/pull/131) by [Rafael Gomes](https://github.com/rafaelgomesxyz). diff --git a/docs/commands.md b/docs/commands.md index edf29cd7..9bb48a12 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -375,7 +375,6 @@ cpl run:cleanup -a $APP_NAME - Implemented with only async execution methods, more suitable for production tasks - Has alternative log fetch implementation with only JSON-polling and no WebSockets - Less responsive but more stable, useful for CI tasks -- Deletes the workload when disconnecting by default (can be disabled with `--no-clean` - the workload will still self-delete when finishing) ```sh cpl run:detached rails db:prepare -a $APP_NAME diff --git a/lib/command/base.rb b/lib/command/base.rb index 6d802837..15dacce4 100644 --- a/lib/command/base.rb +++ b/lib/command/base.rb @@ -233,18 +233,6 @@ def self.trace_option(required: false) } end - def self.clean_option(required: false) - { - name: :clean, - params: { - desc: "Deletes workload when disconnecting", - type: :boolean, - required: required, - default: true - } - } - end - def self.all_options methods.grep(/_option$/).map { |method| send(method.to_s) } end diff --git a/lib/command/run_detached.rb b/lib/command/run_detached.rb index 35c6bb8a..cec1629f 100644 --- a/lib/command/run_detached.rb +++ b/lib/command/run_detached.rb @@ -10,8 +10,7 @@ class RunDetached < Base # rubocop:disable Metrics/ClassLength image_option, workload_option, location_option, - use_local_token_option, - clean_option + use_local_token_option ].freeze DESCRIPTION = "Runs one-off **_non-interactive_** replicas (close analog of `heroku run:detached`)" LONG_DESCRIPTION = <<~DESC @@ -20,7 +19,6 @@ class RunDetached < Base # rubocop:disable Metrics/ClassLength - Implemented with only async execution methods, more suitable for production tasks - Has alternative log fetch implementation with only JSON-polling and no WebSockets - Less responsive but more stable, useful for CI tasks - - Deletes the workload when disconnecting by default (can be disabled with `--no-clean` - the workload will still self-delete when finishing) DESC EXAMPLES = <<~EX ```sh @@ -61,7 +59,7 @@ def call # rubocop:disable Metrics/MethodLength wait_for_workload(one_off) show_logs_waiting ensure - if config.options[:clean] && cp.fetch_workload(one_off) + if cp.fetch_workload(one_off) progress.puts ensure_workload_deleted(one_off) end diff --git a/spec/cpl_spec.rb b/spec/cpl_spec.rb index 986c7f58..31e7cd40 100644 --- a/spec/cpl_spec.rb +++ b/spec/cpl_spec.rb @@ -37,9 +37,7 @@ args = [option_key_name, option_value] end - allow(Config).to receive(:new) - .with([], a_hash_including(option[:name].to_sym => option_value), []) - .and_call_original + allow(Config).to receive(:new).with([], { option[:name].to_sym => option_value }, []).and_call_original allow_any_instance_of(Config).to receive(:config_file_path).and_return("spec/fixtures/config.yml") # rubocop:disable RSpec/AnyInstance expect_any_instance_of(Command::Test).to receive(:call) # rubocop:disable RSpec/AnyInstance