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 +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +1 -1
- data/app/models/ductwork/execution.rb +3 -3
- data/app/models/ductwork/job.rb +2 -2
- data/app/models/ductwork/pipeline.rb +2 -2
- data/app/models/ductwork/step.rb +1 -1
- data/lib/ductwork/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ab7c6e79c26352d990680a3913a26ea8bd4bc9999136b4ee1a1846c06e74523
|
|
4
|
+
data.tar.gz: 7adb0603119c80d5edc54e94de44828bba2c927edad418e5944d594ba21f734a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/app/models/ductwork/job.rb
CHANGED
|
@@ -60,7 +60,7 @@ module Ductwork
|
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
def self.enqueue(step,
|
|
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(
|
|
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(
|
|
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,
|
|
74
|
+
Ductwork::Job.enqueue(step, args)
|
|
75
75
|
|
|
76
76
|
pipeline
|
|
77
77
|
end
|
data/app/models/ductwork/step.rb
CHANGED
|
@@ -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
|
data/lib/ductwork/version.rb
CHANGED