ductwork 0.6.0 → 0.7.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/CHANGELOG.md +9 -0
- data/lib/ductwork/engine.rb +1 -1
- data/lib/ductwork/models/job.rb +11 -4
- data/lib/ductwork/version.rb +1 -1
- data/lib/ductwork.rb +2 -2
- 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: ec9b8299086fb8f1f51c449000ba0c4b4fb7db17f4712525d8216db7c8f082ea
|
|
4
|
+
data.tar.gz: 997008b013d1a752e28237a7b6f0dab563a3e8beda7e6a2799f54013f89be661
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0687a091dd17926ea4cff0443d9b4cb593a448a26ca6e8f86a2ea629ff4c776e087bab52972d868a22dc5316bba4631123458e7a8202fceb3661c28f5d133cb
|
|
7
|
+
data.tar.gz: f5770989f81963fcedc318a11c038e81e4d4a5a211c22b428dccc6b60713da883d31dac2fe4994b3a122dab8fa75738ec766f48a50c31ea6a72c36530de5f8e0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Ductwork Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0]
|
|
4
|
+
|
|
5
|
+
- feat: set `Pipeline` and `Step` models status to "in-progress" when claiming latest job
|
|
6
|
+
|
|
7
|
+
## [0.6.1]
|
|
8
|
+
|
|
9
|
+
- chore: update misc development dependencies
|
|
10
|
+
- fix: eager load pipelines and steps directory after rails initialization - the lazy load hook originally being used would fire before the `rails.main` autoloader had fully setup; when trying to eager load the directories a `Zeitwerk::SetupRequired` error would be raised
|
|
11
|
+
|
|
3
12
|
## [0.6.0]
|
|
4
13
|
|
|
5
14
|
- feat: expose `Ductwork.eager_load` method for eager loading code via `zeitwerk`
|
data/lib/ductwork/engine.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Ductwork
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
initializer "ductwork.validate_definitions", after: :load_config_initializers do
|
|
15
|
-
|
|
15
|
+
config.after_initialize do
|
|
16
16
|
# Load steps and pipelines so definition validation runs and bugs
|
|
17
17
|
# can be caught simply by booting the app or running tests
|
|
18
18
|
loader = Rails.autoloaders.main
|
data/lib/ductwork/models/job.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Ductwork
|
|
|
11
11
|
|
|
12
12
|
FAILED_EXECUTION_TIMEOUT = 10.seconds
|
|
13
13
|
|
|
14
|
-
def self.claim_latest(klass) # rubocop:todo Metrics
|
|
14
|
+
def self.claim_latest(klass) # rubocop:todo Metrics
|
|
15
15
|
process_id = ::Process.pid
|
|
16
16
|
id = Ductwork::Availability
|
|
17
17
|
.joins(execution: { job: { step: :pipeline } })
|
|
@@ -45,9 +45,16 @@ module Ductwork
|
|
|
45
45
|
process_id: process_id,
|
|
46
46
|
availability_id: id
|
|
47
47
|
)
|
|
48
|
-
Ductwork::Job
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
job = Ductwork::Job
|
|
49
|
+
.joins(executions: :availability)
|
|
50
|
+
.find_by(ductwork_availabilities: { id:, process_id: })
|
|
51
|
+
|
|
52
|
+
Ductwork::Record.transaction do
|
|
53
|
+
job.step.in_progress!
|
|
54
|
+
job.step.pipeline.in_progress!
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
job
|
|
51
58
|
else
|
|
52
59
|
Ductwork.logger.debug(
|
|
53
60
|
msg: "Did not claim job, avoided race condition",
|
data/lib/ductwork/version.rb
CHANGED
data/lib/ductwork.rb
CHANGED
|
@@ -7,8 +7,6 @@ require "rails/engine"
|
|
|
7
7
|
require "securerandom"
|
|
8
8
|
require "zeitwerk"
|
|
9
9
|
|
|
10
|
-
require "ductwork/engine"
|
|
11
|
-
|
|
12
10
|
module Ductwork
|
|
13
11
|
class << self
|
|
14
12
|
attr_accessor :app_executor, :configuration, :loader, :logger
|
|
@@ -82,3 +80,5 @@ loader.ignore("#{__dir__}/ductwork/testing.rb")
|
|
|
82
80
|
loader.setup
|
|
83
81
|
|
|
84
82
|
Ductwork.loader = loader
|
|
83
|
+
|
|
84
|
+
require "ductwork/engine"
|