Skip to content

Commit

Permalink
Revert "Add --clean option to run:detached command (#129)"
Browse files Browse the repository at this point in the history
This reverts commit 69f2567.
  • Loading branch information
rafaelgomesxyz committed Jan 12, 2024
1 parent 347b33c commit 8326d1f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
1 change: 0 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions lib/command/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions lib/command/run_detached.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions spec/cpl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8326d1f

Please sign in to comment.