ductwork 0.7.0 → 0.7.1

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: ec9b8299086fb8f1f51c449000ba0c4b4fb7db17f4712525d8216db7c8f082ea
4
- data.tar.gz: 997008b013d1a752e28237a7b6f0dab563a3e8beda7e6a2799f54013f89be661
3
+ metadata.gz: 6174d886b38c9a000eda9937e27efabd0f89a803c5c77fb5739c2b67d8c004c9
4
+ data.tar.gz: 6300c6f3d238e2f92aa74c5ebe01c37bcbf842693f186b9c56e8d8b2cbcf567d
5
5
  SHA512:
6
- metadata.gz: c0687a091dd17926ea4cff0443d9b4cb593a448a26ca6e8f86a2ea629ff4c776e087bab52972d868a22dc5316bba4631123458e7a8202fceb3661c28f5d133cb
7
- data.tar.gz: f5770989f81963fcedc318a11c038e81e4d4a5a211c22b428dccc6b60713da883d31dac2fe4994b3a122dab8fa75738ec766f48a50c31ea6a72c36530de5f8e0
6
+ metadata.gz: fcda67f0378eb7e4108820ce87ac4b508698abcd02e71ef77b7ec8442dfeeea019a77e35bacba5a32fda4101004d2c0f349441d3921838deee97aea6ac93eed5
7
+ data.tar.gz: e74fef5cf5bbf80b8b112616636a556a6ec7742ade2fe44dae3679b3c679ef7b9eb96dc81ad016fb1d4285a06cef874f74d1f6c67a20062b5eaa0bdcfde6061c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [0.7.1]
4
+
5
+ - chore: isolate on halt execution in `Ductwork::Job#execution_failed!`
6
+ - chore: add pipeline definition metadata to `DefinitionBuilder` initializer
7
+
3
8
  ## [0.7.0]
4
9
 
5
10
  - feat: set `Pipeline` and `Step` models status to "in-progress" when claiming latest job
@@ -9,6 +9,7 @@ module Ductwork
9
9
 
10
10
  def initialize
11
11
  @definition = {
12
+ metadata: {},
12
13
  nodes: [],
13
14
  edges: {},
14
15
  }
@@ -102,9 +103,7 @@ module Ductwork
102
103
  def on_halt(klass)
103
104
  validate_classes!(klass)
104
105
 
105
- definition[:metadata] ||= {}
106
- definition[:metadata][:on_halt] = {}
107
- definition[:metadata][:on_halt][:klass] = klass.name
106
+ definition[:metadata][:on_halt] = { klass: klass.name }
108
107
 
109
108
  self
110
109
  end
@@ -195,11 +195,17 @@ module Ductwork
195
195
  # NOTE: perform lifecycle hook execution outside of the transaction as
196
196
  # to not unnecessarily hold it open
197
197
  if halted
198
- klass = JSON.parse(pipeline.definition).dig("metadata", "on_halt", "klass")
198
+ execute_on_halt(pipeline, error)
199
+ end
200
+ end
199
201
 
200
- if klass.present?
201
- Object.const_get(klass).new(error).execute
202
- end
202
+ def execute_on_halt(pipeline, error)
203
+ klass = JSON
204
+ .parse(pipeline.definition)
205
+ .dig("metadata", "on_halt", "klass")
206
+
207
+ if klass.present?
208
+ Object.const_get(klass).new(error).execute
203
209
  end
204
210
  end
205
211
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ductwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing