ductwork 0.2.0 → 0.2.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: 10cf03c4f8237368de710c2ee604a9d20cf40c2dcebfda776fe490a38ba26aad
4
- data.tar.gz: fd44065015e06a493905b493b847df2de01d779f7451662b186a458cb1cc9977
3
+ metadata.gz: 8ab7c6e79c26352d990680a3913a26ea8bd4bc9999136b4ee1a1846c06e74523
4
+ data.tar.gz: 7adb0603119c80d5edc54e94de44828bba2c927edad418e5944d594ba21f734a
5
5
  SHA512:
6
- metadata.gz: 712b5f00ad1a1a1c736dd186f04dce4a85f2ba3d57df234a5d1182d91483530f0722c9a153e1a4f8517142657ffc8f486e39e6bcd51c28b66f4df5a5958e5455
7
- data.tar.gz: 18c7d56494dc4251310e73bffe47c56e80820634dce555ac2e8d2d46b65973242adc621004dada1efa94cb353063ab650bcb833cec2c7d0cffd635727b808fa1
6
+ metadata.gz: 83be2952cf26ebbee28521df07b68ee29e87ade164a70a87ede7c7bcfc1ef5525097b1346757d76e34d4fc25535c5489f56900fa763006d923bd8491dcba520f
7
+ data.tar.gz: 53cabb6cdfa4f96f847ddc68818a3f0a87d59ca443282700eca5f690a8a01805e46dbd925990565630bb5c45dc728183de251629488d055f8062d136f06dff7e
data/CHANGELOG.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [0.2.1]
4
+
5
+ - fix: do not splat arguments when executing a job nor triggering a pipeline
6
+ - fix: do not splat arguments when enqueuing a job and fix related spec
7
+ - fix: add missing `dependent: :destroy` on certain associations
8
+
3
9
  ## [0.2.0]
4
10
 
5
- - fix: allow steps to be chained while pipeline is expanded or divided (before collapsing or combining) - before this incorrectly raised a `CollapseError` or `CombineError`
6
- - feat: validate argument(s) passed to step transition DSL methods to be valid step class
7
11
  - feat: validate all pipeline definitions on rails boot
12
+ - feat: validate argument(s) passed to step transition DSL methods to be valid step class
13
+ - fix: allow steps to be chained while pipeline is expanded or divided (before collapsing or combining) - before this incorrectly raised a `CollapseError` or `CombineError`
8
14
 
9
15
  ## [0.1.0]
10
16
 
data/README.md CHANGED
@@ -75,7 +75,7 @@ class UsersRequiringEnrichment
75
75
 
76
76
  def execute
77
77
  ids = User.where("data_last_refreshed_at < ?", @days_outdated.days.ago).ids
78
- Rails.logger.info("Enriching #{ids.length} users' data")
78
+ Ductwork.logger.info("Enriching #{ids.length} users' data")
79
79
 
80
80
  # Return value becomes input to the next step
81
81
  ids
@@ -3,9 +3,9 @@
3
3
  module Ductwork
4
4
  class Execution < Ductwork::Record
5
5
  belongs_to :job, class_name: "Ductwork::Job"
6
- has_one :availability, class_name: "Ductwork::Availability", foreign_key: "execution_id"
7
- has_one :run, class_name: "Ductwork::Run", foreign_key: "execution_id"
8
- has_one :result, class_name: "Ductwork::Result", foreign_key: "execution_id"
6
+ has_one :availability, class_name: "Ductwork::Availability", foreign_key: "execution_id", dependent: :destroy
7
+ has_one :run, class_name: "Ductwork::Run", foreign_key: "execution_id", dependent: :destroy
8
+ has_one :result, class_name: "Ductwork::Result", foreign_key: "execution_id", dependent: :destroy
9
9
 
10
10
  validates :retry_count, presence: true
11
11
  validates :started_at, presence: true
@@ -60,7 +60,7 @@ module Ductwork
60
60
  end
61
61
  end
62
62
 
63
- def self.enqueue(step, *args)
63
+ def self.enqueue(step, args)
64
64
  Ductwork::Record.transaction do
65
65
  job = step.create_job!(
66
66
  klass: step.klass,
@@ -89,7 +89,7 @@ module Ductwork
89
89
  job_klass: klass
90
90
  )
91
91
  args = JSON.parse(input_args)["args"]
92
- instance = Object.const_get(klass).new(*args)
92
+ instance = Object.const_get(klass).new(args)
93
93
  run = execution.create_run!(
94
94
  started_at: Time.current
95
95
  )
@@ -48,7 +48,7 @@ module Ductwork
48
48
  Ductwork.defined_pipelines << name.to_s
49
49
  end
50
50
 
51
- def trigger(*args)
51
+ def trigger(args)
52
52
  if pipeline_definition.nil?
53
53
  raise DefinitionError, "Pipeline must be defined before triggering"
54
54
  end
@@ -71,7 +71,7 @@ module Ductwork
71
71
  step_type: :start,
72
72
  started_at: Time.current
73
73
  )
74
- Ductwork::Job.enqueue(step, *args)
74
+ Ductwork::Job.enqueue(step, args)
75
75
 
76
76
  pipeline
77
77
  end
@@ -3,7 +3,7 @@
3
3
  module Ductwork
4
4
  class Step < Ductwork::Record
5
5
  belongs_to :pipeline, class_name: "Ductwork::Pipeline"
6
- has_one :job, class_name: "Ductwork::Job", foreign_key: "step_id"
6
+ has_one :job, class_name: "Ductwork::Job", foreign_key: "step_id", dependent: :destroy
7
7
 
8
8
  validates :klass, presence: true
9
9
  validates :status, presence: true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing