karafka-core 2.4.10 → 2.4.11

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: 798eaca53e61de396b7cf8d5a0ccf2350a8388016a7e8bc91056249622c81a4d
4
- data.tar.gz: 8213135229dcaddbeeb87cfeb02a6301849b8ec5184fa72f5283dbc86da8be84
3
+ metadata.gz: 4734e30a8ecdbf8bb12ea390afbc496b29c52a60c2f69dd149f126569ef2737a
4
+ data.tar.gz: 27447bac9ec8a2559b6262e9643712f2e48ee45529dc2c3adf56e8591f3d0a94
5
5
  SHA512:
6
- metadata.gz: a0c0ce5c5724470370578cc48c38e06bcf714730cec7d488db61e5651e8d47e9525cebb8c1219fb515432e7390f34879deb8b8abc87130e9dbc88b48bf715f73
7
- data.tar.gz: b004561540f9689926bfc248fc13bf9e1b874c33d7607f3803915822bd09c4864386608e1074f0ab53128c659b7f2ac9aef9c97d37e794ebe43c27a906d6a0e2
6
+ metadata.gz: '040916155d0c32b9735cb654f96f61539c9a6a99aecb6991e29c7a985dcb93ea1aca0ecb0fbd04ec9f619623e54490c9e94f91d1d3c97cd4b99f2f8f857749f9'
7
+ data.tar.gz: 82f9912864a04bf1ae852cdb1c5ec3287462fca20f67655fbc3649ea8d6b630c7aa45aed9ae36e6d1c07525ab8d0485326b619641172e95832eedaf86539eeee
checksums.yaml.gz.sig CHANGED
Binary file
@@ -32,7 +32,7 @@ jobs:
32
32
  - ruby: '3.4'
33
33
  coverage: 'true'
34
34
  steps:
35
- - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
35
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36
36
  with:
37
37
  fetch-depth: 0
38
38
 
@@ -40,7 +40,7 @@ jobs:
40
40
  run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
41
41
 
42
42
  - name: Set up Ruby
43
- uses: ruby/setup-ruby@6c79f721fa26dd64559c2700086ac852c18e0756
43
+ uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
44
44
  with:
45
45
  ruby-version: ${{matrix.ruby}}
46
46
  bundler: 'latest'
@@ -67,11 +67,11 @@ jobs:
67
67
  strategy:
68
68
  fail-fast: false
69
69
  steps:
70
- - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
70
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71
71
  with:
72
72
  fetch-depth: 0
73
73
  - name: Set up Ruby
74
- uses: ruby/setup-ruby@6c79f721fa26dd64559c2700086ac852c18e0756
74
+ uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
75
75
  with:
76
76
  ruby-version: 3.4
77
77
  - name: Install latest bundler
@@ -87,7 +87,7 @@ jobs:
87
87
  strategy:
88
88
  fail-fast: false
89
89
  steps:
90
- - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
90
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91
91
  with:
92
92
  fetch-depth: 0
93
93
  - name: Download Coditsu script
@@ -7,10 +7,10 @@ jobs:
7
7
  verify:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
10
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11
11
  - name: Check SHA pins
12
12
  run: |
13
- if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)" .github/workflows/; then
13
+ if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
14
14
  echo "::error::Actions should use SHA pins, not tags or branch names"
15
15
  exit 1
16
16
  fi
data/CHANGELOG.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Karafka Core Changelog
2
2
 
3
+ ## 2.4.11 (2025-03-20)
4
+ - [Enhancement] Rename internal node `#name` method to `#node_name` so we can use `#name` as the attribute name.
5
+
3
6
  ## 2.4.10 (2025-03-14)
4
- - Relax lock on `karafka-rdkafka`
7
+ - [Fix] Relax lock on `karafka-rdkafka`
5
8
 
6
9
  ## 2.4.9 (2025-03-03)
7
10
  - [Enhancement] Remove `RspecLocator` dependency on `activesupport`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.4.10)
4
+ karafka-core (2.4.11)
5
5
  karafka-rdkafka (>= 0.17.6, < 0.20.0)
6
6
  logger (>= 1.6.0)
7
7
 
@@ -12,3 +12,4 @@ en:
12
12
  missing: needs to be present
13
13
  id_format: needs to be a String
14
14
  test_format: needs to be nil
15
+ name_format: needs to be name
@@ -4,7 +4,7 @@ module Karafka
4
4
  module Core
5
5
  module Configurable
6
6
  # Single end config value representation
7
- Leaf = Struct.new(:name, :default, :constructor, :compiled, :lazy) do
7
+ Leaf = Struct.new(:node_name, :default, :constructor, :compiled, :lazy) do
8
8
  # @return [Boolean] true if already compiled
9
9
  def compiled?
10
10
  compiled
@@ -10,15 +10,15 @@ module Karafka
10
10
  # we only compile/initialize the values prior to user running the `#configure` API. This API
11
11
  # needs to run prior to using the result stuff even if there is nothing to configure
12
12
  class Node
13
- attr_reader :name, :nestings
13
+ attr_reader :node_name, :nestings
14
14
 
15
15
  # We need to be able to redefine children for deep copy
16
16
  attr_accessor :children
17
17
 
18
- # @param name [Symbol] node name
18
+ # @param node_name [Symbol] node name
19
19
  # @param nestings [Proc] block for nested settings
20
- def initialize(name, nestings = ->(_) {})
21
- @name = name
20
+ def initialize(node_name, nestings = ->(_) {})
21
+ @node_name = node_name
22
22
  @children = []
