dynflow 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f067dee815c7352328f4a08c6cf7aa5f60c45e8c46ae0bb561ed3eff052a3f47
4
- data.tar.gz: 37d1bf9a5bed948a9c0c966ac8649d6a1ba097801fcf3b3608a6f353e3b8cd14
3
+ metadata.gz: d4db626bf7deb1705c684ec0a1e4a0f55326129f94513076d0bd6eda7a8b61e7
4
+ data.tar.gz: 006b0a3e56c17c8c827f7375e761d1f47608b586d5fdbaaa3a16bc220b8879d6
5
5
  SHA512:
6
- metadata.gz: 3eb25b7a20ac5022e0f1f32062ac6d7445d5fbe2fb482e5d34278a402f49e5feb53e6a7116f5fb06b1758faa6ea253fdda496e76d94dac0a6e2e497653c98fe8
7
- data.tar.gz: 242ade0c666d77988957f473ed76aebef323f985adaa4a851c0620c14768fc19db7ef0087d0ab2d2983059aa0fd671721d377dfb9531d00c8f5a4a9b6a8380d2
6
+ metadata.gz: 8cb9a7044648545e5da5f1be5452d3170a1be2077207ccc83b85c2fd59523851bbe4a2e3cdef484cf6f02c41b82357373de11c4d41b7fb13802be0d1a49aa2c7
7
+ data.tar.gz: 91cb66bfddeb1044c52f2959d7c1d3f3e4ff4bf5b44dfa938ae1d48d07650e6a6c9169f9db6ab73ba0bf79d9bd0ce41235c6b1aecedc322a56f784466fa4bc05
data/dynflow.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
 
30
30
  s.add_development_dependency "rake"
31
31
  s.add_development_dependency "rack-test"
32
- s.add_development_dependency "minitest"
32
+ s.add_development_dependency "minitest", "< 5.19"
33
33
  s.add_development_dependency "minitest-reporters"
34
34
  s.add_development_dependency "minitest-stub-const"
35
35
  s.add_development_dependency "activerecord"
@@ -168,10 +168,11 @@ elsif defined?(Sidekiq)
168
168
  Sidekiq.default_worker_options = { :retry => 0, 'backtrace' => true }
169
169
  # assuming the remote executor was required as part of initialization
170
170
  # of the ActiveJob worker
171
- world = if Sidekiq.options[:queues].include?("dynflow_orchestrator")
171
+ queues = Sidekiq.configure_server { |c| c.options[:queues] }
172
+ world = if queues.include?("dynflow_orchestrator")
172
173
  RemoteExecutorExample.initialize_sidekiq_orchestrator
173
- elsif (Sidekiq.options[:queues] - ['dynflow_orchestrator']).any?
174
+ elsif (queues - ['dynflow_orchestrator']).any?
174
175
  RemoteExecutorExample.initialize_sidekiq_worker
175
176
  end
176
- Sidekiq.options[:dynflow_world] = world
177
+ Sidekiq.configure_server { |c| c.options[:dynflow_world] = world }
177
178
  end
@@ -130,7 +130,7 @@ module Dynflow::Action::V2
130
130
 
131
131
  def recalculate_counts
132
132
  total = total_count
133
- failed = sub_plans_count('state' => %w(paused stopped), 'result' => 'error')
133
+ failed = sub_plans_count('state' => %w(paused stopped), 'result' => %w(error warning))
134
134
  success = sub_plans_count('state' => 'stopped', 'result' => 'success')
135
135
  output.update(:pending_count => total - failed - success,
136
136
  :failed_count => failed - output.fetch(:resumed_count, 0),
@@ -173,6 +173,7 @@ module Dynflow::Action::V2
173
173
  def cancel!(force = false)
174
174
  # Count the not-yet-planned tasks as cancelled
175
175
  output[:cancelled_count] = total_count - output[:planned_count]
176
+ on_planning_finished if output[:cancelled_count].positive?
176
177
  # Pass the cancel event to running sub plans if they can be cancelled
177
178
  sub_plans(:state => 'running').each { |sub_plan| sub_plan.cancel(force) if sub_plan.cancellable? }
178
179
  suspend
@@ -9,7 +9,7 @@ require 'sidekiq-reliable-fetch'
9
9
  Sidekiq.configure_server do |config|
10
10
  # Use semi-reliable fetch
11
11
  # for details see https://gitlab.com/gitlab-org/sidekiq-reliable-fetch/blob/master/README.md
12
- config.options[:semi_reliable_fetch] = true
12
+ config[:semi_reliable_fetch] = true
13
13
  Sidekiq::ReliableFetch.setup_reliable_fetch!(config)
14
14
  end
15
15
 
@@ -100,7 +100,7 @@ module Dynflow
100
100
  end
101
101
 
102
102
  def sidekiq_worker?
103
- defined?(::Sidekiq) && ::Sidekiq.options[:queues].any?
103
+ defined?(::Sidekiq) && ::Sidekiq.configure_server { |c| c[:queues].any? }
104
104
  end
105
105
 
106
106
  def calculate_db_pool_size(world)
@@ -108,7 +108,7 @@ module Dynflow
108
108
 
109
109
  base_value = 5
110
110
  if defined?(::Sidekiq)
111
- Sidekiq.options[:concurrency] + base_value
111
+ Sidekiq.configure_server { |c| c[:concurrency] } + base_value
112
112
  else
113
113
  world.config.queues.values.inject(base_value) do |pool_size, pool_options|
114
114
  pool_size += pool_options[:pool_size]
@@ -152,7 +152,7 @@ module Dynflow
152
152
  # we can't do any operation until the Rails.application.dynflow.world is set
153
153
  config.auto_execute = false
154
154
  config.auto_validity_check = false
155
- if sidekiq_worker? && !Sidekiq.options[:queues].include?("dynflow_orchestrator")
155
+ if sidekiq_worker? && !Sidekiq.configure_server { |c| c[:queues].include?("dynflow_orchestrator") }
156
156
  config.delayed_executor = nil
157
157
  end
158
158
  end
@@ -192,7 +192,7 @@ module Dynflow
192
192
  if remote?
193
193
  false
194
194
  else
195
- if defined?(::Sidekiq) && Sidekiq.options[:dynflow_executor]
195
+ if defined?(::Sidekiq) && Sidekiq.configure_server { |c| c[:dynflow_executor] }
196
196
  ::Dynflow::Executors::Sidekiq::Core
197
197
  else
198
198
  ::Dynflow::Executors::Parallel::Core
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dynflow
3
- VERSION = '1.8.0'
3
+ VERSION = '1.8.2'
4
4
  end
data/lib/dynflow.rb CHANGED
@@ -25,7 +25,7 @@ module Dynflow
25
25
  # @return [Dynflow::World, nil]
26
26
  def process_world
27
27
  return @process_world if defined? @process_world
28
- @process_world = Sidekiq.options[:dynflow_world]
28
+ @process_world = Sidekiq.configure_server { |c| c.options[:dynflow_world] }
29
29
  raise "process world is not set" unless @process_world
30
30
  @process_world
31
31
  end