karafka-core 2.5.12 → 2.5.13

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: a1ca213972a7e05632f164e423383f6a9172926291140ad6005c822b347855b2
4
- data.tar.gz: acb97b8887fed4e6534bed1c8c764a19a38462b6a6581893ed80b3bb1efd7a82
3
+ metadata.gz: 4b7b0d02f8480d00419f928a4fd78f6159e4d7fdb24cae7d426141c7b38c5eb1
4
+ data.tar.gz: 45077c9e98c506d1f2e40c82b81548bebf7105ba606dedda2cc2a3eae43a0679
5
5
  SHA512:
6
- metadata.gz: 0d3ead51c6a1fe7697cb5c13d914acd148c65d0be5b04be88b898d8cb5e220f65095bab181083a993a6085483c2f5815cb69c5cbd31cf92bcd246ea72c2f343a
7
- data.tar.gz: 1210463f030fe15c691b0d136498327ae9a83128b5f871a256401bd498ebfd4117391d250ee49a1ab53c1f5f4fd427db292755bc792ea73a99435535bb79d115
6
+ metadata.gz: faeb1f7ceed771456e3b6c2864042efe95d1a398969987873d8fe9773d8bda46bf2f16fddc4e4da9dced9f96d1fa17de3924cd0723e3f4a7f92c31d82be00b13
7
+ data.tar.gz: 064c8be576d37001c06cb13d6694b1e044662c76867a625db52a9551dcc00cc0f2be67cc01497979be3025bc837e0282e596c27949bc9f8d085dca939c46d961
@@ -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@c515ec17f69368147deb311832da000dd229d338 # v1.297.0
40
+ uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
41
41
  with:
42
42
  ruby-version: ${{matrix.ruby}}
43
43
  bundler: 'latest'
@@ -69,7 +69,7 @@ jobs:
69
69
  with:
70
70
  fetch-depth: 0
71
71
  - name: Set up Ruby
72
- uses: ruby/setup-ruby@c515ec17f69368147deb311832da000dd229d338 # v1.297.0
72
+ uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
73
73
  with:
74
74
  ruby-version: '4.0.2'
75
75
  bundler-cache: true
@@ -86,7 +86,7 @@ jobs:
86
86
  with:
87
87
  fetch-depth: 0
88
88
  - name: Set up Ruby
89
- uses: ruby/setup-ruby@c515ec17f69368147deb311832da000dd229d338 # v1.297.0
89
+ uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
90
90
  with:
91
91
  ruby-version: '4.0.2'
92
92
  bundler-cache: true
@@ -24,7 +24,7 @@ jobs:
24
24
  fetch-depth: 0
25
25
 
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@c515ec17f69368147deb311832da000dd229d338 # v1.297.0
27
+ uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
28
28
  with:
29
29
  bundler-cache: false
30
30
 
@@ -32,4 +32,4 @@ jobs:
32
32
  run: |
33
33
  bundle install --jobs 4 --retry 3
34
34
 
35
- - uses: rubygems/release-gem@e9a6361a0b14562539327c2a02373edc56dd3169 # v1.1.4
35
+ - uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka Core Changelog
2
2
 
3
+ ## 2.5.13 (2026-04-08)
4
+ - [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
+
3
6
  ## 2.5.12 (2026-04-02)
4
7
  - [Fix] Exclude `test/` directory from gem releases to reduce package size.
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.5.12)
4
+ karafka-core (2.5.13)
5
5
  karafka-rdkafka (>= 0.20.0)
6
6
  logger (>= 1.6.0)
7
7
 
@@ -201,10 +201,7 @@ module Karafka
201
201
  if partitions.is_a?(Hash)
202
202
  prev_partitions = prev_topic["partitions"] || EMPTY_HASH
203
203
 
204
- partitions.each_pair do |pid, partition|
205
- # Leaf level: no hash children, just decorate
206
- decorate_keys(partition, prev_partitions[pid] || EMPTY_HASH, change_d)
207
- end
204
+ decorate_partitions(partitions, prev_partitions, change_d)
208
205
  end
209
206
  end
210
207
  end
@@ -248,6 +245,19 @@ module Karafka
248
245
  end
249
246
  end
250
247
 
248
+ # Decorates partitions within a topic. Extracted as a method so subclasses can
249
+ # override to filter which partitions are decorated (e.g. skip unassigned partitions
250
+ # in a consumer context).
251
+ #
252
+ # @param partitions [Hash] partition id => partition stats hash
253
+ # @param prev_partitions [Hash] previous partition stats
254
+ # @param change_d [Integer] time delta in ms
255
+ def decorate_partitions(partitions, prev_partitions, change_d)
256
+ partitions.each_pair do |pid, partition|
257
+ decorate_keys(partition, prev_partitions[pid] || EMPTY_HASH, change_d)
258
+ end
259
+ end
260
+
251
261
  # Decorates only the keys listed in @only_keys via direct hash access.
252
262
  # No iteration over the full hash, no type checking on non-target keys.
253
263
  #
@@ -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.12"
7
+ VERSION = "2.5.13"
8
8
  end
9
9
  end
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.12
4
+ version: 2.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld