julewire-active_job 1.1.4 → 1.1.5

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: 9a03c6312d8c860b84372a46bd53cb34fd37d9753c21b5e780d553ed224452cf
4
- data.tar.gz: f2ca5f054a91c5f7aace8dc70702abf74b9cf68ca7d8f305b2aa6c89f79ebcb7
3
+ metadata.gz: 435bfb7f97fd9d703399bb3d077e0b573373e592c5c31c9d77c1c59be0bcc4e0
4
+ data.tar.gz: d8889327548f02b84e52b8e978ae4f9aa30224c64c14af0757dc2f97fc46d6fd
5
5
  SHA512:
6
- metadata.gz: b2e40eeb75cf05fce070a6dd6a5f15d45d6dd75dd4abca1d57a7df8b031b03caabece7c1f536e13b31d35e1e3084bc428a3eb9ade179238ad47f8fc2b82448b1
7
- data.tar.gz: 890e3db0063b88121dcc40e7fdefbf905a6b3e01668f04a4ff734cf7005e106a770a723ae2bcc122f9de9d9017202cf53d212ab63e2208af22b35b2031edc507
6
+ metadata.gz: d5b3fe883823db1a7a631e51ff3906d4092419d92da4dc87f9d2d7360aed3c0d609ceb999373d525236a0f23b51805ab9c8ca1461dfd81b7c9b60fa07b79897f
7
+ data.tar.gz: 125225f508fc12470fca4e3269611ccab4c242ade67534acb0aea7ec07236ce98fe0ce80a7cdc42a7a9990a26f4608bc72091fef430d9cd1a68993747ea0ce11
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.1.5 - 2026-09-15
4
+
5
+ - Keep a deserialized job's original context through retries and reserialization,
6
+ including Solid Queue 1.7 batch callbacks.
7
+ - Refresh dependency locksets and require Julewire 1.1.5 dependencies.
8
+
3
9
  ## 1.1.4 - 2026-08-30
4
10
 
5
11
  - Refresh the dependency lockset and require Julewire 1.1.4 dependencies.
data/docs/propagation.md CHANGED
@@ -7,10 +7,20 @@ job execution scope starts.
7
7
  That lets upstream context flow into the job without emitting propagation-only
8
8
  data by default.
9
9
 
10
+ Fresh jobs capture the current context when serialized. A deserialized job keeps
11
+ its original carrier when serialized again, including when retried. An ambient
12
+ worker context or unrelated request cannot replace that origin. Jobs received
13
+ without a carrier remain without one. Instantiate a new job to capture another
14
+ context; child jobs capture their parent's live execution context.
15
+
10
16
  `carrier_max_bytes` defaults to `65_536`. Oversized carriers are omitted from
11
17
  serialized job payloads and ignored on restore. The job still runs normally; it
12
18
  starts without upstream Julewire context.
13
19
 
20
+ Disabling propagation or changing `carrier_key` also prevents forwarding a saved
21
+ carrier under the previous setting. These cases never capture ambient context as
22
+ a replacement for the omitted carrier.
23
+
14
24
  Generic job metadata such as class, id, queue, priority, execution count,
15
25
  timestamps, and status is emitted in the record's `neutral` section as `job.*`
16
26
  formatter-coordination fields. Full Active Job metadata, including framework-
@@ -19,3 +29,21 @@ specific status and exception fields, is emitted under `attributes.active_job`.
19
29
  Status classification follows Active Job's normal `StandardError` path. Fatal
20
30
  Ruby exceptions such as `SystemExit` or `NoMemoryError` are not converted into
21
31
  job status metadata; they keep Ruby's process-level semantics.
32
+
33
+ Bulk enqueues use Active Job's serialization and execution contracts. Solid Queue
34
+ 1.7 compatibility is checked separately with real batches, bulk-enqueued members,
35
+ and success, failure, and finish callbacks. Jobs retain their enqueue origin and
36
+ emit normal per-job records. Aggregate batch lifecycle and delivery remain the
37
+ queue backend's responsibility.
38
+
39
+ Solid Queue is not a runtime dependency or part of the default development bundle.
40
+ CI runs its separate integration suite on Ruby 3.4 and 4.0 when Active Job, core,
41
+ Rails support, or shared tooling changes. Run it locally from `gems/active_job`:
42
+
43
+ ```sh
44
+ BUNDLE_GEMFILE=gemfiles/solid_queue.gemfile bundle install
45
+ bundle exec rake integration:solid_queue
46
+ ```
47
+
48
+ The integration suite uses an in-memory SQLite database and Solid Queue's shipped
49
+ schema. It does not start a worker daemon or connect to an application database.
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.require_paths = ["lib"]
36
36
 
37
37
  spec.add_dependency "activejob", ">= 8.1"
38
- spec.add_dependency "julewire-core", ">= 1.1.4"
39
- spec.add_dependency "julewire-rails_support", ">= 1.1.4"
38
+ spec.add_dependency "julewire-core", ">= 1.1.5"
39
+ spec.add_dependency "julewire-rails_support", ">= 1.1.5"
40
40
  spec.add_dependency "zeitwerk", ">= 2.8.1"
41
41
  end
@@ -22,16 +22,27 @@ module Julewire
22
22
  configuration = julewire_active_job_configuration
23
23
  return unless configuration.propagation?
24
24
 
25
- carrier = Core::Propagation::Carrier.inject(key: configuration.carrier_key,
26
- max_bytes: configuration.carrier_max_bytes)
27
- return unless carrier
25
+ value = serialized_carrier_value(configuration)
26
+ return unless value
28
27
 
29
- job_data[configuration.serialized_carrier_key] = carrier.fetch(configuration.carrier_key.to_s)
28
+ job_data[configuration.serialized_carrier_key] = value
30
29
  IntegrationHealth.record_success
31
30
  rescue StandardError => e
32
31
  IntegrationHealth.record_failure(e, action: :carrier_inject, component: :job_serialization)
33
32
  end
34
33
 
34
+ def serialized_carrier_value(configuration)
35
+ # A deserialized job retains its enqueue origin, not the reserializer's context.
36
+ carrier = instance_variable_get(CARRIER_IVAR)
37
+ return Core::Propagation::Carrier.encode(max_bytes: configuration.carrier_max_bytes) unless carrier
38
+
39
+ value = carrier[configuration.carrier_key]
40
+ return unless value
41
+ return value unless configuration.carrier_max_bytes
42
+
43
+ value if value.bytesize <= configuration.carrier_max_bytes
44
+ end
45
+
35
46
  def extract_julewire_carrier(job_data)
36
47
  configuration = julewire_active_job_configuration
37
48
  unless configuration.propagation?
@@ -40,6 +51,7 @@ module Julewire
40
51
  end
41
52
 
42
53
  value = job_data[configuration.serialized_carrier_key]
54
+ value = value.to_s if value
43
55
  instance_variable_set(CARRIER_IVAR, value ? { configuration.carrier_key => value } : {})
44
56
  IntegrationHealth.record_success
45
57
  rescue StandardError => e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Julewire
4
4
  module ActiveJob
5
- VERSION = "1.1.4"
5
+ VERSION = "1.1.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: julewire-active_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Grebennik
@@ -29,28 +29,28 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.1.4
32
+ version: 1.1.5
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 1.1.4
39
+ version: 1.1.5
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: julewire-rails_support
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.1.4
46
+ version: 1.1.5
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 1.1.4
53
+ version: 1.1.5
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: zeitwerk
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 4.0.16
119
+ rubygems_version: 4.0.20
120
120
  specification_version: 4
121
121
  summary: Active Job integration for Julewire structured logging.
122
122
  test_files: []