sidekiq-tasks 0.1.7 → 0.1.8

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: d6863627c4991d61e6f1347c061ec8a9c063553d9bee738e84bc3494d38a7b74
4
- data.tar.gz: 7a2566b801e14235edcf36df0963a9e0d6656eac5d1ef6f0d319937968544d4b
3
+ metadata.gz: 9d5973e69de00ba6c53592cda231856f13bb1c18795d67938121573eb40526c2
4
+ data.tar.gz: 7f58c1afbff9bc66e1e6c742cc0dc1a74dd7415201977aca021cca445a32fc5c
5
5
  SHA512:
6
- metadata.gz: 4da5a2d4ee995b4f5aed9dd822f4419ec6c0c2743f3737ed406f75ebb6b701d15f8620f31b936c97cd6cb02415178ca3847ede01be78b6d28fcf26c1691df346
7
- data.tar.gz: fbecf721dc29a700ecb3a1833f276319b2a62ff35ab4425d9be76629c7a242991017dfeb50137d56266e0022efe97a19722e209d8b3381f39e2120f4e4370cac
6
+ metadata.gz: b1c7bd390583a1456694330def614d4a85b26a23b0c18af9cd4bea9711fe55e13ded4617ecf60a20afd58a53e258c363d2f2c49ffaafd87af3d3662e3b596c8b
7
+ data.tar.gz: 683d90b2c4fd4e0c648ada7fbd13116c27da624745783ed77f70336c52efe4519acea5daf8425e25df36cc044ab213fd04fa35e0ba2c8098cbb888e2fe0aa534
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Changelog
2
2
 
3
+ ### [0.1.8] - 2026-03-06
4
+
5
+ - Replace deprecated `webdrivers` gem with `selenium-webdriver`.
6
+ - Avoid duplicate CI runs on pull request branches.
7
+ - Fix `retry` option validation to accept integer values.
8
+ - Add `retry_for` option support (Sidekiq 7.1.3+).
9
+ - Fix `find_by` to use exact name matching instead of fuzzy matching.
10
+ - Disable live poll on tasks pages to prevent form state loss (Sidekiq >= 7.0.1).
11
+ - Escape filter parameter in tasks view to prevent HTML injection.
12
+
3
13
  ### [0.1.7] - 2025-07-27
4
14
 
5
15
  - Support multiline description in task view.
data/README.md CHANGED
@@ -10,6 +10,11 @@ Sidekiq-Tasks extends Sidekiq by providing an interface to enqueue tasks directl
10
10
 
11
11
  ![Task view](docs/task.png)
12
12
 
13
+ ## Requirements
14
+
15
+ - Ruby >= 3.0
16
+ - Sidekiq >= 6.5 (compatible with 6.5, 7.x, and 8.x)
17
+
13
18
  ## Installation
14
19
 
15
20
  ```bash
@@ -190,6 +195,8 @@ Sidekiq::Tasks.configure do |config|
190
195
  end
191
196
  ```
192
197
 
198
+ All standard [Sidekiq job options](https://github.com/sidekiq/sidekiq/wiki/Advanced-Options#jobs) are supported.
199
+
193
200
  You can also override the `enqueue_task` method to implement your own enqueuing logic for your strategy:
194
201
 
195
202
  ```ruby
@@ -218,6 +225,14 @@ end
218
225
  >[!NOTE]
219
226
  > The `Tasks` button in the header will still be displayed regardless of the value of `authorization`.
220
227
 
228
+ ## Execution history
229
+
230
+ Each task keeps a history of its last 10 executions, stored in Redis. The task detail page displays for each execution:
231
+
232
+ - The enqueue, start, and finish timestamps
233
+ - The arguments passed
234
+ - The error message if the execution failed
235
+
221
236
  ## Development
222
237
 
223
238
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -29,7 +29,8 @@ module Sidekiq
29
29
  def sidekiq_options=(options)
30
30
  validate_class!(options, [Hash], "sidekiq_options")
31
31
  validate_hash_option!(options, :queue, [String])
32
- validate_hash_option!(options, :retry, [TrueClass, FalseClass])
32
+ validate_hash_option!(options, :retry, [NilClass, TrueClass, FalseClass, Integer])
33
+ validate_hash_option!(options, :retry_for, [NilClass, Integer, Float])
33
34
  validate_hash_option!(options, :dead, [NilClass, TrueClass, FalseClass])
34
35
  validate_hash_option!(options, :backtrace, [NilClass, TrueClass, FalseClass, Integer])
35
36
  validate_hash_option!(options, :pool, [NilClass, String])
@@ -29,7 +29,7 @@ module Sidekiq
29
29
  end
30
30
 
31
31
  def find_by(name: nil)
32
- where(name: name).first
32
+ objects.find { |object| object.name == name }
33
33
  end
34
34
 
35
35
  def find_by!(name: nil)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Tasks
5
- VERSION = "0.1.7"
5
+ VERSION = "0.1.8"
6
6
  end
7
7
  end
@@ -25,6 +25,12 @@ module Sidekiq
25
25
  keys.to_h { |key| [key.to_sym, fetch_param(key)] }
26
26
  end
27
27
 
28
+ def pollable?
29
+ return false if current_path.start_with?("tasks")
30
+
31
+ super
32
+ end
33
+
28
34
  def authorize!
29
35
  return if Sidekiq::Tasks.config.authorization.call(env)
30
36
 
@@ -6,6 +6,7 @@ module Sidekiq
6
6
  autoload :Extension, "sidekiq/tasks/web/extension"
7
7
 
8
8
  ROOT = File.expand_path("../../../web", File.dirname(__FILE__))
9
+ SIDEKIQ_GTE_7_0_1 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("7.0.1")
9
10
  SIDEKIQ_GTE_7_3_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("7.3.0")
10
11
  SIDEKIQ_GTE_8_0_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("8.0.0")
11
12
  end
data/web/views/tasks.erb CHANGED
@@ -12,7 +12,13 @@
12
12
 
13
13
  <header class="st-header">
14
14
  <form action="<%= root_path %>tasks" method="get" class="st-search-form">
15
- <input name="filter" class="st-input" type="text" value="<%= @search.filter %>" placeholder="<%= t("search") %>">
15
+ <input
16
+ name="filter"
17
+ class="st-input"
18
+ type="text"
19
+ value="<%= Rack::Utils.escape_html(@search.filter.to_s) %>"
20
+ placeholder="<%= t("search") %>"
21
+ >
16
22
 
17
23
  <select name="count" class="st-select">
18
24
  <% Sidekiq::Tasks::Web::Search.count_options.each do |count| %>
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-07-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -151,7 +150,7 @@ dependencies:
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
153
152
  - !ruby/object:Gem::Dependency
154
- name: sidekiq
153
+ name: selenium-webdriver
155
154
  requirement: !ruby/object:Gem::Requirement
156
155
  requirements:
157
156
  - - ">="
@@ -165,7 +164,7 @@ dependencies:
165
164
  - !ruby/object:Gem::Version
166
165
  version: '0'
167
166
  - !ruby/object:Gem::Dependency
168
- name: simplecov
167
+ name: sidekiq
169
168
  requirement: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - ">="
@@ -179,7 +178,7 @@ dependencies:
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
180
  - !ruby/object:Gem::Dependency
182
- name: simplecov-json
181
+ name: simplecov
183
182
  requirement: !ruby/object:Gem::Requirement
184
183
  requirements:
185
184
  - - ">="
@@ -193,7 +192,7 @@ dependencies:
193
192
  - !ruby/object:Gem::Version
194
193
  version: '0'
195
194
  - !ruby/object:Gem::Dependency
196
- name: webdrivers
195
+ name: simplecov-json
197
196
  requirement: !ruby/object:Gem::Requirement
198
197
  requirements:
199
198
  - - ">="
@@ -290,7 +289,6 @@ metadata:
290
289
  homepage_uri: https://github.com/victorauthiat/sidekiq-tasks
291
290
  source_code_uri: https://github.com/victorauthiat/sidekiq-tasks/blob/master
292
291
  changelog_uri: https://github.com/victorauthiat/sidekiq-tasks/blob/master/CHANGELOG.md
293
- post_install_message:
294
292
  rdoc_options: []
295
293
  require_paths:
296
294
  - lib
@@ -305,8 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
303
  - !ruby/object:Gem::Version
306
304
  version: '0'
307
305
  requirements: []
308
- rubygems_version: 3.5.22
309
- signing_key:
306
+ rubygems_version: 3.6.9
310
307
  specification_version: 4
311
308
  summary: Sidekiq extension for launching tasks.
312
309
  test_files: []