waterdrop 2.8.2 → 2.8.3

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: c2e1bd150394cd2ff84114c1d42f88c1e1d2dc0aac023244e561eee406b04700
4
+ data.tar.gz: 99bd1741ea65d1cc9cda5a94d0d04979dbfadbf74f2de79f9e93790292d6cea5
5
5
  SHA512:
6
- metadata.gz: 8ff3c1d142dd9d855c7a26223ceefa973764dfde23b0ec8530999e87d52b7827b7180b30dd1f9f545a65eb7e1b00a8ddf753baa4fa365b93ec997450491ddc9b
7
- data.tar.gz: 0fee34d4935ee757fef55ae9205570894b20894b839a1e6abd80fa918eb7d733603a0c791b3d81c73fd913699f07a1ddf1d3af9921722713accdb8bc90a17255
6
+ metadata.gz: fd7f0772a35bd4e421fd46aa54cef6626f9660ad4cecbd9c03d9a912d68dabe994c84f44e7895099008cad4166ffec77fafda3b06aeacec27a707a4a7ed803a4
7
+ data.tar.gz: 8c27c3bf8db0be08f137b0f2649586cf885a9f340b381a075e3d0d20ecad38ce6f3b0ce2a1e40a5131adf67b46f3005664fd9f4b16f91c1cbf6ab93d1713bf38
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.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@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.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,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.2
data/CHANGELOG.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.8.3 (2025-04-08)
4
+ - [Enhancement] Support producing messages with arrays of strings in headers (KIP-82).
5
+ - [Refactor] Introduce a `bin/verify_topics_naming` script to ensure proper test topics naming convention.
6
+ - [Refactor] Remove factory bot and active support requirement in tests/dev.
7
+ - [Change] Require `karafka-rdkafka` `>= 0.19.1` due to KIP-82.
8
+
3
9
  ## 2.8.2 (2025-02-13)
4
10
  - [Feature] Allow for tagging of producer instances similar to how consumers can be tagged.
5
11
  - [Refactor] Ensure all test topics in the test suite start with "it-" prefix.
12
+ - [Refactor] Introduce a `bin/verify_kafka_warnings` script to clean Kafka from temporary test-suite topics.
6
13
 
7
14
  ## 2.8.1 (2024-12-26)
8
15
  - [Enhancement] Raise `WaterDrop::ProducerNotTransactionalError` when attempting to use transactions on a non-transactional producer.
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,80 @@
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.3)
5
+ karafka-core (>= 2.4.9, < 3.0.0)
6
+ karafka-rdkafka (>= 0.19.1)
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.0)
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.1)
16
+ ffi (1.17.1-aarch64-linux-gnu)
17
+ ffi (1.17.1-aarch64-linux-musl)
18
+ ffi (1.17.1-arm-linux-gnu)
19
+ ffi (1.17.1-arm-linux-musl)
20
+ ffi (1.17.1-arm64-darwin)
21
+ ffi (1.17.1-x86-linux-gnu)
22
+ ffi (1.17.1-x86-linux-musl)
23
+ ffi (1.17.1-x86_64-darwin)
24
+ ffi (1.17.1-x86_64-linux-gnu)
25
+ ffi (1.17.1-x86_64-linux-musl)
26
+ karafka-core (2.4.10)
27
+ karafka-rdkafka (>= 0.17.6, < 0.20.0)
28
+ logger (>= 1.6.0)
29
+ karafka-rdkafka (0.19.1)
41
30
  ffi (~> 1.15)
42
31
  mini_portile2 (~> 2.6)
43
32
  rake (> 12)
44
- logger (1.6.5)
45
- mini_portile2 (2.8.7)
46
- minitest (5.25.4)
33
+ logger (1.6.6)
34
+ mini_portile2 (2.8.8)
47
35
  ostruct (0.6.1)
48
36
  rake (13.2.1)
49
37
  rspec (3.13.0)
50
38
  rspec-core (~> 3.13.0)
51
39
  rspec-expectations (~> 3.13.0)
52
40
  rspec-mocks (~> 3.13.0)
53
- rspec-core (3.13.1)
41
+ rspec-core (3.13.3)
54
42
  rspec-support (~> 3.13.0)
