ductwork 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e10d600812e131829fe76b4a694bf755a707d4a4c66e29afd21701ee17e2fa8b
4
- data.tar.gz: 101e1a25cac0c898f678b0da11f2c3e0d679bfb9c11741ed99c8e4f5bb8e3782
3
+ metadata.gz: fb1c47566dc19fe61a94c69c48cca984c8844952ce6c0b48917aa479f43f6709
4
+ data.tar.gz: d0a58e6426f2ca032b70ed3228e7e3de0a540f60693d8a2fdd4ad200235bb8ff
5
5
  SHA512:
6
- metadata.gz: be40286349648fa967100abdcecc2fd3519e616881e635362903fb90656c6568e59a005e1015ac477bcae7eff61cda7b05378b35603302f2ca2ea08f3558de6d
7
- data.tar.gz: ed9f573f3d6f2913c2d22dc0081064cb6d67eb743f92a1e573260d31c56592837d093292029a7de82b6ca40ebe022dc2092522167b84f52eb805ff9768fbe6f8
6
+ metadata.gz: 1ff44e54ab30c89ebfadf3402ce79b11a8ca7704e8b07a06e8434f07af8216b18bf2db63c2d94cf352edcbc490545a8c3a5bb608f3807a37df35af6f5562e617
7
+ data.tar.gz: e1c09a239bb49b17143a3f4fb4f248dcbe25c9d5602e763db89bb7ff0411a6233b761ac59e30b5e03e7d0354253924871e3e1510757f3155bc56100954a1f7d3
data/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [0.6.0]
4
+
5
+ - feat: expose `Ductwork.eager_load` method for eager loading code via `zeitwerk`
6
+ - chore: let `zeitwerk` autoload models from `lib/models` directory instead of letting rails autoload them from the `app/models` directory via the rails engine
7
+ - feat: add `started_at` column to `ductwork_pipelines` table - for now, this will only be used in Pro features.
8
+
3
9
  ## [0.5.0]
4
10
 
5
- - core: add "waiting" status to `Step` model
6
- - core: add "waiting" status to `Pipeline` model
11
+ - chore: add "waiting" status to `Step` model
12
+ - chore: add "waiting" status to `Pipeline` model
7
13
  - fix: change `jobs.input_args` and `jobs.output_payload` column type to `text`
8
14
  - fix: change `pipelines.definition` column type to `text` - this prevents larger definitions from being clipped if there is a size limit on the string column
9
15
  - feat: add missing unique index on `ductwork_results` and `ductwork_runs` tables
@@ -8,6 +8,7 @@ module Ductwork
8
8
  validates :definition, presence: true
9
9
  validates :definition_sha1, presence: true
10
10
  validates :status, presence: true
11
+ validates :started_at, presence: true
11
12
  validates :triggered_at, presence: true
12
13
  validates :last_advanced_at, presence: true
13
14
 
@@ -64,6 +65,7 @@ module Ductwork
64
65
  definition: definition,
65
66
  definition_sha1: Digest::SHA1.hexdigest(definition),
66
67
  triggered_at: Time.current,
68
+ started_at: Time.current,
67
69
  last_advanced_at: Time.current
68
70
  )
69
71
  step = p.steps.create!(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
data/lib/ductwork.rb CHANGED
@@ -9,19 +9,15 @@ require "zeitwerk"
9
9
 
10
10
  require "ductwork/engine"
11
11
 
12
- loader = Zeitwerk::Loader.for_gem
13
- loader.inflector.inflect("cli" => "CLI")
14
- loader.inflector.inflect("dsl" => "DSL")
15
- loader.ignore("#{__dir__}/generators")
16
- loader.ignore("#{__dir__}/ductwork/testing")
17
- loader.ignore("#{__dir__}/ductwork/testing.rb")
18
- loader.setup
19
-
20
12
  module Ductwork
21
13
  class << self
22
- attr_accessor :app_executor, :configuration, :logger
14
+ attr_accessor :app_executor, :configuration, :loader, :logger
23
15
  attr_writer :defined_pipelines, :hooks
24
16
 
17
+ def eager_load
18
+ loader.eager_load
19
+ end
20
+
25
21
  def wrap_with_app_executor(&block)
26
22
  if app_executor.present?
27
23
  app_executor.wrap(&block)
@@ -75,3 +71,14 @@ module Ductwork
75
71
  end
76
72
  end
77
73
  end
74
+
75
+ loader = Zeitwerk::Loader.for_gem
76
+ loader.inflector.inflect("cli" => "CLI")
77
+ loader.inflector.inflect("dsl" => "DSL")
78
+ loader.collapse("#{__dir__}/ductwork/models")
79
+ loader.ignore("#{__dir__}/generators")
80
+ loader.ignore("#{__dir__}/ductwork/testing")
81
+ loader.ignore("#{__dir__}/ductwork/testing.rb")
82
+ loader.setup
83
+
84
+ Ductwork.loader = loader
@@ -7,6 +7,7 @@ class CreateDuctworkPipelines < ActiveRecord::Migration[<%= Rails::VERSION::MAJO
7
7
  table.text :definition, null: false
8
8
  table.string :definition_sha1, null: false
9
9
  table.timestamp :triggered_at, null: false
10
+ table.timestamp :started_at, null: false
10
11
  table.timestamp :completed_at
11
12
  table.timestamp :claimed_for_advancing_at
12
13
  table.timestamp :last_advanced_at, null: false
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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing
@@ -95,15 +95,6 @@ files:
95
95
  - LICENSE.txt
96
96
  - README.md
97
97
  - Rakefile
98
- - app/models/ductwork/availability.rb
99
- - app/models/ductwork/execution.rb
100
- - app/models/ductwork/job.rb
101
- - app/models/ductwork/pipeline.rb
102
- - app/models/ductwork/process.rb
103
- - app/models/ductwork/record.rb
104
- - app/models/ductwork/result.rb
105
- - app/models/ductwork/run.rb
106
- - app/models/ductwork/step.rb
107
98
  - lib/ductwork.rb
108
99
  - lib/ductwork/cli.rb
109
100
  - lib/ductwork/configuration.rb
@@ -111,6 +102,15 @@ files:
111
102
  - lib/ductwork/dsl/definition_builder.rb
112
103
  - lib/ductwork/engine.rb
113
104
  - lib/ductwork/machine_identifier.rb
105
+ - lib/ductwork/models/availability.rb
106
+ - lib/ductwork/models/execution.rb
107
+ - lib/ductwork/models/job.rb
108
+ - lib/ductwork/models/pipeline.rb
109
+ - lib/ductwork/models/process.rb
110
+ - lib/ductwork/models/record.rb
111
+ - lib/ductwork/models/result.rb
112
+ - lib/ductwork/models/run.rb
113
+ - lib/ductwork/models/step.rb
114
114
  - lib/ductwork/processes/job_worker.rb
115
115
  - lib/ductwork/processes/job_worker_runner.rb
116
116
  - lib/ductwork/processes/pipeline_advancer.rb