waterdrop 2.8.2 → 2.8.4

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: f1dd1ecba0be29bdf637575f0fe8eaea654900f7466d5840c62fbcdeb5000492
4
- data.tar.gz: 663b683a670ec1df3700dd3440c80435b376c493bcdb7d024eedcc9a9c7b0de9
3
+ metadata.gz: 35cafc9c123ce50a97b59e067381fb2f3ca09909e44a6571565c605dc921aac5
4
+ data.tar.gz: 6402fc7e0460c58b7fb65706d1c57e239fde3ba262812663cd72c1906590a730
5
5
  SHA512:
6
- metadata.gz: 8ff3c1d142dd9d855c7a26223ceefa973764dfde23b0ec8530999e87d52b7827b7180b30dd1f9f545a65eb7e1b00a8ddf753baa4fa365b93ec997450491ddc9b
7
- data.tar.gz: 0fee34d4935ee757fef55ae9205570894b20894b839a1e6abd80fa918eb7d733603a0c791b3d81c73fd913699f07a1ddf1d3af9921722713accdb8bc90a17255
6
+ metadata.gz: aab2db95b7b60dda60d21175c7690bf8dfca3b48cc9b8df5616d4bbbda71317e1bc7a2b63f8d24d136b5e69f3bdf9962faee931a19b9f3caccce02d854be9260
7
+ data.tar.gz: 49a9d9c4069618a21c4bf141bd8075aa47ecb6b01d8bc9fa2af14d86fb5a54b8946ec96ee1ec3bdd3d5e414f3880b34db3fafc7676cdcd01c523dc38296f18ee
@@ -0,0 +1,3 @@
1
+ /.github @mensfeld
2
+ /.github/workflows/ @mensfeld
3
+ /.github/actions/ @mensfeld
@@ -6,12 +6,18 @@ concurrency:
6
6
 
7
7
  on:
8
8
  pull_request:
9
+ branches: [ main, master ]
9
10
  push:
11
+ branches: [ main, master ]
10
12
  schedule:
11
13
  - cron: '0 1 * * *'
12
14
 
15
+ permissions:
16
+ contents: read
17
+
13
18
  jobs:
14
19
  specs:
20
+ timeout-minutes: 15
15
21
  runs-on: ubuntu-latest
16
22
  needs: diffend
17
23
  strategy:
@@ -26,31 +32,31 @@ jobs:
26
32
  - ruby: '3.4'
27
33
  coverage: 'true'
28
34
  steps:
29
- - uses: actions/checkout@v4
35
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36
+ with:
37
+ fetch-depth: 0
30
38
 
31
39
  - name: Install package dependencies
32
40
  run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
33
41
 
34
42
  - name: Set up Ruby
35
- uses: ruby/setup-ruby@v1
43
+ uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0
36
44
  with:
37
45
  ruby-version: ${{matrix.ruby}}
38
46
  bundler-cache: true
39
47
  bundler: 'latest'
40
48
 
41
- - name: Run Kafka with docker compose
49
+ - name: Run Kafka with Docker Compose
42
50
  run: |
43
51
  docker compose up -d || (sleep 5 && docker compose up -d)
44
52
 
45
53
  - name: Wait for Kafka
46
- run: |
47
- sleep 15
54
+ run: sleep 15
48
55
 
49
56
  - name: Install latest bundler
50
57
  run: |
51
58
  gem install bundler --no-document
52
59
  gem update --system --no-document
53
-
54
60
  bundle config set without 'tools benchmarks docs'
55
61
 
56
62
  - name: Bundle install
@@ -66,16 +72,20 @@ jobs:
66
72
  - name: Check Kafka logs for unexpected warnings
67
73
  run: bin/verify_kafka_warnings
68
74
 
75
+ - name: Check test topics naming convention
76
+ run: bin/verify_topics_naming
77
+
69
78
  diffend:
79
+ timeout-minutes: 5
70
80
  runs-on: ubuntu-latest
71
81
  strategy:
72
82
  fail-fast: false
73
83
  steps:
74
- - uses: actions/checkout@v4
84
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
75
85
  with:
76
86
  fetch-depth: 0
77
87
  - name: Set up Ruby
78
- uses: ruby/setup-ruby@v1
88
+ uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0
79
89
  with:
80
90
  ruby-version: 3.4
81
91
  - name: Install latest bundler
@@ -86,12 +96,25 @@ jobs:
86
96
  run: bundle secure
87
97
 
88
98
  coditsu:
99
+ timeout-minutes: 5
89
100
  runs-on: ubuntu-latest
90
101
  strategy:
91
102
  fail-fast: false
92
103
  steps:
93
- - uses: actions/checkout@v4
104
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94
105
  with:
95
106
  fetch-depth: 0
