smart_proxy_dynflow 0.9.1 → 0.9.3

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: 3dbe59b9e06226b0bf592d09dc4de26afbb750182e539f0c6c718cac2a3b03de
4
- data.tar.gz: 963d6a3dbbe3614d679bbe35670690565017c641c291902a1d4ba28997b48897
3
+ metadata.gz: f4cbd5ee3715ae77a996375dad27d44ef2eba5bde98687c01852b63f018de384
4
+ data.tar.gz: f4852c006912c4d80e9ddd1f3aa846d17845dfc46a34ae047ec0dad6887d6c93
5
5
  SHA512:
6
- metadata.gz: 3cfcbeac72c226adc5cff8ac199651f1f3ca6ad1af498c0ea21109805e87513f41c94b6818e3dbeb9a6aa8ec7dda70ff80a991ba917198bb01f51d90125293cc
7
- data.tar.gz: dfcc163c0b6e355a7fa73d1c5ad56cdf96c54633d30094f3de3bab64bce2b652d84bc8fc254d642e69fd251a02f4041c6beb7ec2dee00edc59847db2efb4aa32
6
+ metadata.gz: af596d7d35ec2d1231864f0982f4af90944a723998e6666343ad0cda0fd5b1c470e3ece13e7d89b4940c3ae4c22099d3f31dbd46e58dd8c5a56f90e40e408995
7
+ data.tar.gz: be433c2faeaf439e79ef77b05c36bec2c42b44f98e524b216cc0419b2097b32481a75977aa9c34f248b21c944b5ae71a98a71e1f6b5cccf786e3d12ad14d697a
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Proxy::Dynflow::Action::Middleware
4
+ class AssembleResults < ::Dynflow::Middleware
5
+ def present
6
+ unless %i[error success skipped].include?(action.run_step&.state)
7
+ action.output[:result] = action.output_result
8
+ end
9
+ pass
10
+ end
11
+ end
12
+ end
@@ -2,12 +2,16 @@
2
2
 
3
3
  require 'smart_proxy_dynflow/action/shareable'
4
4
  require 'smart_proxy_dynflow/action/external_polling'
5
+ require 'smart_proxy_dynflow/action/middleware/assemble_results'
6
+
5
7
  module Proxy::Dynflow
6
8
  module Action
7
9
  class Runner < Shareable
8
10
  include ::Dynflow::Action::Cancellable
9
11
  include ::Proxy::Dynflow::Action::WithExternalPolling
10
12
 
13
+ middleware.use ::Proxy::Dynflow::Action::Middleware::AssembleResults
14
+
11
15
  def run(event = nil)
12
16
  case event
13
17
  when nil
@@ -72,16 +72,10 @@ module Proxy
72
72
  end
73
73
  end
74
74
 
75
- def expand_output(action)
76
- hash = action.to_hash
77
- hash[:output][:result] = action.output_result if action.is_a?(Proxy::Dynflow::Action::Runner)
78
- hash
79
- end
80
-
81
75
  def execution_plan_status(plan)
82
76
  actions = plan.actions.map do |action|
83
77
  refresh_output(plan, action)
84
- expand_output(action)
78
+ action.to_hash
85
79
  end
86
80
  plan.to_hash.merge(:actions => actions)
87
81
  end
@@ -88,7 +88,7 @@ module Proxy
88
88
  def write_available!
89
89
  until @buffer.empty?
90
90
  n = @io.write_nonblock(@buffer)
91
- @buffer = @buffer[n..-1]
91
+ @buffer = @buffer.bytes.drop(n).pack('c*')
92
92
  end
93
93
  rescue IO::WaitWritable # rubocop:disable Lint/SuppressedException
94
94
  rescue EOFError
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Proxy
4
4
  module Dynflow
5
- VERSION = '0.9.1'
5
+ VERSION = '0.9.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-20 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -68,6 +68,7 @@ files:
68
68
  - lib/smart_proxy_dynflow/action/batch_callback.rb
69
69
  - lib/smart_proxy_dynflow/action/batch_runner.rb
70
70
  - lib/smart_proxy_dynflow/action/external_polling.rb
71
+ - lib/smart_proxy_dynflow/action/middleware/assemble_results.rb
71
72
  - lib/smart_proxy_dynflow/action/output_collector.rb
72
73
  - lib/smart_proxy_dynflow/action/runner.rb
73
74
  - lib/smart_proxy_dynflow/action/shareable.rb
@@ -110,7 +111,7 @@ licenses:
110
111
  - GPL-3.0
111
112
  metadata:
112
113
  rubygems_mfa_required: 'true'
113
- post_install_message:
114
+ post_install_message:
114
115
  rdoc_options: []
115
116
  require_paths:
116
117
  - lib
@@ -128,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  - !ruby/object:Gem::Version
129
130
  version: '0'
130
131
  requirements: []
131
- rubygems_version: 3.1.6
132
- signing_key:
132
+ rubygems_version: 3.3.26
133
+ signing_key:
133
134
  specification_version: 4
134
135
  summary: Dynflow runtime for Foreman smart proxy
135
136
  test_files: []