55
43
  rspec-expectations (3.13.3)
56
44
  diff-lcs (>= 1.2.0, < 2.0)
57
45
  rspec-support (~> 3.13.0)
58
- rspec-mocks (3.13.1)
46
+ rspec-mocks (3.13.2)
59
47
  diff-lcs (>= 1.2.0, < 2.0)
60
48
  rspec-support (~> 3.13.0)
61
- rspec-support (3.13.1)
62
- securerandom (0.3.2)
49
+ rspec-support (3.13.2)
63
50
  simplecov (0.22.0)
64
51
  docile (~> 1.1)
65
52
  simplecov-html (~> 0.11)
66
53
  simplecov_json_formatter (~> 0.1)
67
54
  simplecov-html (0.13.1)
68
55
  simplecov_json_formatter (0.1.4)
69
- tzinfo (2.0.6)
70
- concurrent-ruby (~> 1.0)
71
56
  zeitwerk (2.6.18)
72
57
 
73
58
  PLATFORMS
59
+ aarch64-linux-gnu
60
+ aarch64-linux-musl
61
+ arm-linux-gnu
62
+ arm-linux-musl
63
+ arm64-darwin
74
64
  ruby
75
- x86_64-linux
65
+ x86-linux-gnu
66
+ x86-linux-musl
67
+ x86_64-darwin
68
+ x86_64-linux-gnu
69
+ x86_64-linux-musl
76
70
 
77
71
  DEPENDENCIES
78
72
  byebug
79
- factory_bot
80
73
  ostruct
81
74
  rspec
82
75
  simplecov
83
76
  waterdrop!
77
+ zeitwerk (~> 2.6.18)
84
78
 
85
79
  BUNDLED WITH
86
- 2.5.16
80
+ 2.6.2
@@ -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.0
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.3'
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,8 +16,8 @@ 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.1'
21
21
  spec.add_dependency 'zeitwerk', '~> 2.3'
22
22
 
23
23
  spec.required_ruby_version = '>= 3.1.0'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -34,7 +34,7 @@ cert_chain:
34
34
  i9zWxov0mr44TWegTVeypcWGd/0nxu1+QHVNHJrpqlPBRvwQsUm7fwmRInGpcaB8
35
35
  ap8wNYvryYzrzvzUxIVFBVM5PacgkFqRmolCa8I7tdKQN+R1
36
36
  -----END CERTIFICATE-----
37
- date: 2025-02-13 00:00:00.000000000 Z
37
+ date: 2025-04-08 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: karafka-core
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 2.4.3
45
+ version: 2.4.9
46
46
  - - "<"
47
47
  - !ruby/object:Gem::Version
48
48
  version: 3.0.0
@@ -52,7 +52,7 @@ dependencies:
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 2.4.3
55
+ version: 2.4.9
56
56
  - - "<"
57
57
  - !ruby/object:Gem::Version
58
58
  version: 3.0.0
@@ -62,14 +62,14 @@ dependencies:
62
62
  requirements:
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 0.17.5
65
+ version: 0.19.1
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 0.17.5
72
+ version: 0.19.1
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: zeitwerk
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -93,10 +93,12 @@ extra_rdoc_files: []
93
93
  files:
94
94
  - ".coditsu/ci.yml"
95
95
  - ".diffend.yml"
96
+ - ".github/CODEOWNERS"
96
97
  - ".github/FUNDING.yml"
97
98
  - ".github/ISSUE_TEMPLATE/bug_report.md"
98
99
  - ".github/ISSUE_TEMPLATE/feature_request.md"
99
100
  - ".github/workflows/ci.yml"
101
+ - ".github/workflows/verify-action-pins.yml"
100
102
  - ".gitignore"
101
103
  - ".rspec"
102
104
  - ".ruby-gemset"
@@ -107,6 +109,7 @@ files:
107
109
  - LICENSE
108
110
  - README.md
109
111
  - bin/verify_kafka_warnings
112
+ - bin/verify_topics_naming
110
113
  - certs/cert.pem
111
114
  - config/locales/errors.yml
112
115
  - docker-compose.yml
metadata.gz.sig CHANGED
Binary file