107
+ - name: Download Coditsu script
108
+ run: |
109
+ curl -sSL https://api.coditsu.io/run/ci -o coditsu_script.sh
110
+ chmod +x coditsu_script.sh
111
+ - name: Verify Coditsu script checksum
112
+ run: |
113
+ EXPECTED_SHA256="0aecc5aa010f53fca264548a41467a2b0a1208d750ce1da3e98a217304cacbbc"
114
+ ACTUAL_SHA256=$(sha256sum coditsu_script.sh | awk '{ print $1 }')
115
+ if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then
116
+ echo "::error::Checksum verification failed. Expected $EXPECTED_SHA256 but got $ACTUAL_SHA256."
117
+ exit 1
118
+ fi
96
119
  - name: Run Coditsu
97
- run: \curl -sSL https://api.coditsu.io/run/ci | bash
120
+ run: ./coditsu_script.sh
@@ -0,0 +1,36 @@
1
+ name: Push Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'karafka'
14
+ runs-on: ubuntu-latest
15
+ environment: deployment
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@84684c07c1965536eb4802c8daf1a77968df0cb1 # v1.239.0
28
+ with:
29
+ bundler-cache: false
30
+
31
+ - name: Bundle install
32
+ run: |
33
+ bundle install --jobs 4 --retry 3
34
+
35
+ # Release
36
+ - uses: rubygems/release-gem@9e85cb11501bebc2ae661c1500176316d3987059 # v1
@@ -0,0 +1,16 @@
1
+ name: Verify Action Pins
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '.github/workflows/**'
6
+ jobs:
7
+ verify:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11
+ - name: Check SHA pins
12
+ run: |
13
+ if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
14
+ echo "::error::Actions should use SHA pins, not tags or branch names"
15
+ exit 1
16
+ fi
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.1
1
+ 3.4.4
data/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.8.4 (2025-05-23)
4
+ - [Change] Require `karafka-rdkafka` `>= 0.19.2` due to new partition count caching usage.
5
+ - [Change] Move to trusted-publishers and remove signing since no longer needed.
6
+
7
+ ## 2.8.3 (2025-04-08)
8
+ - [Enhancement] Support producing messages with arrays of strings in headers (KIP-82).
9
+ - [Refactor] Introduce a `bin/verify_topics_naming` script to ensure proper test topics naming convention.
10
+ - [Refactor] Remove factory bot and active support requirement in tests/dev.
11
+ - [Change] Require `karafka-rdkafka` `>= 0.19.1` due to KIP-82.
12
+
3
13
  ## 2.8.2 (2025-02-13)
4
14
  - [Feature] Allow for tagging of producer instances similar to how consumers can be tagged.
5
15
  - [Refactor] Ensure all test topics in the test suite start with "it-" prefix.
16
+ - [Refactor] Introduce a `bin/verify_kafka_warnings` script to clean Kafka from temporary test-suite topics.
6
17
 
7
18
  ## 2.8.1 (2024-12-26)
8
19
  - [Enhancement] Raise `WaterDrop::ProducerNotTransactionalError` when attempting to use transactions on a non-transactional producer.
@@ -22,90 +33,6 @@ This release contains **BREAKING** changes. Make sure to read and apply upgrade
22
33
  - [Enhancement] Align the `LoggerListener` async messages to reflect, that messages are delegated to the internal queue and not dispatched.
23
34
  - [Fix] Ensure, that `:dispatched` key for `#produce_many_sync` always contains delivery handles (final) and not delivery reports.
24
35
 
25
- ### Upgrade Notes
26
-
27
- **PLEASE MAKE SURE TO READ AND APPLY THEM!**
28
-
29
- #### `throw(:abort)` No Longer Allowed To Abort Transactions
30
-
31
- Replace:
32
-
33
- ```ruby
34
- producer.transaction do
35
- messages.each do |message|
36
- # Pipe all events
37
- producer.produce_async(topic: 'events', payload: message.raw_payload)
38
- end
39
-
40
- # And abort if more events are no longer needed
41
- throw(:abort) if KnowledgeBase.more_events_needed?
42
- end
43
- ```
44
-
45
- With:
46
-
47
- ```ruby
48
- producer.transaction do
49
- messages.each do |message|
50
- # Pipe all events
51
- producer.produce_async(topic: 'events', payload: message.raw_payload)
52
- end
53
-
54
- # And abort if more events are no longer needed
55
- raise(WaterDrop::AbortTransaction) if KnowledgeBase.more_events_needed?
56
- end
57
- ```
58
-
59
- #### `return`, `break` and `throw` No Longer Allowed Inside Transaction Block
60
-
61
- Previously, transactions would abort if you exited early using `return`, `break`, or `throw`. This could create unexpected behavior, where users might not notice the rollback or have different intentions. For example, the following would trigger a rollback:
62
-
63
- ```ruby
64
- MAX = 10
65
-
66
- def process(messages)
67
- count = 0
68
-
69
- producer.transaction do
70
- messages.each do |message|
71
- count += 1
72
-
73
- producer.produce_async(topic: 'events', payload: message.raw_payload)
74
-
75
- # This would trigger a rollback.
76
- return if count >= MAX
77
- end
78
- end
79
- end
80
- ```
81
-
82
- This is a source of errors, hence such exits are no longer allowed. You can implement similar flow control inside of your methods that are wrapped in a WaterDrop transaction:
83
-
84
- ```ruby
85
- MAX = 10
86
-
87
- def process(messages)
88
- producer.transaction do
89
- # Early return from this method will not affect the transaction.
90
- # It will be committed
91
- insert_with_limit(messages)
92
- end
93
- end
94
-
95
- def insert_with_limit(messages)
96
- count = 0
97
-
98
- messages.each do |message|
99
- count += 1
100
-
101
- producer.produce_async(topic: 'events', payload: message.raw_payload)
102
-
103
- # This would trigger a rollback.
104
- return if count >= MAX
105
- end
106
- end
107
- ```
108
-
109
36
  ## 2.7.4 (2024-07-04)
110
37
  - [Maintenance] Alias `WaterDrop::Errors::AbortTransaction` with `WaterDrop::AbortTransaction`.
111
38
  - [Maintenance] Lower the precision reporting to 100 microseconds in the logger listener.
@@ -146,116 +73,6 @@ This release contains **BREAKING** changes. Make sure to read and apply upgrade
146
73
  - [Fix] Middlewares run twice when using buffered produce.
147
74
  - [Fix] Validations run twice when using buffered produce.
148
75
 
149
- ### Upgrade Notes
150
-
151
- **PLEASE MAKE SURE TO READ AND APPLY THEM!**
152
-
153
- #### `wait_timeout` Configuration No Longer Needed
154
-
155
- The `wait_timeout` WaterDrop configuration option is no longer needed. You can safely remove it.
156
-
157
- ```ruby
158
- producer = WaterDrop::Producer.new
159
-
160
- producer.setup do |config|
161
- # Other config...
162
-
163
- # Remove this, no longer needed
164
- config.wait_timeout = 30
165
- end
166
- ```
167
-
168
- #### Time Settings Format Alignment
169
-
170
- **All** time-related values are now configured in milliseconds instead of some being in seconds and some in milliseconds.
171
-
172
- The values that were changed from seconds to milliseconds are:
173
-
174
- - `max_wait_timeout`
175
- - `wait_backoff_on_queue_full`
176
- - `wait_timeout_on_queue_full`
177
- - `wait_backoff_on_transaction_command, default`
178
-
179
- If you have configured any of those yourself, please replace the seconds representation with milliseconds:
180
-
181
- ```ruby
182
- producer = WaterDrop::Producer.new
183
-
184
- producer.setup do |config|
185
- config.deliver = true
186
-
187
- # Replace this:
188
- config.max_wait_timeout = 30
189
-
190
- # With
191
- config.max_wait_timeout = 30_000
192
- # ...
193
- end
194
- ```
195
-
196
- #### Defaults Alignment
197
-
198
- In this release, we've updated our default settings to address a crucial issue: previous defaults could lead to inconclusive outcomes in synchronous operations due to wait timeout errors. Users often mistakenly believed that a message dispatch was halted because of these errors when, in fact, the timeout was related to awaiting the final dispatch verdict, not the dispatch action itself.
199
-
200
- The new defaults in WaterDrop 2.7.0 eliminate this confusion by ensuring synchronous operation results are always transparent and conclusive. This change aims to provide a straightforward understanding of wait timeout errors, reinforcing that they reflect the wait state, not the dispatch success.
201
-
202
- Below, you can find a table with what has changed, the new defaults, and the current ones in case you want to retain the previous behavior:
203
-
204
- <table>
205
- <thead>
206
- <tr>
207
- <th>Config</th>
208
- <th>Previous Default</th>
209
- <th>New Default</th>
210
- </tr>
211
- </thead>
212
- <tbody>
213
- <tr>
214
- <td>root <code>max_wait_timeout</code></td>
215
- <td>5000 ms (5 seconds)</td>
216
- <td>60000 ms (60 seconds)</td>
217
- </tr>
218
- <tr>
219
- <td>kafka <code>message.timeout.ms</code></td>
220
- <td>300000 ms (5 minutes)</td>
221
- <td>50000 ms (50 seconds)</td>
222
- </tr>
223
- <tr>
224
- <td>kafka <code>transaction.timeout.ms</code></td>
225
- <td>60000 ms (1 minute)</td>
226
- <td>55000 ms (55 seconds)</td>
227
- </tr>
228
- </tbody>
229
- </table>
230
-
231
- This alignment ensures that when using sync operations or invoking `#wait`, any exception you get should give you a conclusive and final delivery verdict.
232
-
233
- #### Buffering No Longer Early Validates Messages
234
-
235
- As of version `2.7.0`, WaterDrop has changed how message buffering works. Previously, messages underwent validation and middleware processing when they were buffered. Now, these steps are deferred until just before dispatching the messages. The buffer functions strictly as a thread-safe storage area without performing any validations or middleware operations until the messages are ready to be sent.
236
-
237
- This adjustment was made primarily to ensure that middleware runs and validations are applied when most relevant—shortly before message dispatch. This approach addresses potential issues with buffers that might hold messages for extended periods:
238
-
239
- - **Temporal Relevance**: Validating and processing messages near their dispatch time helps ensure that actions such as partition assignments reflect the current system state. This is crucial in dynamic environments where system states are subject to rapid changes.
240
-
241
- - **Stale State Management**: By delaying validations and middleware to the dispatch phase, the system minimizes the risk of acting on outdated information, which could lead to incorrect processing or partitioning decisions.
242
-
243
- ```ruby
244
- # Prior to 2.7.0 this would raise an error
245
- producer.buffer(topic: nil, payload: '')
246
- # => WaterDrop::Errors::MessageInvalidError
247
-
248
- # After 2.7.0 buffer will not, but flush_async will
249
- producer.buffer(topic: nil, payload: '')
250
- # => all good here
251
- producer.flush_async(topic: nil, payload: '')
252
- # => WaterDrop::Errors::MessageInvalidError
253
- ```
254
-
255
- #### Middleware Execution Prior to Flush When Buffering
256
-
257
- The timing of middleware execution has been adjusted. Middleware, which was previously run when messages were added to the buffer, will now only execute immediately before the messages are flushed from the buffer and dispatched. This change is similar to the validation-related changes.
258
-
259
76
  ## 2.6.14 (2024-02-06)
260
77
  - [Enhancement] Instrument `producer.connected` and `producer.closing` lifecycle events.
261
78
 
@@ -330,11 +147,6 @@ The timing of middleware execution has been adjusted. Middleware, which was prev
330
147
  - [Enhancement] Introduce `wait_timeout_on_queue_full` with proper meaning. That is, this represents time after which despite backoff the error will be raised. This should allow to raise an error in case the backoff attempts were insufficient. This prevents from a case, where upon never deliverable messages we would end up with an infinite loop.
331
148
  - [Fix] Provide `type` for queue full errors that references the appropriate public API method correctly.
332
149
 
333
- ### Upgrade notes
334
-
335
- 1. Rename `wait_on_queue_full_timeout` to `wait_backoff_on_queue_full`.
336
- 2. Set `wait_on_queue_full` to `false` if you did not use it and do not want.
337
-
338
150
  ## 2.5.3 (2023-05-26)
339
151
  - [Enhancement] Include topic name in the `error.occurred` notification payload.
340
152
  - [Enhancement] Include topic name in the `message.acknowledged` notification payload.
@@ -356,27 +168,6 @@ The timing of middleware execution has been adjusted. Middleware, which was prev
356
168
  - [Fix] Do **not** flush when there is no data to flush in the internal buffer.
357
169
  - [Fix] Wait on the final data flush for short-lived producers to make sure, that the message is actually dispatched by `librdkafka` or timeout.
358
170
 
359
- ### Upgrade notes
360
-
361
- Please note, this **is** a **breaking** release, hence `2.5.0`.
362
-
363
- 1. If you used to catch `WaterDrop::Errors::FlushFailureError` now you need to catch `WaterDrop::Errors::ProduceError`. `WaterDrop::Errors::ProduceManyError` is based on the `ProduceError`, hence it should be enough.
364
- 2. Prior to `2.5.0` there was always a chance of partial dispatches via `produce_many_` methods. Now you can get the info on all the errors via `error.occurred`.
365
- 3. Inline `Rdkafka::RdkafkaError` are now re-raised via `WaterDrop::Errors::ProduceError` and available under `#cause`. Async `Rdkafka::RdkafkaError` errors are still directly available and you can differentiate between errors using the event `type`.
366
- 4. If you are using the Datadog listener, you need to:
367
-
368
- ```ruby
369
- # Replace require:
370
- require 'waterdrop/instrumentation/vendors/datadog/listener'
371
- # With
372
- require 'waterdrop/instrumentation/vendors/datadog/metrics_listener'
373
-
374
- # Replace references of
375
- ::WaterDrop::Instrumentation::Vendors::Datadog::Listener.new
376
- # With
377
- ::WaterDrop::Instrumentation::Vendors::Datadog::MetricsListener.new
378
- ```
379
-
380
171
  ## 2.4.11 (2023-02-24)
381
172
  - Replace the local rspec locator with generalized core one.
382
173
  - Make `::WaterDrop::Instrumentation::Notifications::EVENTS` list public for anyone wanting to re-bind those into a different notification bus.
@@ -400,22 +191,6 @@ require 'waterdrop/instrumentation/vendors/datadog/metrics_listener'
400
191
  ## 2.4.6 (2022-12-10)
401
192
  - Set `statistics.interval.ms` to 5 seconds by default, so the defaults cover all the instrumentation out of the box.
402
193
 
403
- ### Upgrade notes
404
-
405
- If you want to disable `librdkafka` statistics because you do not use them at all, update the `kafka` `statistics.interval.ms` setting and set it to `0`:
406
-
407
- ```ruby
408
- producer = WaterDrop::Producer.new
409
-
410
- producer.setup do |config|
411
- config.deliver = true
412
- config.kafka = {
413
- 'bootstrap.servers': 'localhost:9092',
414
- 'statistics.interval.ms': 0
415
- }
416
- end
417
- ```
418
-
419
194
  ## 2.4.5 (2022-12-10)
420
195
  - Fix invalid error scope visibility.
421
196
  - Cache partition count to improve messages production and lower stress on Kafka when `partition_key` is on.
data/Gemfile CHANGED
@@ -6,12 +6,14 @@ plugin 'diffend'
6
6
 
7
7
  gemspec
8
8
 
9
+ # Relaxed from 2.7 because we support Ruby 3.1
10
+ gem 'zeitwerk', '~> 2.6.18'
11
+
9
12
  group :development do
10
13
  gem 'byebug'
11
14
  end
12
15
 
13
16
  group :test do
14
- gem 'factory_bot'
15
17
  gem 'ostruct'
16
18
  gem 'rspec'
17
19
  gem 'simplecov'
data/Gemfile.lock CHANGED
@@ -1,86 +1,81 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (2.8.2)
5
- karafka-core (>= 2.4.3, < 3.0.0)
6
- karafka-rdkafka (>= 0.17.5)
4
+ waterdrop (2.8.4)
5
+ karafka-core (>= 2.4.9, < 3.0.0)
6
+ karafka-rdkafka (>= 0.19.2)
7
7
  zeitwerk (~> 2.3)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.2.2.1)
13
- base64
14
- benchmark (>= 0.3)
15
- bigdecimal
16
- concurrent-ruby (~> 1.0, >= 1.3.1)
17
- connection_pool (>= 2.2.5)
18
- drb
19
- i18n (>= 1.6, < 2)
20
- logger (>= 1.4.2)
21
- minitest (>= 5.1)
22
- securerandom (>= 0.3)
23
- tzinfo (~> 2.0, >= 2.0.5)
24
- base64 (0.2.0)
25
- benchmark (0.4.0)
26
- bigdecimal (3.1.9)
27
- byebug (11.1.3)
28
- concurrent-ruby (1.3.5)
29
- connection_pool (2.4.1)
30
- diff-lcs (1.5.1)
12
+ byebug (12.0.0)
13
+ diff-lcs (1.6.1)
31
14
  docile (1.4.1)
32
- drb (2.2.1)
33
- factory_bot (6.5.1)
34
- activesupport (>= 6.1.0)
35
- ffi (1.17.0)
36
- i18n (1.14.7)
37
- concurrent-ruby (~> 1.0)
38
- karafka-core (2.4.4)
39
- karafka-rdkafka (>= 0.15.0, < 0.18.0)
40
- karafka-rdkafka (0.17.6)
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)
26
+ karafka-core (2.4.11)
27
+ karafka-rdkafka (>= 0.17.6, < 0.20.0)
28
+ logger (>= 1.6.0)
29
+ karafka-rdkafka (0.20.0.rc2)
41
30
  ffi (~> 1.15)
31
+ logger (>= 1.5)
42
32
  mini_portile2 (~> 2.6)
43
33
  rake (> 12)
44
- logger (1.6.5)
45
- mini_portile2 (2.8.7)
46
- minitest (5.25.4)
34
+ logger (1.7.0)
35
+ mini_portile2 (2.8.8)
47
36
  ostruct (0.6.1)
48
37
  rake (13.2.1)
49
38
  rspec (3.13.0)
50
39
  rspec-core (~> 3.13.0)
51
40
  rspec-expectations (~> 3.13.0)
52
41
  rspec-mocks (~> 3.13.0)
53
- rspec-core (3.13.1)
42
+ rspec-core (3.13.3)
54
43
  rspec-support (~> 3.13.0)
55
44
  rspec-expectations (3.13.3)
56
45
  diff-lcs (>= 1.2.0, < 2.0)
57
46
  rspec-support (~> 3.13.0)
58
- rspec-mocks (3.13.1)
47
+ rspec-mocks (3.13.2)
59
48
  diff-lcs (>= 1.2.0, < 2.0)
60
49
  rspec-support (~> 3.13.0)
61
- rspec-support (3.13.1)
62
- securerandom (0.3.2)
50
+ rspec-support (3.13.2)
63
51
  simplecov (0.22.0)
64
52
  docile (~> 1.1)
65
53
  simplecov-html (~> 0.11)
66
54
  simplecov_json_formatter (~> 0.1)
67
55
  simplecov-html (0.13.1)
68
56
  simplecov_json_formatter (0.1.4)
69
- tzinfo (2.0.6)
70
- concurrent-ruby (~> 1.0)
71
57
  zeitwerk (2.6.18)
72
58
 
73
59
  PLATFORMS
60
+ aarch64-linux-gnu
61
+ aarch64-linux-musl
62
+ arm-linux-gnu
63
+ arm-linux-musl
64
+ arm64-darwin
74
65
  ruby
75
- x86_64-linux
66
+ x86-linux-gnu
67
+ x86-linux-musl
68
+ x86_64-darwin
69
+ x86_64-linux-gnu
70
+ x86_64-linux-musl
76
71
 
77
72
  DEPENDENCIES
78
73
  byebug
79
- factory_bot
80
74
  ostruct
