ductwork 1.1.1 → 1.1.2

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: bd349349c33899f1c8cdcf97339176dd72fb6397df4dbccba7445946337810b1
4
- data.tar.gz: 39560169d62cd46193221f6d74f00524b39314bc470787213f891260bcc5a3db
3
+ metadata.gz: 936ce40a67d02217db84222c1a30d002c2214b73585c04a05022ce91d87160a6
4
+ data.tar.gz: c87fc48ed8be92be080f4ecf7c1c58f33d09a532d6ff7ca8c9d99143e2f21dae
5
5
  SHA512:
6
- metadata.gz: 62b5cc64d92c9b5caf225624bb51a252d550f48bbcbc4f5a73ffc19e464964477f41bceec74a654c783859890fcfab84305327abdf4685fa460ffbeb6e35fdff
7
- data.tar.gz: 0d4483bcd3dce63092438c392cc6089f9b8ad9a8e5730cb133fbc7bacd22d0a82ff6afdabb285c447593afcc13979d3f74df3d57801861eb13815d91d5744a46
6
+ metadata.gz: 237854d56ac87c1552813541a1ef1d275db94fe16637b96ca7997ee7939a31a5d442b145851d1e25c49a37a4320a39421de338fb9260848c5b51f5d678efdf2a
7
+ data.tar.gz: 7c18082ff55ca438f2a9c7d5f0cb8932c5933d66462a43bb6a1637807d0dd301ec51190e432d84ec370b916e4b666fe93574b2cea38c260c60bddef8dbda7ab7
data/CHANGELOG-PRO.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # Ductwork Pro Changelog
2
2
 
3
- ## [1.1.1] (Unreleased)
4
-
3
+ ## [1.1.1]
4
+
5
+ - fix: use `Ductwork::DatabaseClock` instead of `Time.current` for every `started_at` Pro stamps, mirroring the OSS fix
6
+ - fix: evaluate the step-timeout deadline in the database (`DatabaseClock.ago_sql`) instead of subtracting `attempt.started_at` from the worker's `Time.current`, so an NTP correction mid-job cannot stretch or collapse a step's timeout
7
+ - fix: temporarily handle multiple return types from `Branch.with_latest_claimed` - this is a result of changes in OSS from v1.1.0 and v1.1.1
8
+ - fix: log the claimed job/branch of a dead thread before the restart clears it
9
+ - fix: add rubocop cop for ensuring `updated_at` is updated (copied from OSS)
10
+ - fix: explicitly set `updated_at` for queries that update the record directly
11
+ - fix: mirror OSS `halt_branch_and_resolve_run_without_rescue!` implementation
12
+ - fix: walk the `collapse` fan-in with an explicit keyset scan so each batch is one indexed range seek, instead of a per-batch subquery plus a second `in_batches` query that re-ran the whole scope
5
13
  - fix: don't use `unique_by` argument for `insert_all` for mysql and trilogy database adapters
6
14
 
7
15
  ## [1.1.0]
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [1.1.2]
4
+
5
+ - fix: lazily create configuration
6
+ - fix: prevent step's idempotency key from returning `nil`
7
+
3
8
  ## [1.1.1]
4
9
 
5
10
  - fix: use database clock instead of `Time.current` to avoid clock skew in `Branch#latest_step` paths
@@ -20,7 +20,6 @@ module Ductwork
20
20
  end
21
21
 
22
22
  initializer "ductwork.configure" do
23
- Ductwork.configuration ||= Ductwork::Configuration.new
24
23
  Ductwork.logger ||= Ductwork::Configuration::DEFAULT_LOGGER
25
24
  end
26
25
  end
@@ -29,7 +29,7 @@ module Ductwork
29
29
  job_klass: job.klass
30
30
  )
31
31
  args = JSON.parse(job.input_args)["args"]
32
- instance = Object.const_get(job.klass).build_for_execution(job.step.run_id, *args)
32
+ instance = Object.const_get(job.klass).build_for_execution(job.step.run_id, job.step.id, *args)
33
33
  create_attempt!(started_at: Time.current)
34
34
  output_payload = nil
35
35
 
@@ -40,23 +40,22 @@ module Ductwork
40
40
  converge: "converge",
41
41
  dampen: "dampen"
42
42
 
43
- def self.build_for_execution(run_id, *, **)
43
+ def self.build_for_execution(run_id, idempotency_key, *, **)
44
44
  instance = allocate
45
45
  instance.instance_variable_set(:@run_id, run_id)
46
+ instance.instance_variable_set(:@idempotency_key, idempotency_key)
46
47
  instance.send(:initialize, *, **)
47
48
  instance
48
49
  end
49
50
 
50
- alias_attribute :idempotency_key, :id
51
-
52
51
  def run_id
53
52
  @run_id || (@attributes && super)
54
53
  end
55
54
 
56
- # The result_type of the most recent execution to finish for this step's
57
- # job, used to distinguish *why* a step failed (e.g. `errored!` writes
58
- # "failure", `crashed!` writes "process_crashed"). Returns nil when no
59
- # execution has produced a result yet.
55
+ def idempotency_key
56
+ @idempotency_key || (@attributes && id)
57
+ end
58
+
60
59
  def terminal_result_type
61
60
  return if job.blank?
62
61
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
data/lib/ductwork.rb CHANGED
@@ -11,8 +11,12 @@ require "zeitwerk"
11
11
 
12
12
  module Ductwork
13
13
  class << self
14
- attr_accessor :app_executor, :configuration, :loader, :logger
15
- attr_writer :defined_pipelines, :hooks
14
+ attr_accessor :app_executor, :loader, :logger
15
+ attr_writer :configuration, :defined_pipelines, :hooks
16
+
17
+ def configuration
18
+ @configuration ||= Ductwork::Configuration.new
19
+ end
16
20
 
17
21
  def eager_load
18
22
  loader.eager_load
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: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing