karafka-core 2.5.13 → 2.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: 4b7b0d02f8480d00419f928a4fd78f6159e4d7fdb24cae7d426141c7b38c5eb1
4
- data.tar.gz: 45077c9e98c506d1f2e40c82b81548bebf7105ba606dedda2cc2a3eae43a0679
3
+ metadata.gz: f2e60176350192fdf31ec49aa111aa1a2cd51e4f7d0785b5d31070422dd07fbd
4
+ data.tar.gz: 07e237b85c91e7d0886a8c8a91e7d55a8f54aaa59cdd18a1281f1e0cff38357a
5
5
  SHA512:
6
- metadata.gz: faeb1f7ceed771456e3b6c2864042efe95d1a398969987873d8fe9773d8bda46bf2f16fddc4e4da9dced9f96d1fa17de3924cd0723e3f4a7f92c31d82be00b13
7
- data.tar.gz: 064c8be576d37001c06cb13d6694b1e044662c76867a625db52a9551dcc00cc0f2be67cc01497979be3025bc837e0282e596c27949bc9f8d085dca939c46d961
6
+ metadata.gz: 52a0a727b505b2f69720aac6be4bc7af9803d347ce9e01f7335a3d58bec4b2e4e6bc4f302c860f6564bcd53a81dbe36e2138e90e81d24bfe11d0c5caee38fa32
7
+ data.tar.gz: e2b40e1316e748b42301f58a472239458fb4ce34a10b5efe43b436b6aeda70df872df10f2a14fb0d7f851c55fedd045b46bb2e9bb5e896377e2bb2d505e9f5e2
@@ -29,7 +29,7 @@ jobs:
29
29
  - ruby: '4.0'
30
30
  coverage: 'true'
31
31
  steps:
32
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
33
33
  with:
34
34
  fetch-depth: 0
35
35
 
@@ -37,7 +37,7 @@ jobs:
37
37
  run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
38
38
 
39
39
  - name: Set up Ruby
40
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
40
+ uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
41
41
  with:
42
42
  ruby-version: ${{matrix.ruby}}
43
43
  bundler: 'latest'
@@ -65,13 +65,13 @@ jobs:
65
65
  env:
66
66
  BUNDLE_GEMFILE: Gemfile.lint
67
67
  steps:
68
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
68
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
69
69
  with:
70
70
  fetch-depth: 0
71
71
  - name: Set up Ruby
72
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
72
+ uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
73
73
  with:
74
- ruby-version: '4.0.2'
74
+ ruby-version: '4.0.5'
75
75
  bundler-cache: true
76
76
  - name: Run rubocop
77
77
  run: bundle exec rubocop
@@ -82,13 +82,13 @@ jobs:
82
82
  env:
83
83
  BUNDLE_GEMFILE: Gemfile.lint
84
84
  steps:
85
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
86
86
  with:
87
87
  fetch-depth: 0
88
88
  - name: Set up Ruby
89
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
89
+ uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
90
90
  with:
91
- ruby-version: '4.0.2'
91
+ ruby-version: '4.0.5'
92
92
  bundler-cache: true
93
93
  - name: Run yard-lint
94
94
  run: bundle exec yard-lint lib/
@@ -97,11 +97,11 @@ jobs:
97
97
  timeout-minutes: 5
98
98
  runs-on: ubuntu-latest
99
99
  steps:
100
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
100
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
101
101
  with:
102
102
  fetch-depth: 0
103
103
  - name: Set up Node.js
104
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
104
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
105
105
  with:
106
106
  node-version: '20'
107
107
  cache: 'npm'
@@ -19,12 +19,12 @@ jobs:
19
19
  id-token: write
20
20
 
21
21
  steps:
22
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23
23
  with:
24
24
  fetch-depth: 0
25
25
 
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
27
+ uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
28
28
  with:
29
29
  bundler-cache: false
30
30
 
@@ -7,7 +7,7 @@ jobs:
7
7
  verify_action_pins:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
10
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
11
11
  - name: Check SHA pins
12
12
  run: |
13
13
  if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 4.0.2
1
+ 4.0.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka Core Changelog
2
2
 
3
+ ## 2.6.0 (2026-06-10)
4
+ - [Enhancement] Add `Node#register` to allow runtime key-value registration on compiled nodes without going through the static `setting` DSL. Useful for dynamic registries (e.g. named clusters) where setting names are not known at class-load time.
5
+ - [Enhancement] Replace version-gated `Warning[:performance]` with a `Warning.categories`-based loop that enables all opt-in Ruby warning categories automatically, picking up new categories (e.g. `strict_unused_block` in Ruby 3.4+) without future patches.
6
+
3
7
  ## 2.5.13 (2026-04-08)
4
8
  - [Enhancement] Extract `decorate_partitions` method from `StatisticsDecorator` to allow subclasses to filter which partitions are decorated (e.g. skip unassigned partitions in a consumer context).
5
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.5.13)
4
+ karafka-core (2.6.0)
5
5
  karafka-rdkafka (>= 0.20.0)
6
6
  logger (>= 1.6.0)
7
7
 
@@ -12,56 +12,62 @@ GEM
12
12
  reline (>= 0.6.0)
13
13
  docile (1.4.1)
14
14
  drb (2.2.3)
15
- ffi (1.17.2)
16
- ffi (1.17.2-aarch64-linux-gnu)
17
- ffi (1.17.2-aarch64-linux-musl)
18
- ffi (1.17.2-arm-linux-gnu)
19
- ffi (1.17.2-arm-linux-musl)
20
- ffi (1.17.2-arm64-darwin)
21
- ffi (1.17.2-x86-linux-gnu)
22
- ffi (1.17.2-x86-linux-musl)
23
- ffi (1.17.2-x86_64-darwin)
24
- ffi (1.17.2-x86_64-linux-gnu)
25
- ffi (1.17.2-x86_64-linux-musl)
15
+ ffi (1.17.4)
16
+ ffi (1.17.4-aarch64-linux-gnu)
17
+ ffi (1.17.4-aarch64-linux-musl)
18
+ ffi (1.17.4-arm-linux-gnu)
19
+ ffi (1.17.4-arm-linux-musl)
20
+ ffi (1.17.4-arm64-darwin)
21
+ ffi (1.17.4-x86-linux-gnu)
22
+ ffi (1.17.4-x86-linux-musl)
23
+ ffi (1.17.4-x86_64-darwin)
24
+ ffi (1.17.4-x86_64-linux-gnu)
25
+ ffi (1.17.4-x86_64-linux-musl)
26
26
  io-console (0.8.2)
27
- json (2.15.1)
28
- karafka-rdkafka (0.22.2)
29
- ffi (~> 1.15)
27
+ json (2.19.7)
28
+ karafka-rdkafka (0.27.2)
29
+ ffi (~> 1.17.1)
30
30
  json (> 2.0)
31
31
  logger
32
32
  mini_portile2 (~> 2.6)
33
33
  rake (> 12)
34
- karafka-rdkafka (0.22.2-aarch64-linux-gnu)
35
- ffi (~> 1.15)
34
+ karafka-rdkafka (0.27.2-aarch64-linux-gnu)
35
+ ffi (~> 1.17.1)
36
36
  json (> 2.0)
37
37
  logger
38
38
  mini_portile2 (~> 2.6)
39
39
  rake (> 12)
40
- karafka-rdkafka (0.22.2-arm64-darwin)
41
- ffi (~> 1.15)
40
+ karafka-rdkafka (0.27.2-aarch64-linux-musl)
41
+ ffi (~> 1.17.1)
42
42
  json (> 2.0)
43
43
  logger
44
44
  mini_portile2 (~> 2.6)
45
45
  rake (> 12)
46
- karafka-rdkafka (0.22.2-x86_64-linux-gnu)
47
- ffi (~> 1.15)
46
+ karafka-rdkafka (0.27.2-arm64-darwin)
47
+ ffi (~> 1.17.1)
48
48
  json (> 2.0)
49
49
  logger
50
50
  mini_portile2 (~> 2.6)
51
51
  rake (> 12)
52
- karafka-rdkafka (0.22.2-x86_64-linux-musl)
53
- ffi (~> 1.15)
52
+ karafka-rdkafka (0.27.2-x86_64-linux-gnu)
53
+ ffi (~> 1.17.1)
54
+ json (> 2.0)
55
+ logger
56
+ mini_portile2 (~> 2.6)
57
+ rake (> 12)
58
+ karafka-rdkafka (0.27.2-x86_64-linux-musl)
59
+ ffi (~> 1.17.1)
54
60
  json (> 2.0)
55
61
  logger
56
62
  mini_portile2 (~> 2.6)
57
63
  rake (> 12)
58
64
  logger (1.7.0)
59
65
  mini_portile2 (2.8.9)
60
- minitest (6.0.2)
66
+ minitest (6.0.6)
61
67
  drb (~> 2.0)
62
68
  prism (~> 1.5)
63
69
  prism (1.9.0)
64
- rake (13.3.0)
70
+ rake (13.4.2)
65
71
  reline (0.6.3)
66
72
  io-console (~> 0.5)
67
73
  simplecov (0.22.0)
@@ -70,7 +76,7 @@ GEM
70
76
  simplecov_json_formatter (~> 0.1)
71
77
  simplecov-html (0.13.2)
72
78
  simplecov_json_formatter (0.1.4)
73
- warning (1.5.0)
79
+ warning (1.6.0)
74
80
 
75
81
  PLATFORMS
76
82
  aarch64-linux-gnu
@@ -89,8 +89,7 @@ module Karafka
89
89
 
90
90
  children.each do |value|
91
91
  dupped.children << if value.is_a?(Leaf)
92
- # After inheritance we need to reload the state so the leafs are
93
- # recompiled again
92
+ # After inheritance we need to reload the state so the leafs are recompiled again
94
93
  value = value.dup
95
94
  value.compiled = false
96
95
  value
@@ -102,6 +101,33 @@ module Karafka
102
101
  dupped
103
102
  end
104
103
 
104
+ # Registers a key-value pair as a setting on an already-compiled node without going
105
+ # through the static `setting` DSL. Useful for dynamic registries (e.g. named clusters)
106
+ # where the keys are not known at class-load time.
107
+ #
108
+ # Unlike `setting`, which is designed to be called at class-definition time, `register`
109
+ # is safe to call at runtime because it:
110
+ # - appends a pre-compiled Leaf so `deep_dup` and `to_h` include it
111
+ # - sets `@configs_refs` directly so the reader accessor returns the value immediately
112
+ # - builds reader/writer accessors via the same `build_accessors` path
113
+ #
114
+ # Raises `ArgumentError` if the name is already registered to prevent silent overwrites.
115
+ #
116
+ # @param name [Symbol, String] setting name
117
+ # @param value [Object] the setting value assigned immediately; also used as the default
118
+ # when the node is deep-duped and recompiled on a new instance
119
+ # @raise [ArgumentError] when the name is already taken
120
+ def register(name, value)
121
+ name = name.to_sym
122
+
123
+ raise ArgumentError, "#{name} is already registered" if @configs_refs.key?(name)
124
+
125
+ leaf = Leaf.new(name, value, nil, true, false)
126
+ @children << leaf
127
+ build_accessors(leaf)
128
+ @configs_refs[name] = value
129
+ end
130
+
105
131
  # Converts the settings definitions into end children
106
132
  # @note It runs once, after things are compiled, they will not be recompiled again
107
133
  def compile
@@ -146,8 +172,7 @@ module Karafka
146
172
 
147
173
  # Defines a lazy evaluated read and writer that will re-evaluate in case value constructor
148
174
  # evaluates to `nil` or `false`. This allows us to define dynamic constructors that
149
- # can react to external conditions to become expected value once this value is
150
- # available
175
+ # can react to external conditions to become expected value once this value is available
151
176
  #
152
177
  # @param value [Leaf]
153
178
  def build_dynamic_accessor(value)
@@ -131,8 +131,7 @@ module Karafka
131
131
  def validate_required(data, rule, errors, scope)
132
132
  for_checking = dig(data, rule.path)
133
133
 
134
- # We need to compare `DIG_MISS` against stuff because of the ownership of the `#==`
135
- # method
134
+ # We need to compare `DIG_MISS` against stuff because of the ownership of the `#==` method
136
135
  if for_checking == DIG_MISS
137
136
  errors << [scope + rule.path, :missing]
138
137
  else
@@ -4,6 +4,6 @@ module Karafka
4
4
  module Core
5
5
  # Current Karafka::Core version
6
6
  # We follow the versioning schema of given Karafka version
7
- VERSION = "2.5.13"
7
+ VERSION = "2.6.0"
8
8
  end
9
9
  end
data/package-lock.json CHANGED
@@ -217,9 +217,9 @@
217
217
  }
218
218
  },
219
219
  "node_modules/picomatch": {
220
- "version": "2.3.1",
221
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
222
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
220
+ "version": "2.3.2",
221
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
222
+ "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
223
223
  "dev": true,
224
224
  "license": "MIT",
225
225
  "engines": {
@@ -286,9 +286,9 @@
286
286
  }
287
287
  },
288
288
  "node_modules/smol-toml": {
289
- "version": "1.6.0",
290
- "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz",
291
- "integrity": "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw==",
289
+ "version": "1.6.1",
290
+ "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz",
291
+ "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==",
292
292
  "dev": true,
293
293
  "license": "BSD-3-Clause",
294
294
  "engines": {
@@ -312,9 +312,9 @@
312
312
  }
313
313
  },
314
314
  "node_modules/yaml": {
315
- "version": "2.8.2",
316
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
317
- "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
315
+ "version": "2.9.0",
316
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
317
+ "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
318
318
  "dev": true,
319
319
  "license": "ISC",
320
320
  "bin": {
data/renovate.json CHANGED
@@ -30,11 +30,25 @@
30
30
  "ruby/setup-ruby",
31
31
  "ruby"
32
32
  ],
33
- "groupName": "ruby setup"
33
+ "groupName": "ruby setup",
34
+ "internalChecksFilter": "strict"
35
+ },
36
+ {
37
+ "description": "Let setup-ruby pass age gate before ruby so it is ready when the group PR is created",
38
+ "matchPackageNames": [
39
+ "ruby/setup-ruby"
40
+ ],
41
+ "minimumReleaseAge": "5 days"
34
42
  }
35
43
  ],
36
44
  "labels": [
37
45
  "dependencies"
38
46
  ],
39
- "minimumReleaseAge": "7 days"
47
+ "minimumReleaseAge": "7 days",
48
+ "lockFileMaintenance": {
49
+ "enabled": true,
50
+ "schedule": [
51
+ "before 4am on the first day of the month"
52
+ ]
53
+ }
40
54
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.13
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 4.0.6
123
+ rubygems_version: 4.0.10
124
124
  specification_version: 4
125
125
  summary: Karafka ecosystem core modules
126
126
  test_files: []