81
75
  rspec
82
76
  simplecov
83
77
  waterdrop!
78
+ zeitwerk (~> 2.6.18)
84
79
 
85
80
  BUNDLED WITH
86
- 2.5.16
81
+ 2.6.7
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'bundler/gem_tasks'
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This script verifies that we do not create (except few needed exceptions) test topics that do
4
+ # not start with the "it-" prefix which is our standard.
5
+ #
6
+ # This ensures that we can clearly identify all test topics for removal in case of doing dev work
7
+ # on a long-lived Kafka cluster without option to fully reset it.
8
+ #
9
+ # It also ensures we have one convention that we can follow.
10
+
11
+ require 'bundler'
12
+ Bundler.setup(:default, :test, :integrations)
13
+ require 'rdkafka'
14
+
15
+ admin = Rdkafka::Config.new('bootstrap.servers': 'localhost:9092').admin
16
+
17
+ invalid = admin
18
+ .metadata
19
+ .topics
20
+ .map { |topic| topic[:topic_name] }
21
+ .select { |topic| !topic.start_with?('it-') }
22
+ .select { |topic| topic.length <= 6 }
23
+
24
+ admin.close
25
+
26
+ invalid.each do |invalid_name|
27
+ puts "#{invalid_name} does not start with the \"it-\" prefix"
28
+ end
29
+
30
+ exit invalid.empty? ? 0 : 1
@@ -39,7 +39,7 @@ en:
39
39
  key_format: must be a non-empty string
40
40
  payload_max_size: is more than `max_payload_size` config value
41
41
  headers_invalid_key_type: all headers keys need to be of type String
42
- headers_invalid_value_type: all headers values need to be of type String
42
+ headers_invalid_value_type: all headers values need to be strings or arrays of strings
43
43
 
44
44
  transactional_offset:
45
45
  consumer_format: 'must respond to #consumer_group_metadata_pointer method'
data/docker-compose.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  services:
2
2
  kafka:
3
3
  container_name: kafka
4
- image: confluentinc/cp-kafka:7.8.1
4
+ image: confluentinc/cp-kafka:7.9.1
5
5
 
6
6
  ports:
7
7
  - 9092:9092
@@ -46,7 +46,12 @@ module WaterDrop
46
46
 
47
47
  message.fetch(:headers).each do |key, value|
48
48
  errors << [%i[headers], :invalid_key_type] unless key.is_a?(String)
49
- errors << [%i[headers], :invalid_value_type] unless value.is_a?(String)
49
+
50
+ # Headers can be either strings or arrays of strings
51
+ next if value.is_a?(String)
52
+ next if value.is_a?(Array) && value.all? { |value| value.is_a?(String) }
53
+
54
+ errors << [%i[headers], :invalid_value_type]
50
55
  end
51
56
 
52
57
  errors
@@ -3,5 +3,5 @@
3
3
  # WaterDrop library
4
4
  module WaterDrop
5
5
  # Current WaterDrop version
6
- VERSION = '2.8.2'
6
+ VERSION = '2.8.4'
7
7
  end
data/renovate.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
3
  "extends": [
4
- "config:base"
4
+ "config:recommended"
5
+ ],
6
+ "github-actions": {
7
+ "enabled": true,
8
+ "pinDigests": true
9
+ },
10
+ "packageRules": [
11
+ {
12
+ "matchManagers": [
13
+ "github-actions"
14
+ ],
15
+ "minimumReleaseAge": "7 days"
16
+ }
5
17
  ]
6
18
  }
data/waterdrop.gemspec CHANGED
@@ -16,17 +16,12 @@ Gem::Specification.new do |spec|
16
16
  spec.description = spec.summary
17
17
  spec.licenses = %w[LGPL-3.0-only Commercial]
18
18
 
19
- spec.add_dependency 'karafka-core', '>= 2.4.3', '< 3.0.0'
20
- spec.add_dependency 'karafka-rdkafka', '>= 0.17.5'
19
+ spec.add_dependency 'karafka-core', '>= 2.4.9', '< 3.0.0'
20
+ spec.add_dependency 'karafka-rdkafka', '>= 0.19.2'
21
21
  spec.add_dependency 'zeitwerk', '~> 2.3'
22
22
 
23
23
  spec.required_ruby_version = '>= 3.1.0'
24
24
 
25
- if $PROGRAM_NAME.end_with?('gem')
26
- spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
27
- end
28
-
29
- spec.cert_chain = %w[certs/cert.pem]
30
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
31
26
  spec.executables = []
32
27
  spec.require_paths = %w[lib]
metadata CHANGED
@@ -1,40 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waterdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.2
4
+ version: 2.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
8
8
  bindir: bin
9
- cert_chain:
10
- - |
11
- -----BEGIN CERTIFICATE-----
12
- MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQDDAdjb250
13
- YWN0MRcwFQYKCZImiZPyLGQBGRYHa2FyYWZrYTESMBAGCgmSJomT8ixkARkWAmlv
14
- MB4XDTI0MDgyMzEwMTkyMFoXDTQ5MDgxNzEwMTkyMFowPzEQMA4GA1UEAwwHY29u
15
- dGFjdDEXMBUGCgmSJomT8ixkARkWB2thcmFma2ExEjAQBgoJkiaJk/IsZAEZFgJp
16
- bzCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKjLhLjQqUlNayxkXnO+
17
- PsmCDs/KFIzhrsYMfLZRZNaWmzV3ujljMOdDjd4snM2X06C41iVdQPWjpe3j8vVe
18
- ZXEWR/twSbOP6Eeg8WVH2wCOo0x5i7yhVn4UBLH4JpfEMCbemVcWQ9ry9OMg4WpH
19
- Uu4dRwxFV7hzCz3p0QfNLRI4miAxnGWcnlD98IJRjBAksTuR1Llj0vbOrDGsL9ZT
20
- JeXP2gdRLd8SqzAFJEWrbeTBCBU7gfSh3oMg5SVDLjaqf7Kz5wC/8bDZydzanOxB
21
- T6CDXPsCnllmvTNx2ei2T5rGYJOzJeNTmJLLK6hJWUlAvaQSvCwZRvFJ0tVGLEoS
22
- flqSr6uGyyl1eMUsNmsH4BqPEYcAV6P2PKTv2vUR8AP0raDvZ3xL1TKvfRb8xRpo
23
- vPopCGlY5XBWEc6QERHfVLTIVsjnls2/Ujj4h8/TSfqqYnaHKefIMLbuD/tquMjD
24
- iWQsW2qStBV0T+U7FijKxVfrfqZP7GxQmDAc9o1iiyAa3QIDAQABo3cwdTAJBgNV
25
- HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU3O4dTXmvE7YpAkszGzR9DdL9
26
- sbEwHQYDVR0RBBYwFIESY29udGFjdEBrYXJhZmthLmlvMB0GA1UdEgQWMBSBEmNv
27
- bnRhY3RAa2FyYWZrYS5pbzANBgkqhkiG9w0BAQsFAAOCAYEAVKTfoLXn7mqdSxIR
28
- eqxcR6Huudg1jes81s1+X0uiRTR3hxxKZ3Y82cPsee9zYWyBrN8TA4KA0WILTru7
29
- Ygxvzha0SRPsSiaKLmgOJ+61ebI4+bOORzIJLpD6GxCxu1r7MI4+0r1u1xe0EWi8
30
- agkVo1k4Vi8cKMLm6Gl9b3wG9zQBw6fcgKwmpjKiNnOLP+OytzUANrIUJjoq6oal
31
- TC+f/Uc0TLaRqUaW/bejxzDWWHoM3SU6aoLPuerglzp9zZVzihXwx3jPLUVKDFpF
32
- Rl2lcBDxlpYGueGo0/oNzGJAAy6js8jhtHC9+19PD53vk7wHtFTZ/0ugDQYnwQ+x
33
- oml2fAAuVWpTBCgOVFe6XCQpMKopzoxQ1PjKztW2KYxgJdIBX87SnL3aWuBQmhRd
34
- i9zWxov0mr44TWegTVeypcWGd/0nxu1+QHVNHJrpqlPBRvwQsUm7fwmRInGpcaB8
35
- ap8wNYvryYzrzvzUxIVFBVM5PacgkFqRmolCa8I7tdKQN+R1
36
- -----END CERTIFICATE-----
37
- date: 2025-02-13 00:00:00.000000000 Z
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
38
11
  dependencies:
39
12
  - !ruby/object:Gem::Dependency
40
13
  name: karafka-core
@@ -42,7 +15,7 @@ dependencies:
42
15
  requirements:
43
16
  - - ">="
44
17
  - !ruby/object:Gem::Version
45
- version: 2.4.3
18
+ version: 2.4.9
46
19
  - - "<"
47
20
  - !ruby/object:Gem::Version
48
21
  version: 3.0.0
@@ -52,7 +25,7 @@ dependencies:
52
25
  requirements:
53
26
  - - ">="
54
27
  - !ruby/object:Gem::Version
55
- version: 2.4.3
28
+ version: 2.4.9
56
29
  - - "<"
57
30
  - !ruby/object:Gem::Version
58
31
  version: 3.0.0
@@ -62,14 +35,14 @@ dependencies:
62
35
  requirements:
63
36
  - - ">="
64
37
  - !ruby/object:Gem::Version
65
- version: 0.17.5
38
+ version: 0.19.2
66
39
  type: :runtime
67
40
  prerelease: false
68
41
  version_requirements: !ruby/object:Gem::Requirement
69
42
  requirements:
70
43
  - - ">="
71
44
  - !ruby/object:Gem::Version
72
- version: 0.17.5
45
+ version: 0.19.2
73
46
  - !ruby/object:Gem::Dependency
74
47
  name: zeitwerk
75
48
  requirement: !ruby/object:Gem::Requirement
@@ -93,10 +66,13 @@ extra_rdoc_files: []
93
66
  files:
94
67
  - ".coditsu/ci.yml"
95
68
  - ".diffend.yml"
69
+ - ".github/CODEOWNERS"
96
70
  - ".github/FUNDING.yml"
97
71
  - ".github/ISSUE_TEMPLATE/bug_report.md"
98
72
  - ".github/ISSUE_TEMPLATE/feature_request.md"
99
73
  - ".github/workflows/ci.yml"
74
+ - ".github/workflows/push.yml"
75
+ - ".github/workflows/verify-action-pins.yml"
100
76
  - ".gitignore"
101
77
  - ".rspec"
102
78
  - ".ruby-gemset"
@@ -106,8 +82,9 @@ files:
106
82
  - Gemfile.lock
107
83
  - LICENSE
108
84
  - README.md
85
+ - Rakefile
109
86
  - bin/verify_kafka_warnings
110
- - certs/cert.pem
87
+ - bin/verify_topics_naming
111
88
  - config/locales/errors.yml
112
89
  - docker-compose.yml
113
90
  - lib/waterdrop.rb
@@ -170,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
147
  - !ruby/object:Gem::Version
171
148
  version: '0'
172
149
  requirements: []
173
- rubygems_version: 3.6.2
150
+ rubygems_version: 3.6.7
174
151
  specification_version: 4
175
152
  summary: Kafka messaging made easy!
176
153
  test_files: []
checksums.yaml.gz.sig DELETED
Binary file
data/certs/cert.pem DELETED
@@ -1,26 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQDDAdjb250
3
- YWN0MRcwFQYKCZImiZPyLGQBGRYHa2FyYWZrYTESMBAGCgmSJomT8ixkARkWAmlv
4
- MB4XDTI0MDgyMzEwMTkyMFoXDTQ5MDgxNzEwMTkyMFowPzEQMA4GA1UEAwwHY29u
5
- dGFjdDEXMBUGCgmSJomT8ixkARkWB2thcmFma2ExEjAQBgoJkiaJk/IsZAEZFgJp
6
- bzCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKjLhLjQqUlNayxkXnO+
7
- PsmCDs/KFIzhrsYMfLZRZNaWmzV3ujljMOdDjd4snM2X06C41iVdQPWjpe3j8vVe
8
- ZXEWR/twSbOP6Eeg8WVH2wCOo0x5i7yhVn4UBLH4JpfEMCbemVcWQ9ry9OMg4WpH
9
- Uu4dRwxFV7hzCz3p0QfNLRI4miAxnGWcnlD98IJRjBAksTuR1Llj0vbOrDGsL9ZT
10
- JeXP2gdRLd8SqzAFJEWrbeTBCBU7gfSh3oMg5SVDLjaqf7Kz5wC/8bDZydzanOxB
11
- T6CDXPsCnllmvTNx2ei2T5rGYJOzJeNTmJLLK6hJWUlAvaQSvCwZRvFJ0tVGLEoS
12
- flqSr6uGyyl1eMUsNmsH4BqPEYcAV6P2PKTv2vUR8AP0raDvZ3xL1TKvfRb8xRpo
13
- vPopCGlY5XBWEc6QERHfVLTIVsjnls2/Ujj4h8/TSfqqYnaHKefIMLbuD/tquMjD
14
- iWQsW2qStBV0T+U7FijKxVfrfqZP7GxQmDAc9o1iiyAa3QIDAQABo3cwdTAJBgNV
15
- HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU3O4dTXmvE7YpAkszGzR9DdL9
16
- sbEwHQYDVR0RBBYwFIESY29udGFjdEBrYXJhZmthLmlvMB0GA1UdEgQWMBSBEmNv
17
- bnRhY3RAa2FyYWZrYS5pbzANBgkqhkiG9w0BAQsFAAOCAYEAVKTfoLXn7mqdSxIR
18
- eqxcR6Huudg1jes81s1+X0uiRTR3hxxKZ3Y82cPsee9zYWyBrN8TA4KA0WILTru7
19
- Ygxvzha0SRPsSiaKLmgOJ+61ebI4+bOORzIJLpD6GxCxu1r7MI4+0r1u1xe0EWi8
20
- agkVo1k4Vi8cKMLm6Gl9b3wG9zQBw6fcgKwmpjKiNnOLP+OytzUANrIUJjoq6oal
21
- TC+f/Uc0TLaRqUaW/bejxzDWWHoM3SU6aoLPuerglzp9zZVzihXwx3jPLUVKDFpF
22
- Rl2lcBDxlpYGueGo0/oNzGJAAy6js8jhtHC9+19PD53vk7wHtFTZ/0ugDQYnwQ+x
23
- oml2fAAuVWpTBCgOVFe6XCQpMKopzoxQ1PjKztW2KYxgJdIBX87SnL3aWuBQmhRd
24
- i9zWxov0mr44TWegTVeypcWGd/0nxu1+QHVNHJrpqlPBRvwQsUm7fwmRInGpcaB8
25
- ap8wNYvryYzrzvzUxIVFBVM5PacgkFqRmolCa8I7tdKQN+R1
26
- -----END CERTIFICATE-----
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file