sidekiq 7.3.6 → 7.3.7

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: 6c9bd0a03b27535a34a0525397e84c429a9332e6754dba43c088558ab8f362e9
4
- data.tar.gz: '08fee2db2d83996d1df6f78e7eb9a226cb98d951cba336dd422771f9127cf95a'
3
+ metadata.gz: 5ea55d72538bcb50922f70f95398326d17853da6a3c2948c9e2812284e8aba22
4
+ data.tar.gz: d18ff9909dded3154993fde2413f33630990cdfa42134fd640f7f714f0fd03ac
5
5
  SHA512:
6
- metadata.gz: f4876eb7594d0c87e4dba08a752dbcb65bbf45ae8213fb9b9ee6a1e12d7a48750c161ffe632f3b13eacfed73de3c3c73a9dc06a2548ddf7e5f6dde0f7de161bd
7
- data.tar.gz: a0f485adef4ba6751114daf0d2c1d509966d530bc620e00ebf17a9c244f1eb0821ae5e8214d88d3652106d932cae7acfd2b66874647acc8c33fe6ec2e3b9d691
6
+ metadata.gz: 40d7243cfbce6285d5560c81c55fcae66eacf1251e130bc2b8f8bbf58feadbb1538935760f8dbd07279f9076a92c7f1b276e28daf1fa3593f984fcbc6b8622eb
7
+ data.tar.gz: cbc6c05c11fb9ac4be45da59400e1bc31da98c14a8054318680c2498c34797199d32719eb1985a3061d61c54ce244bde5eaa3e9284b9484772766d2eb4b50cd0
data/Changes.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
4
4
 
