ductwork 0.5.0 → 0.6.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: e10d600812e131829fe76b4a694bf755a707d4a4c66e29afd21701ee17e2fa8b
4
- data.tar.gz: 101e1a25cac0c898f678b0da11f2c3e0d679bfb9c11741ed99c8e4f5bb8e3782
3
+ metadata.gz: d7a048f740173861ff86ef842b5bb4d8605a0734edbfc6c2cbfd0567080e2db9
4
+ data.tar.gz: '058ea56084947e57a979ddf1074621638248f5e0cc4050c67ce8f9be8535afe3'
5
5
  SHA512:
6
- metadata.gz: be40286349648fa967100abdcecc2fd3519e616881e635362903fb90656c6568e59a005e1015ac477bcae7eff61cda7b05378b35603302f2ca2ea08f3558de6d
7
- data.tar.gz: ed9f573f3d6f2913c2d22dc0081064cb6d67eb743f92a1e573260d31c56592837d093292029a7de82b6ca40ebe022dc2092522167b84f52eb805ff9768fbe6f8
6
+ metadata.gz: bbee812ab34f3cfc3e1720c30b9d85dd34466b1b077d99871feed9f19b09e0edaf9a12bc8103a80893b8833020a4d4d47c539f59eca88b92af28392c7a7ebc54
7
+ data.tar.gz: be0a397e6293286f2f5dc9c9f7419d1ed25bff2a510c8af42b6a9a5fa55e1ac0f93f8bca90a928e970cddca421c2fcb623884b39ddf4be65aef0e6c0f3fda1b5
data/CHANGELOG.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [0.6.1]
4
+
5
+ - chore: update misc development dependencies
6
+ - 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
7
+
8
+ ## [0.6.0]
9
+
10
+ - feat: expose `Ductwork.eager_load` method for eager loading code via `zeitwerk`
11
+ - chore: let `zeitwerk` autoload models from `lib/models` directory instead of letting rails autoload them from the `app/models` directory via the rails engine
12
+ - feat: add `started_at` column to `ductwork_pipelines` table - for now, this will only be used in Pro features.
13
+
3
14
  ## [0.5.0]
4
15
 
5
- - core: add "waiting" status to `Step` model
6
- - core: add "waiting" status to `Pipeline` model
16
+ - chore: add "waiting" status to `Step` model
17
+ - chore: add "waiting" status to `Pipeline` model
7
18
  - fix: change `jobs.input_args` and `jobs.output_payload` column type to `text`
8
19
  - 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
20
  - feat: add missing unique index on `ductwork_results` and `ductwork_runs` tables
@@ -12,7 +12,7 @@ module Ductwork
12
12
  end
13
13
 
14
14
  initializer "ductwork.validate_definitions", after: :load_config_initializers do
15
- ActiveSupport.on_load(:active_record) do
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
@@ -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.1"
5
5
  end
data/lib/ductwork.rb CHANGED
@@ -7,21 +7,15 @@ require "rails/engine"
7
7
  require "securerandom"
8
8
  require "zeitwerk"
9
9
 
10
- require "ductwork/engine"
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
10
  module Ductwork
21
11
  class << self
22
- attr_accessor :app_executor, :configuration, :logger
12
+ attr_accessor :app_executor, :configuration, :loader, :logger
23
13
  attr_writer :defined_pipelines, :hooks
24
14
 
15
+ def eager_load
16
+ loader.eager_load
17
+ end
18
+
25
19
  def wrap_with_app_executor(&block)
26
20
  if app_executor.present?
27
21
  app_executor.wrap(&block)
@@ -75,3 +69,16 @@ module Ductwork
75
69
  end
76
70
  end
77
71
  end
72
+
73
+ loader = Zeitwerk::Loader.for_gem
74
+ loader.inflector.inflect("cli" => "CLI")
75
+ loader.inflector.inflect("dsl" => "DSL")
76
+ loader.collapse("#{__dir__}/ductwork/models")
77
+ loader.ignore("#{__dir__}/generators")
78
+ loader.ignore("#{__dir__}/ductwork/testing")
79
+ loader.ignore("#{__dir__}/ductwork/testing.rb")
80
+ loader.setup
81
+
82
+ Ductwork.loader = loader
83
+
84
+ require "ductwork/engine"
@@ -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.1
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