cpflow 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b703678fbaeb6b6300473a8f4529a7c9e62dcc2439ab22cae79abe1a01f83fad
4
- data.tar.gz: 9a75cf47df352fce3efe005ebc283d1581befdc5185d8628de8eca0b3df70c5a
3
+ metadata.gz: 48de117fc2fbc2458b8469bfb3d93663c2950777803f84079dfdfa7cdbcda9e9
4
+ data.tar.gz: e3a8347bd330f6df7d2d5e98a3692144fa04d3c935241fbacf7ab06c8f039e79
5
5
  SHA512:
6
- metadata.gz: 26cff99f48b33180c93f3d90d1f726c766f7cf49ed983bb1079cc4260affa95f1e8d8596f21817f910f2abead651fca7856284245d2cb8ae936b100fde7507e9
7
- data.tar.gz: aa7160f2cb036ccff1aa99484a5566102331f07cabf0afe6e5fe4f592a0a1de68cb1c205706a694a91e10bc5ff5f2104dd5edc9d235985fd67e136f3a4b2b1f7
6
+ metadata.gz: '06907b1c67896b14b71376bc88253fcd74a675fb088aab8f6c7bf051ebfaf3f463c3ab96bf33bf64abe6da5bf1dff22529503508176a6d1fc5c35517021c9dc4'
7
+ data.tar.gz: ae76127106fa6dc3544669163e94571d68ec149f22b8ed68d1cf0332c3f333b65e1a1d2f6f6b2cb75039d45bcf1f8418f1cb4d5ceba750cf11cc930ac5d38ac4
data/.rubocop.yml CHANGED
@@ -20,3 +20,7 @@ RSpec/ExampleLength:
20
20
 
21
21
  RSpec/MultipleExpectations:
22
22
  Enabled: false
23
+
24
+ RSpec/NestedGroups:
25
+ Enabled: true
26
+ Max: 5
data/CHANGELOG.md CHANGED
@@ -14,6 +14,11 @@ Changes since the last non-beta release.
14
14
 
15
15
  _Please add entries here for your pull requests that have not yet been released._
16
16
 
17
+ ### Fixed
18
+
19
+ - Fixed issue where `run` command fails when runner workload has ENV but original workload does not. [PR 227](https://github.com/shakacode/control-plane-flow/pull/227) by [Rafael Gomes](https://github.com/rafaelgomesxyz).
20
+
21
+ - Fixed potential infinite loop that could occur for a command if one of the execution steps fails and gets stuck. [PR 217](https://github.com/shakacode/control-plane-flow/pull/217) by [Zakir Dzhamaliddinov](https://github.com/zzaakiirr).
17
22
 
18
23
  ## [4.0.0] - 2024-08-21
19
24
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cpflow (4.0.0)
4
+ cpflow (4.0.1)
5
5
  dotenv (~> 2.8.1)
6
6
  jwt (~> 2.8.1)
7
7
  psych (~> 5.1.0)
data/lib/command/base.rb CHANGED
@@ -465,45 +465,50 @@ module Command
465
465
  $stderr
466
466
  end
467
467
 
468
- def step_error(error, abort_on_error: true)
469
- message = error.message
470
- if abort_on_error
471
- progress.puts(" #{Shell.color('failed!', :red)}\n\n")
472
- Shell.abort(message)
473
- else
474
- Shell.write_to_tmp_stderr(message)
475
- end
476
- end
477
-
478
- def step_finish(success)
468
+ def step_finish(success, abort_on_error: true)
479
469
  if success
480
470
  progress.puts(" #{Shell.color('done!', :green)}")
481
471
  else
482
472
  progress.puts(" #{Shell.color('failed!', :red)}\n\n#{Shell.read_from_tmp_stderr}\n\n")
473
+ exit(ExitCode::ERROR_DEFAULT) if abort_on_error
483
474
  end
484
475
  end
485
476
 
486
- def step(message, abort_on_error: true, retry_on_failure: false) # rubocop:disable Metrics/MethodLength
477
+ def step(message, abort_on_error: true, retry_on_failure: false, max_retry_count: 1000, wait: 1, &block) # rubocop:disable Metrics/MethodLength
487
478
  progress.print("#{message}...")
488
479
 
489
480
  Shell.use_tmp_stderr do
490
481
  success = false
491
482
 
492
483
  begin
493
- if retry_on_failure
494
- until (success = yield)
495
- progress.print(".")
496
- Kernel.sleep(1)
484
+ success =
485
+ if retry_on_failure
486
+ with_retry(max_retry_count: max_retry_count, wait: wait, &block)
487
+ else
488
+ yield
497
489
  end
498
- else
499
- success = yield
500
- end
501
490
  rescue RuntimeError => e
502
- step_error(e, abort_on_error: abort_on_error)
491
+ Shell.write_to_tmp_stderr(e.message)
503
492
  end
504
493
 
505
- step_finish(success)
494
+ step_finish(success, abort_on_error: abort_on_error)
495
+ end
496
+ end
497
+
498
+ def with_retry(max_retry_count:, wait:)
499
+ retry_count = 0
500
+ success = false
501
+
502
+ while !success && retry_count <= max_retry_count
503
+ success = yield
504
+ break if success
505
+
506
+ progress.print(".")
507
+ Kernel.sleep(wait)
508
+ retry_count += 1
506
509
  end
510
+
511
+ success
507
512
  end
508
513
 
509
514
  def cp
data/lib/command/run.rb CHANGED
@@ -207,7 +207,7 @@ module Command
207
207
  original_env_str = original_container_spec["env"]&.sort_by { |env| env["name"] }.to_s
208
208
  env_str = container_spec["env"]&.sort_by { |env| env["name"] }.to_s
209
209
  if original_env_str != env_str
210
- container_spec["env"] = original_container_spec["env"]
210
+ container_spec["env"] = original_container_spec["env"] || []
211
211
  should_update = true
212
212
  end
213
213
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cpflow
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
  MIN_CPLN_VERSION = "3.1.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-08-22 00:00:00.000000000 Z
12
+ date: 2024-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dotenv