5
+ 7.3.7
6
+ ----------
7
+
8
+ - Backport `Sidekiq::Web.configure` for compatibility with 8.0 [#6532]
9
+ - Backport `url_params(key)` and `route_params(key)` for compatibility with 8.0 [#6532]
10
+ - Various fixes for UI filtering [#6508]
11
+ - Tune `inspect` for internal S::Components to keep size managable [#6553]
12
+
5
13
  7.3.6
6
14
  ----------
7
15
 
@@ -64,5 +64,27 @@ module Sidekiq
64
64
  end
65
65
  arr.clear if oneshot # once we've fired an event, we never fire it again
66
66
  end
67
+
68
+ # When you have a large tree of components, the `inspect` output
69
+ # can get out of hand, especially with lots of Sidekiq::Config
70
+ # references everywhere. We avoid calling `inspect` on more complex
71
+ # state and use `to_s` instead to keep output manageable, #6553
72
+ def inspect
73
+ "#<#{self.class.name} #{
74
+ instance_variables.map do |name|
75
+ value = instance_variable_get(name)
76
+ case value
77
+ when Proc
78
+ "#{name}=#{value}"
79
+ when Sidekiq::Config
80
+ "#{name}=#{value}"
81
+ when Sidekiq::Component
82
+ "#{name}=#{value}"
83
+ else
84
+ "#{name}=#{value.inspect}"
85
+ end
86
+ end.join(", ")
87
+ }>"
88
+ end
67
89
  end
68
90
  end
@@ -61,6 +61,12 @@ module Sidekiq
61
61
  def_delegators :@options, :[], :[]=, :fetch, :key?, :has_key?, :merge!, :dig
62
62
  attr_reader :capsules
63
63
 
64
+ def inspect
65
+ "#<#{self.class.name} @options=#{
66
+ @options.except(:lifecycle_events, :reloader, :death_handlers, :error_handlers).inspect
67
+ }>"
68
+ end
69
+
64
70
  def to_json(*)
65
71
  Sidekiq.dump_json(@options)
66
72
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "7.3.6"
4
+ VERSION = "7.3.7"
5
5
  MAJOR = 7
6
6
 
7
7
  def self.gem_version
@@ -27,6 +27,7 @@ module Sidekiq
27
27
  redirect current_location
28
28
  end
29
29
 
30
+ # deprecated, will warn in 8.0
30
31
  def params
31
32
  indifferent_hash = Hash.new { |hash, key| hash[key.to_s] if Symbol === key }
32
33
 
@@ -36,8 +37,19 @@ module Sidekiq
36
37
  indifferent_hash
37
38
  end
38
39
 
39
- def route_params
40
- env[WebRouter::ROUTE_PARAMS]
40
+ # Use like `url_params("page")` within your action blocks
41
+ def url_params(key)
42
+ request.params[key]
43
+ end
44
+
45
+ # Use like `route_params(:name)` within your action blocks
46
+ # key is required in 8.0, nil is only used for backwards compatibility
47
+ def route_params(key = nil)
48
+ if key
49
+ env[WebRouter::ROUTE_PARAMS][key]
50
+ else
51
+ env[WebRouter::ROUTE_PARAMS]
52
+ end
41
53
  end
42
54
 
43
55
  def session
@@ -184,7 +184,7 @@ module Sidekiq
184
184
  end
185
185
 
186
186
  post "/morgue" do
187
- redirect(request.path) unless params["key"]
187
+ redirect(request.path) unless url_params("key")
188
188
 
189
189
  params["key"].each do |key|
190
190
  job = Sidekiq::DeadSet.new.fetch(*parse_params(key)).first
@@ -207,7 +207,7 @@ module Sidekiq
207
207
  end
208
208
 
209
209
  post "/morgue/:key" do
210
- key = route_params[:key]
210
+ key = route_params(:key)
211
211
  halt(404) unless key
212
212
 
213
213
  job = Sidekiq::DeadSet.new.fetch(*parse_params(key)).first
@@ -217,7 +217,7 @@ module Sidekiq
217
217
  end
218
218
 
219
219
  get "/retries" do
220
- x = params[:substr]
220
+ x = url_params("substr")
221
221
 
222
222
  if x && x != ""
223
223
  @retries = search(Sidekiq::RetrySet.new, x)
@@ -111,7 +111,7 @@ module Sidekiq
111
111
  if within.nil?
112
112
  ::Rack::Utils.escape_html(jid)
113
113
  else
114
- "<a href='#{root_path}filter/#{within}?substr=#{jid}'>#{::Rack::Utils.escape_html(jid)}</a>"
114
+ "<a href='#{root_path}#{within}?substr=#{jid}'>#{::Rack::Utils.escape_html(jid)}</a>"
115
115
  end
116
116
  end
117
117
 
@@ -184,7 +184,8 @@ module Sidekiq
184
184
 
185
185
  # sidekiq/sidekiq#3243
186
186
  def unfiltered?
187
- yield unless env["PATH_INFO"].start_with?("/filter/")
187
+ s = url_params("substr")
188
+ yield unless s && s.size > 0
188
189
  end
189
190
 
190
191
  def get_locale
data/lib/sidekiq/web.rb CHANGED
@@ -50,6 +50,11 @@ module Sidekiq
50
50
  end
51
51
 
52
52
  class << self
53
+ # Forward compatibility with 8.0
54
+ def configure
55
+ yield self
56
+ end
57
+
53
58
  def settings
54
59
  self
55
60
  end
data/web/views/morgue.erb CHANGED
@@ -3,7 +3,7 @@
3
3
  <% if @dead.size > 0 && @total_size > @count %>
4
4
  <%= erb :_paging, locals: { url: "#{root_path}morgue" } %>
5
5
  <% end %>
6
- <%= filtering('dead') %>
6
+ <%= filtering('morgue') %>
7
7
  </div>
8
8
 
9
9
  <% if @dead.size > 0 %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.6
4
+ version: 7.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-20 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  - !ruby/object:Gem::Version
233
233
  version: '0'
234
234
  requirements: []
235
- rubygems_version: 3.5.16
235
+ rubygems_version: 3.5.22
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: Simple, efficient background processing for Ruby