trailblazer-activity 0.16.3 → 0.17.0
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 +4 -4
- data/CHANGES.md +11 -0
- data/Gemfile +2 -0
- data/lib/trailblazer/activity/circuit/ruby_with_unfixed_compaction.rb +28 -0
- data/lib/trailblazer/activity/introspect.rb +0 -7
- data/lib/trailblazer/activity/schema/compiler.rb +2 -2
- data/lib/trailblazer/activity/task_wrap/extension.rb +2 -29
- data/lib/trailblazer/activity/task_wrap/pipeline.rb +0 -27
- data/lib/trailblazer/activity/version.rb +1 -1
- data/trailblazer-activity.gemspec +2 -1
- metadata +19 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db90b7ac4eda6d6bf8c55d4e3107c8aac6ebfbf8a29e4e7d7e8a2394f0faab4a
|
|
4
|
+
data.tar.gz: 1b28fade56d479d3c500e571c22247359d767d3e5f427b85f071ab0bd8a642c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b23e22e9df457794cc04bb571839dbe703677ffcfe1f137f65282fc520e99b3676a8047a0a0b0909e8ec0397ad696443773fea79a0b2f323c767c1f02330347
|
|
7
|
+
data.tar.gz: 5610595f825d407f05c74fddc10a44bf030b71d54d1880ae0f27f1fc753be084806c799b6bd402aa4fd27df5fc411a1fefdc88f64c67eb80262275b66b8c17e9
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# 0.17.0
|
|
2
|
+
|
|
3
|
+
* In `Extension#call`, remove the dependency to `Implementation::Task`. The logic only receives the actual circuit task.
|
|
4
|
+
* Remove deprecated `Extension()` interface.
|
|
5
|
+
* Remove `Trailblazer::Activity::Introspect::Graph`.
|
|
6
|
+
|
|
7
|
+
# 0.16.4
|
|
8
|
+
|
|
9
|
+
* Revert the static "fix" from 0.16.3 and make the compaction fix optional, as most Ruby versions
|
|
10
|
+
are solving this problem natively. See here for details: https://dev.to/trailblazer/gc-compaction-behold-your-hash-keys-2ii1#quick-fix
|
|
11
|
+
|
|
1
12
|
# 0.16.3
|
|
2
13
|
|
|
3
14
|
* Fix a bug in Ruby 3.2: `NoMethodError: undefined method `[]' for nil`. Thanks @tiagotex for finding the problem
|
data/Gemfile
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Trailblazer
|
|
2
|
+
class Activity
|
|
3
|
+
# TODO: we can remove this once we drop Ruby <= 3.3.6.
|
|
4
|
+
class Circuit
|
|
5
|
+
# This is a hot fix for Ruby versions that haven't fixed the GC compaction bug:
|
|
6
|
+
# https://redmine.ruby-lang.org/issues/20853
|
|
7
|
+
# https://bugs.ruby-lang.org/issues/20868
|
|
8
|
+
#
|
|
9
|
+
# Affected versions might be: 3.1.x, 3.2.?????????, 3.3.0-3.3.6
|
|
10
|
+
# You don't need this fix in the following versions:
|
|
11
|
+
#
|
|
12
|
+
# If you experience this bug: https://github.com/trailblazer/trailblazer-activity/issues/60
|
|
13
|
+
#
|
|
14
|
+
# NoMethodError: undefined method `[]' for nil
|
|
15
|
+
#
|
|
16
|
+
# you need to do
|
|
17
|
+
#
|
|
18
|
+
# Trailblazer::Activity::Circuit.include(RubyWithUnfixedCompaction)
|
|
19
|
+
module RubyWithUnfixedCompaction
|
|
20
|
+
def initialize(wiring, *args, **options)
|
|
21
|
+
wiring.compare_by_identity
|
|
22
|
+
|
|
23
|
+
super(wiring, *args, **options)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -56,13 +56,6 @@ module Trailblazer
|
|
|
56
56
|
|
|
57
57
|
proc.inspect
|
|
58
58
|
end
|
|
59
|
-
|
|
60
|
-
# TODO: remove with 0.1.0.
|
|
61
|
-
def self.Graph(*args)
|
|
62
|
-
Deprecate.warn caller_locations[0], %(`Trailblazer::Activity::Introspect::Graph` is deprecated. Please use `Trailblazer::Developer::Introspect.Graph`)
|
|
63
|
-
|
|
64
|
-
Trailblazer::Developer::Introspect::Graph.new(*args)
|
|
65
|
-
end
|
|
66
59
|
end # Introspect
|
|
67
60
|
end
|
|
68
61
|
end
|
|
@@ -24,7 +24,7 @@ module Trailblazer
|
|
|
24
24
|
|
|
25
25
|
# From the intermediate "template" and the actual implementation, compile a {Circuit} instance.
|
|
26
26
|
def schema_components(intermediate, implementation, config)
|
|
27
|
-
wiring = {}
|
|
27
|
+
wiring = {}
|
|
28
28
|
nodes_attributes = []
|
|
29
29
|
|
|
30
30
|
intermediate.wiring.each do |task_ref, outs|
|
|
@@ -92,7 +92,7 @@ module Trailblazer
|
|
|
92
92
|
def invoke_extensions_for(config, impl_task, id)
|
|
93
93
|
impl_task
|
|
94
94
|
.extensions
|
|
95
|
-
.inject(config) { |cfg, ext| ext.(config: cfg, id: id, task: impl_task) } # {ext} must return new config hash.
|
|
95
|
+
.inject(config) { |cfg, ext| ext.(config: cfg, id: id, task: impl_task.circuit_task) } # {ext} must return new config hash.
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
# In an array of {Activity::Output}, find the output matching {semantic}.
|
|
@@ -17,15 +17,7 @@ module Trailblazer
|
|
|
17
17
|
# TaskWrap.Extension([task, id: "my_logger", append: "task_wrap.call_task"], [...])
|
|
18
18
|
#
|
|
19
19
|
# If you want a {wrap_static} extension, wrap it using `Extension.WrapStatic.new`.
|
|
20
|
-
def self.Extension(*inserts
|
|
21
|
-
if merge
|
|
22
|
-
Deprecate.warn caller_locations[0], "The :merge option for TaskWrap.Extension is deprecated and will be removed in 0.16.
|
|
23
|
-
Please refer to https://trailblazer.to/2.1/docs/activity.html#activity-taskwrap-static and have a great day."
|
|
24
|
-
|
|
25
|
-
return Extension::WrapStatic.new(extension: Extension.new(*merge))
|
|
26
|
-
# TODO: remove me once we drop the pre-friendly interface.
|
|
27
|
-
end
|
|
28
|
-
|
|
20
|
+
def self.Extension(*inserts)
|
|
29
21
|
Extension.build(*inserts)
|
|
30
22
|
end
|
|
31
23
|
|
|
@@ -44,8 +36,6 @@ Please refer to https://trailblazer.to/2.1/docs/activity.html#activity-taskwrap-
|
|
|
44
36
|
end
|
|
45
37
|
|
|
46
38
|
def initialize(*extension_rows)
|
|
47
|
-
extension_rows = deprecated_extension_for(extension_rows) # TODO: remove me soon!
|
|
48
|
-
|
|
49
39
|
@extension_rows = extension_rows # those rows are simple ADDS instructions.
|
|
50
40
|
end
|
|
51
41
|
|
|
@@ -55,21 +45,6 @@ Please refer to https://trailblazer.to/2.1/docs/activity.html#activity-taskwrap-
|
|
|
55
45
|
Adds.apply_adds(task_wrap_pipeline, @extension_rows)
|
|
56
46
|
end
|
|
57
47
|
|
|
58
|
-
# TODO: remove me once we drop the pre-friendly interface.
|
|
59
|
-
def deprecated_extension_for(extension_rows)
|
|
60
|
-
return extension_rows unless extension_rows.find { |ext| ext.is_a?(Array) }
|
|
61
|
-
|
|
62
|
-
Deprecate.warn caller_locations[3], "You are using the old API for taskWrap extensions.
|
|
63
|
-
Please update to the new TaskWrap.Extension() API."
|
|
64
|
-
|
|
65
|
-
extension_rows.collect do |ary|
|
|
66
|
-
{
|
|
67
|
-
insert: ary[0..1],
|
|
68
|
-
row: Pipeline.Row(*ary[2])
|
|
69
|
-
}
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
48
|
# Create extensions from the friendly interface that can alter the wrap_static
|
|
74
49
|
# of a step in an activity. The returned extensionn can be passed directly via {:extensions}
|
|
75
50
|
# to the compiler, or when using the `#step` DSL.
|
|
@@ -86,9 +61,6 @@ Please update to the new TaskWrap.Extension() API."
|
|
|
86
61
|
end
|
|
87
62
|
|
|
88
63
|
def call(config:, task:, **)
|
|
89
|
-
# DISCUSS: does it make sense to test the immutable behavior here? What would be the worst outcome?
|
|
90
|
-
task = task.circuit_task # Receives {Schema::Implementation::Task}. DISCUSS: why?
|
|
91
|
-
|
|
92
64
|
# Add the extension's task(s) to the activity's {:wrap_static} taskWrap
|
|
93
65
|
# which is stored in the {:config} field.
|
|
94
66
|
wrap_static = config[:wrap_static] # the activity's {wrap_static}.
|
|
@@ -97,6 +69,7 @@ Please update to the new TaskWrap.Extension() API."
|
|
|
97
69
|
# Overwrite the original task_wrap:
|
|
98
70
|
wrap_static = wrap_static.merge(task => @extension.(task_wrap))
|
|
99
71
|
|
|
72
|
+
# DISCUSS: does it make sense to test the immutable behavior here? What would be the worst outcome?
|
|
100
73
|
config.merge(wrap_static: wrap_static) # Return new config hash. This needs to be immutable code!
|
|
101
74
|
end
|
|
102
75
|
end # WrapStatic
|
|
@@ -23,21 +23,6 @@ class Trailblazer::Activity
|
|
|
23
23
|
@sequence
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
# TODO: remove me when old tW extension API is deprecated.
|
|
27
|
-
def self.method(name)
|
|
28
|
-
new_name = {
|
|
29
|
-
insert_before: :Prepend,
|
|
30
|
-
insert_after: :Append,
|
|
31
|
-
append: :Append,
|
|
32
|
-
prepend: :Prepend
|
|
33
|
-
}.fetch(name)
|
|
34
|
-
|
|
35
|
-
warn "[Trailblazer] Using `Trailblazer::Activity::TaskWrap::Pipeline.method(:#{name})` is deprecated.
|
|
36
|
-
Please use the new API: #FIXME!!!"
|
|
37
|
-
|
|
38
|
-
Trailblazer::Activity::Adds::Insert.method(new_name)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
26
|
def self.Row(id, task)
|
|
42
27
|
Row[id, task]
|
|
43
28
|
end
|
|
@@ -48,18 +33,6 @@ Please use the new API: #FIXME!!!"
|
|
|
48
33
|
end
|
|
49
34
|
end
|
|
50
35
|
|
|
51
|
-
# TODO: remove {Merge} when old tW extension API is deprecated.
|
|
52
|
-
class Merge
|
|
53
|
-
def self.new(*inserts)
|
|
54
|
-
warn "[Trailblazer] Using `Trailblazer::Activity::TaskWrap::Pipeline::Merge.new` is deprecated.
|
|
55
|
-
Please use the new TaskWrap.Extension() API: #FIXME!!!"
|
|
56
|
-
|
|
57
|
-
# We can safely assume that users calling {Merge.new} are using the old tW extension API, not
|
|
58
|
-
# the "friendly API". That's why we don't go through {Extension.build}.
|
|
59
|
-
TaskWrap::Extension.new(*inserts)
|
|
60
|
-
end
|
|
61
|
-
end # Merge
|
|
62
|
-
|
|
63
36
|
# Implements adapter for a callable in a Pipeline.
|
|
64
37
|
class TaskAdapter < Circuit::TaskAdapter
|
|
65
38
|
# Returns a {Pipeline::TaskAdapter} instance that can be used directly in a Pipeline.
|
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.email = ["apotonick@gmail.com"]
|
|
10
10
|
|
|
11
11
|
spec.summary = %q{Runtime code for Trailblazer activities.}
|
|
12
|
-
spec.homepage = "
|
|
12
|
+
spec.homepage = "https://trailblazer.to"
|
|
13
13
|
spec.licenses = ["LGPL-3.0"]
|
|
14
14
|
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.add_development_dependency "minitest", "~> 5.0"
|
|
25
25
|
spec.add_development_dependency "minitest-line"
|
|
26
26
|
spec.add_development_dependency "rake"
|
|
27
|
+
spec.add_development_dependency "trailblazer-core-utils", "0.0.4"
|
|
27
28
|
|
|
28
29
|
spec.required_ruby_version = '>= 2.1.0'
|
|
29
30
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trailblazer-activity
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.17.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Sutterer
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
10
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: trailblazer-context
|
|
@@ -94,7 +93,20 @@ dependencies:
|
|
|
94
93
|
- - ">="
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
95
|
version: '0'
|
|
97
|
-
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: trailblazer-core-utils
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - '='
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: 0.0.4
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - '='
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 0.0.4
|
|
98
110
|
email:
|
|
99
111
|
- apotonick@gmail.com
|
|
100
112
|
executables: []
|
|
@@ -114,6 +126,7 @@ files:
|
|
|
114
126
|
- lib/trailblazer/activity.rb
|
|
115
127
|
- lib/trailblazer/activity/adds.rb
|
|
116
128
|
- lib/trailblazer/activity/circuit.rb
|
|
129
|
+
- lib/trailblazer/activity/circuit/ruby_with_unfixed_compaction.rb
|
|
117
130
|
- lib/trailblazer/activity/circuit/task_adapter.rb
|
|
118
131
|
- lib/trailblazer/activity/deprecate.rb
|
|
119
132
|
- lib/trailblazer/activity/introspect.rb
|
|
@@ -131,11 +144,10 @@ files:
|
|
|
131
144
|
- lib/trailblazer/activity/testing.rb
|
|
132
145
|
- lib/trailblazer/activity/version.rb
|
|
133
146
|
- trailblazer-activity.gemspec
|
|
134
|
-
homepage:
|
|
147
|
+
homepage: https://trailblazer.to
|
|
135
148
|
licenses:
|
|
136
149
|
- LGPL-3.0
|
|
137
150
|
metadata: {}
|
|
138
|
-
post_install_message:
|
|
139
151
|
rdoc_options: []
|
|
140
152
|
require_paths:
|
|
141
153
|
- lib
|
|
@@ -150,8 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
150
162
|
- !ruby/object:Gem::Version
|
|
151
163
|
version: '0'
|
|
152
164
|
requirements: []
|
|
153
|
-
rubygems_version: 3.
|
|
154
|
-
signing_key:
|
|
165
|
+
rubygems_version: 3.6.0.dev
|
|
155
166
|
specification_version: 4
|
|
156
167
|
summary: Runtime code for Trailblazer activities.
|
|
157
168
|
test_files: []
|