23
23
  @nestings = nestings
24
24
  @compiled = false
@@ -27,16 +27,16 @@ module Karafka
27
27
 
28
28
  # Allows for a single leaf or nested node definition
29
29
  #
30
- # @param name [Symbol] setting or nested node name
30
+ # @param node_name [Symbol] setting or nested node name
31
31
  # @param default [Object] default value
32
32
  # @param constructor [#call, nil] callable or nil
33
33
  # @param lazy [Boolean] is this a lazy leaf
34
34
  # @param block [Proc] block for nested settings
35
- def setting(name, default: nil, constructor: nil, lazy: false, &block)
35
+ def setting(node_name, default: nil, constructor: nil, lazy: false, &block)
36
36
  @children << if block
37
- Node.new(name, block)
37
+ Node.new(node_name, block)
38
38
  else
39
- Leaf.new(name, default, constructor, false, lazy)
39
+ Leaf.new(node_name, default, constructor, false, lazy)
40
40
  end
41
41
 
42
42
  compile
@@ -47,7 +47,7 @@ module Karafka
47
47
  # Compile settings, allow for overrides via yielding
48
48
  # @return [Node] returns self after configuration
49
49
  def configure
50
- compile if !@compiled || name == :root
50
+ compile if !@compiled || node_name == :root
51
51
  yield(self) if block_given?
52
52
  self
53
53
  end
@@ -57,14 +57,14 @@ module Karafka
57
57
  config = {}
58
58
 
59
59
  @children.each do |value|
60
- config[value.name] = if value.is_a?(Leaf)
61
- result = public_send(value.name)
62
- # We need to check if value is not a result node for cases where
63
- # we merge additional config
64
- result.is_a?(Node) ? result.to_h : result
65
- else
66
- value.to_h
67
- end
60
+ config[value.node_name] = if value.is_a?(Leaf)
61
+ result = public_send(value.node_name)
62
+ # We need to check if value is not a result node for cases
63
+ # where we merge additional config
64
+ result.is_a?(Node) ? result.to_h : result
65
+ else
66
+ value.to_h
67
+ end
68
68
  end
69
69
 
70
70
  config.freeze
@@ -74,7 +74,7 @@ module Karafka
74
74
  # and non-side-effect usage on an instance/inherited.
75
75
  # @return [Node] duplicated node
76
76
  def deep_dup
77
- dupped = Node.new(name, nestings)
77
+ dupped = Node.new(node_name, nestings)
78
78
 
79
79
  dupped.children += children.map do |value|
80
80
  if value.is_a?(Leaf)
@@ -96,12 +96,12 @@ module Karafka
96
96
  @children.each do |value|
97
97
  # Do not redefine something that was already set during compilation
98
98
  # This will allow us to reconfigure things and skip override with defaults
99
- skippable = respond_to?(value.name) || (value.is_a?(Leaf) && value.compiled?)
99
+ skippable = respond_to?(value.node_name) || (value.is_a?(Leaf) && value.compiled?)
100
100
  lazy_leaf = value.is_a?(Leaf) && value.lazy?
101
101
 
102
102
  # Do not create accessor for leafs that are lazy as they will get a custom method
103
103
  # created instead
104
- singleton_class.attr_accessor(value.name) unless lazy_leaf
104
+ singleton_class.attr_accessor(value.node_name) unless lazy_leaf
105
105
 
106
106
  next if skippable
107
107
 
@@ -123,7 +123,7 @@ module Karafka
123
123
  if lazy_leaf && !initialized
124
124
  build_dynamic_accessor(value)
125
125
  else
126
- public_send("#{value.name}=", initialized)
126
+ public_send("#{value.node_name}=", initialized)
127
127
  end
128
128
  end
129
129
 
@@ -139,16 +139,16 @@ module Karafka
139
139
  #
140
140
  # @param value [Leaf]
141
141
  def build_dynamic_accessor(value)
142
- singleton_class.attr_writer(value.name)
142
+ singleton_class.attr_writer(value.node_name)
143
143
 
144
- define_singleton_method(value.name) do
145
- existing = instance_variable_get("@#{value.name}")
144
+ define_singleton_method(value.node_name) do
145
+ existing = instance_variable_get("@#{value.node_name}")
146
146
 
147
147
  return existing if existing
148
148
 
149
149
  built = call_constructor(value)
150
150
 
151
- instance_variable_set("@#{value.name}", built)
151
+ instance_variable_set("@#{value.node_name}", built)
152
152
  end
153
153
  end
154
154
 
@@ -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.4.10'
7
+ VERSION = '2.4.11'
8
8
  end
9
9
  end
data/renovate.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
3
  "extends": [
4
- "config:base"
4
+ "config:recommended"
5
5
  ],
6
6
  "github-actions": {
7
7
  "enabled": true,
@@ -9,7 +9,9 @@
9
9
  },
10
10
  "packageRules": [
11
11
  {
12
- "matchManagers": ["github-actions"],
12
+ "matchManagers": [
13
+ "github-actions"
14
+ ],
13
15
  "minimumReleaseAge": "7 days"
14
16
  }
15
17
  ]
data.tar.gz.sig CHANGED
Binary file
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.4.10
4
+ version: 2.4.11
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-03-14 00:00:00.000000000 Z
37
+ date: 2025-03-20 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: karafka-rdkafka
metadata.gz.sig CHANGED
Binary file