sidekiq-status 1.1.4 → 2.0.0

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: 852f99075106d76a18f3a0f21a3e49785069af7e8ee479c08959edeeef655439
4
- data.tar.gz: 02fb95b39d1e37a081e64b2442a4c9a19b708d44bb52af24c1ccdff4d3a884c7
3
+ metadata.gz: 8062f467160552b97566de033649c1b33869da92ce3ff168b1a20b1b38340eb6
4
+ data.tar.gz: 2a918b6cb05fe934db2521461b2abf26e4680def459486d4afe143e4a51d0cd6
5
5
  SHA512:
6
- metadata.gz: 7091b83f0ae9277478d75e6d5aab3a29936e76d0cb7c9f671031aa357e8fe2b4f1cacb92716fa3b5b2e474bbde3c5c26f8298195154d798f82d0f52a4e0661e7
7
- data.tar.gz: 58c13e7c9fa8c1712bfbd47fbcb47a5cd69e0804093def9745de5d591d8dc1959e6701c6baff6efb808d305e7fe4f750859d5575f62b2d28f29484b6e2029f02
6
+ metadata.gz: 2d35f5ab165082045af4e53220d72a161a821816a3ec8f8cd8cec7ce2811358b9d78b56d211fea0cae65b5990e7fbbb04f4264e2a3f09588ce9c642cca3a705b
7
+ data.tar.gz: 558584271417c9eb89112268fd779c75f47e90044dd94c799675bec0a0f325a6015000e56a3d64397ed21eee0ae2089b22ad03bd73ed059b1ada368592e42e81
data/.gitignore CHANGED
@@ -4,6 +4,7 @@ gemfiles/*.lock
4
4
  .bundle
5
5
  .config
6
6
  .rvmrc
7
+ .ruby-version
7
8
  .yardoc
8
9
  Gemfile.lock
9
10
  InstalledFiles
data/.travis.yml CHANGED
@@ -1,14 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
- - 2.4
5
- - 2.5
6
3
  - 2.6
4
+ - 2.7
5
+ - 3.0
7
6
  - ruby-head
8
7
  gemfile:
9
- - gemfiles/sidekiq_3.x.gemfile
10
- - gemfiles/sidekiq_4.x.gemfile
11
8
  - gemfiles/sidekiq_5.x.gemfile
9
+ - gemfiles/sidekiq_6.x.gemfile
12
10
  before_install:
13
11
  - gem update --system
14
12
  - gem update bundler
data/Appraisals CHANGED
@@ -1,11 +1,7 @@
1
- appraise "sidekiq-3.x" do
2
- gem "sidekiq", "~> 3"
3
- end
4
-
5
- appraise "sidekiq-4.x" do
6
- gem "sidekiq", "~> 4"
7
- end
8
-
9
1
  appraise "sidekiq-5.x" do
10
2
  gem "sidekiq", "~> 5"
11
3
  end
4
+
5
+ appraise "sidekiq-6.x" do
6
+ gem "sidekiq", "~> 6"
7
+ end
data/CHANGELOG.md CHANGED
@@ -1,71 +1,9 @@
1
- **Version 1.1.4**
2
- * Ensures jobs without sidekiq-status do not record status exceptions (#150)
1
+ **Version 2.0.0**
2
+ * Adds support for Ruby 2.7, 3.0
3
+ * Adds support for Sidekiq 6.x
4
+ * Removes support for Ruby 2.3, 2.4, 2.5
5
+ * Removes support for Sidekiq 3.x, 4.x
3
6
 
4
- **Version 1.1.3**
5
- * Adds a job status filter to the UI (#149)
7
+ **Versions 1.1.4 and prior**
6
8
 
7
- **Version 1.1.2**
8
- * Job detail pages now show custom data keys (#146)
9
-
10
- **Version 1.1.1**
11
- * Uses SCAN rather than KEYS when retrieving job ids from Redis (#139)
12
-
13
- **Version 1.1.0**
14
- + Fixes the use case of multiple services sharing the same Redis instance (#135)
15
-
16
- **Version 1.0.2**
17
- + Fixes status not being set to `:failed` after retries
18
-
19
- **Version 1.0.1**
20
- + Fixes namespacing in `sidekiq-status/testing/inline`
21
-
22
- **Version 1.0.0**
23
- + Version number bumped to indicate stable release
24
-
25
- **Version 0.8.1**
26
- + Avoids transient celluloid dependency in Sidekiq < 5.x
27
-
28
- **Version 0.8.0**
29
- + Properly ignores jobs that do not have `Sidekiq::Status::Worker` included
30
- + Honors custom job expirations for ActiveJob jobs
31
- + Adds a `:retrying` status
32
- + Adds remove / retry buttons to the index page
33
- + Server middleware will now catches all exception types
34
- + Changes where server middleware is inserted in the chain
35
- + Reduces the amount of Redis calls made
36
- + Adds pagination / per page setting
37
- + Restores column sorting functionality
38
-
39
- **Version 0.7.0**
40
- + Sidekiq 4.2 and 5 now supported
41
- + Added full support for ActiveJob
42
- + Updated Web UI
43
- + Styling updated to stay consistent with Sidekiq UI
44
- + Added header sorting
45
- + Fixed argument formatting
46
- + Times now display using natural language via ChronicDuration
47
- + Test suite fixed
48
-
49
- **Version 0.6.0**
50
- + Updated Web UI
51
- + Will have all job statuses, previously it was showing only :working status
52
- + Bootstrap labels instead of badges for status
53
- + Added Arguments column to statuses page
54
- + New :interrupted status added
55
- + Added way to specify :expiration for Sidekiq::Status::ClientMiddleware
56
- + Bug fixes & Code cleanup
57
-
58
- **Version 0.5.3**
59
- + some tweaks in web UI, separate Redis namespace
60
-
61
- **Version 0.5.2**
62
- + Sidekiq versions up to 3.3.* supported, jobs sorting options in web UI, more ruby versions
63
-
64
- **Version 0.5.1**
65
- + dependencies versions requirements relaxed
66
-
67
- **Version 0.5.0**
68
- + Sidekiq v3 support, Redis pools support
69
-
70
- **Version 0.4.0**
71
- + WebUI added, per-worker expiration setting enabled
9
+ See https://github.com/utgarda/sidekiq-status/blob/master/CHANGELOG.md.
data/README.md CHANGED
@@ -1,16 +1,11 @@
1
1
  # Sidekiq::Status
2
- [![Gem Version](https://badge.fury.io/rb/sidekiq-status.svg)](http://badge.fury.io/rb/sidekiq-status)
3
- [![Code Climate](https://codeclimate.com/github/utgarda/sidekiq-status.svg)](https://codeclimate.com/github/utgarda/sidekiq-status)
4
- [![Build Status](https://secure.travis-ci.org/utgarda/sidekiq-status.svg)](http://travis-ci.org/utgarda/sidekiq-status)
5
- [![Dependency Status](https://gemnasium.com/utgarda/sidekiq-status.svg)](https://gemnasium.com/utgarda/sidekiq-status)
6
- [![Inline docs](http://inch-ci.org/github/utgarda/sidekiq-status.svg?branch=master)](http://inch-ci.org/github/utgarda/sidekiq-status)
2
+ [![Gem Version](https://badge.fury.io/rb/sidekiq-status.svg)](https://badge.fury.io/rb/sidekiq-status)
3
+ [![Build Status](https://www.travis-ci.com/kenaniah/sidekiq-status.svg?branch=main)](https://www.travis-ci.com/github/kenaniah/sidekiq-status)
4
+ [![Inline docs](https://inch-ci.org/github/kenaniah/sidekiq-status.svg?branch=main)](https://inch-ci.org/github/kenaniah/sidekiq-status)
7
5
 
8
- An extension to [Sidekiq](http://github.com/mperham/sidekiq) message processing to track your jobs. Inspired
9
- by [resque-status](http://github.com/quirkey/resque-status) and mostly copying its features, using Sidekiq's middleware.
6
+ Sidekiq-status is an extension to [Sidekiq](https://github.com/mperham/sidekiq) that tracks information about your Sidekiq and provides a UI to that purpose. It was inspired by [resque-status](https://github.com/quirkey/resque-status).
10
7
 
11
- Fully compatible with ActiveJob.
12
-
13
- Supports the latest versions of Sidekiq and all the way back to 3.x.
8
+ Requires Ruby 2.6+ and Sidekiq 5.0+ or newer.
14
9
 
15
10
  ## Installation
16
11
 
@@ -20,18 +15,18 @@ Add this line to your application's Gemfile:
20
15
  gem 'sidekiq-status'
21
16
  ```
22
17
 
23
- And then execute:
24
-
25
- ```bash
26
- $ bundle
27
- ```
28
-
29
18
  Or install it yourself as:
30
19
 
31
20
  ```bash
32
21
  gem install sidekiq-status
33
22
  ```
34
23
 
24
+ ### Migrating to Version 2.x from 1.x
25
+
26
+ Version 2.0.0 was published in order to add support for Ruby 3.0 and Sidekiq 6.x and to remove support for versions of both that are now end-of-life. You should be able to upgrade cleanly from version 1.x to 2.x provided you are running Sidekiq 5.x or newer.
27
+
28
+ Sidekiq-status version 1.1.4 provides support all the way back to Sidekiq 3.x and was maintained at https://github.com/utgarda/sidekiq-status/.
29
+
35
30
  ## Setup Checklist
36
31
 
37
32
  To get started:
@@ -63,9 +58,7 @@ Sidekiq.configure_server do |config|
63
58
  end
64
59
  ```
65
60
 
66
- **Note:** This method of configuration is new as of version 0.8.0.
67
-
68
- After that you can use your jobs as usual. You need to also include the `Sidekiq::Status::Worker` module in your jobs if you want the additional functionality of tracking progress and storing / retrieving job data.
61
+ Include the `Sidekiq::Status::Worker` module in your jobs if you want the additional functionality of tracking progress and storing / retrieving job data.
69
62
 
70
63
  ``` ruby
71
64
  class MyJob
@@ -78,7 +71,7 @@ class MyJob
78
71
  end
79
72
  ```
80
73
 
81
- As of version 0.8.0, _only jobs that include `Sidekiq::Status::Worker`_ will have their statuses tracked. Previous versions of this gem used to track statuses for all jobs, even when `Sidekiq::Status::Worker` was not included.
74
+ Note: _only jobs that include `Sidekiq::Status::Worker`_ will have their statuses tracked.
82
75
 
83
76
  To overwrite expiration on a per-worker basis, write an expiration method like the one below:
84
77
 
@@ -105,7 +98,7 @@ As sidekiq-status stores information about jobs in Redis, it is necessary to set
105
98
 
106
99
  As explained above, the default expiration may also be overridden on a per-job basis by defining it within the job itself via a method called `#expiration`.
107
100
 
108
- The expiration time set will be used as the [Redis expire time](http://redis.io/commands/expire), which is also known as the TTL (time to live). Once the expiration time has passed, all information about the job's status and any custom data stored via sidekiq-status will disappear.
101
+ The expiration time set will be used as the [Redis expire time](https://redis.io/commands/expire), which is also known as the TTL (time to live). Once the expiration time has passed, all information about the job's status and any custom data stored via sidekiq-status will disappear.
109
102
 
110
103
  It is advised that you set the expiration time greater than the amount of time required to complete the job.
111
104
 
@@ -131,7 +124,7 @@ Important: If you try any of the above status method after the expiration time,
131
124
 
132
125
  ### ActiveJob Support
133
126
 
134
- Version 0.7.0 has added full support for ActiveJob. The status of ActiveJob jobs will be tracked automatically.
127
+ This gem also supports ActiveJob jobs. Their status will be tracked automatically.
135
128
 
136
129
  To also enable job progress tracking and data storage features, simply add the `Sidekiq::Status::Worker` module to your base class, like below:
137
130
 
@@ -216,11 +209,11 @@ This gem provides an extension to Sidekiq's web interface with an index at `/sta
216
209
 
217
210
  ![Sidekiq Status Web](web/sidekiq-status-web.png)
218
211
 
219
- As of 0.7.0, status information for an individual job may be found at `/statuses/:job_id`.
212
+ Information for an individual job may be found at `/statuses/:job_id`.
220
213
 
221
214
  ![Sidekiq Status Web](web/sidekiq-status-single-web.png)
222
215
 
223
- As of 0.8.0, only jobs that include `Sidekiq::Status::Worker` will be reported in the web interface.
216
+ Note: _only jobs that include `Sidekiq::Status::Worker`_ will be reported in the web interface.
224
217
 
225
218
  #### Adding the Web Interface
226
219
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sidekiq", "~> 3"
5
+ gem "sidekiq", "~> 6"
6
6
 
7
7
  gemspec path: "../"
@@ -90,7 +90,7 @@ module Sidekiq::Status::Storage
90
90
  # - end: end score (i.e. +inf or a unix timestamp)
91
91
  # - offset: current progress through (all) jobs (e.g.: 100 if you want jobs from 100 to BATCH_LIMIT)
92
92
  def schedule_batch(options)
93
- options[:conn].zrangebyscore "schedule", options[:start], options[:end], {limit: [options[:offset], BATCH_LIMIT]}
93
+ options[:conn].zrangebyscore "schedule", options[:start], options[:end], limit: [options[:offset], BATCH_LIMIT]
94
94
  end
95
95
 
96
96
  # Searches the jobs Array for the job_id
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Status
3
- VERSION = '1.1.4'
3
+ VERSION = '2.0.0'
4
4
  end
5
5
  end
@@ -136,7 +136,7 @@ module Sidekiq::Status
136
136
  job = Sidekiq::Status::get_all params['jid']
137
137
 
138
138
  if job.empty?
139
- halt [404, {"Content-Type" => "text/html"}, [erb(sidekiq_status_template(:status_not_found))]]
139
+ throw :halt, [404, {"Content-Type" => "text/html"}, [erb(sidekiq_status_template(:status_not_found))]]
140
140
  else
141
141
  @status = add_details_to_status(job)
142
142
  erb(sidekiq_status_template(:status))
@@ -148,19 +148,23 @@ module Sidekiq::Status
148
148
  job = Sidekiq::RetrySet.new.find_job(params[:jid])
149
149
  job ||= Sidekiq::DeadSet.new.find_job(params[:jid])
150
150
  job.retry if job
151
- halt [302, { "Location" => request.referer }, []]
151
+ throw :halt, [302, { "Location" => request.referer }, []]
152
152
  end
153
153
 
154
154
  # Removes a completed job from the status list
155
155
  app.delete '/statuses' do
156
156
  Sidekiq::Status.delete(params[:jid])
157
- halt [302, { "Location" => request.referer }, []]
157
+ throw :halt, [302, { "Location" => request.referer }, []]
158
158
  end
159
159
  end
160
160
  end
161
161
  end
162
162
 
163
- require 'sidekiq/web' unless defined?(Sidekiq::Web)
163
+ unless defined?(Sidekiq::Web)
164
+ require 'delegate' # Needed for sidekiq 5.x
165
+ require 'sidekiq/web'
166
+ end
167
+
164
168
  Sidekiq::Web.register(Sidekiq::Status::Web)
165
169
  ["per_page", "sort_by", "sort_dir", "status"].each do |key|
166
170
  Sidekiq::WebHelpers::SAFE_QPARAMS.push(key)
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ['Evgeniy Tsvigun', 'Kenaniah Cerny']
6
6
  gem.email = ['utgarda@gmail.com', 'kenaniah@gmail.com']
7
7
  gem.summary = 'An extension to the sidekiq message processing to track your jobs'
8
- gem.homepage = 'http://github.com/utgarda/sidekiq-status'
8
+ gem.homepage = 'http://github.com/kenaniah/sidekiq-status'
9
9
  gem.license = 'MIT'
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ['lib']
15
15
  gem.version = Sidekiq::Status::VERSION
16
16
 
17
- gem.add_dependency 'sidekiq', '>= 3.0'
17
+ gem.add_dependency 'sidekiq', '>= 5.0'
18
18
  gem.add_dependency 'chronic_duration'
19
19
  gem.add_development_dependency 'appraisal'
20
20
  gem.add_development_dependency 'colorize'
@@ -13,6 +13,7 @@ describe 'sidekiq status web' do
13
13
  end
14
14
 
15
15
  before do
16
+ env 'rack.session', csrf: Base64.urlsafe_encode64('token')
16
17
  client_middleware
17
18
  allow(SecureRandom).to receive(:hex).and_return(job_id)
18
19
  end
@@ -105,7 +105,7 @@ describe Sidekiq::Status do
105
105
  second_job = LongJob.perform_in(3600)
106
106
  expect(second_job).to eq(job_id_1)
107
107
 
108
- initial_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
108
+ initial_schedule = redis.zrange "schedule", 0, -1, withscores: true
109
109
  expect(initial_schedule.size).to be(2)
110
110
  expect(initial_schedule.select {|scheduled_job| JSON.parse(scheduled_job[0])["jid"] == job_id }.size).to be(1)
111
111
 
@@ -113,7 +113,7 @@ describe Sidekiq::Status do
113
113
  # Unused, therefore unfound => false
114
114
  expect(Sidekiq::Status.cancel(unused_id)).to be_falsey
115
115
 
116
- remaining_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
116
+ remaining_schedule = redis.zrange "schedule", 0, -1, withscores: true
117
117
  expect(remaining_schedule.size).to be(initial_schedule.size - 1)
118
118
  expect(remaining_schedule.select {|scheduled_job| JSON.parse(scheduled_job[0])["jid"] == job_id }.size).to be(0)
119
119
  end
@@ -126,14 +126,14 @@ describe Sidekiq::Status do
126
126
  returned_job_id = LongJob.perform_at(scheduled_time)
127
127
  expect(returned_job_id).to eq(job_id)
128
128
 
129
- initial_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
129
+ initial_schedule = redis.zrange "schedule", 0, -1, withscores: true
130
130
  expect(initial_schedule.size).to be(1)
131
131
  # wrong time, therefore unfound => false
132
132
  expect(Sidekiq::Status.cancel(returned_job_id, (scheduled_time + 1))).to be_falsey
133
- expect((redis.zrange "schedule", 0, -1, {withscores: true}).size).to be(1)
133
+ expect((redis.zrange "schedule", 0, -1, withscores: true).size).to be(1)
134
134
  # same id, same time, deletes
135
135
  expect(Sidekiq::Status.cancel(returned_job_id, (scheduled_time))).to be_truthy
136
- expect(redis.zrange "schedule", 0, -1, {withscores: true}).to be_empty
136
+ expect(redis.zrange "schedule", 0, -1, withscores: true).to be_empty
137
137
  end
138
138
  end
139
139
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Tsvigun
8
8
  - Kenaniah Cerny
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-06-08 00:00:00.000000000 Z
12
+ date: 2021-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '3.0'
20
+ version: '5.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '3.0'
27
+ version: '5.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: chronic_duration
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ dependencies:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
- description:
126
+ description:
127
127
  email:
128
128
  - utgarda@gmail.com
129
129
  - kenaniah@gmail.com
@@ -141,9 +141,8 @@ files:
141
141
  - LICENSE
142
142
  - README.md
143
143
  - Rakefile
144
- - gemfiles/sidekiq_3.x.gemfile
145
- - gemfiles/sidekiq_4.x.gemfile
146
144
  - gemfiles/sidekiq_5.x.gemfile
145
+ - gemfiles/sidekiq_6.x.gemfile
147
146
  - lib/sidekiq-status.rb
148
147
  - lib/sidekiq-status/client_middleware.rb
149
148
  - lib/sidekiq-status/server_middleware.rb
@@ -168,11 +167,11 @@ files:
168
167
  - web/views/status.erb
169
168
  - web/views/status_not_found.erb
170
169
  - web/views/statuses.erb
171
- homepage: http://github.com/utgarda/sidekiq-status
170
+ homepage: http://github.com/kenaniah/sidekiq-status
172
171
  licenses:
173
172
  - MIT
174
173
  metadata: {}
175
- post_install_message:
174
+ post_install_message:
176
175
  rdoc_options: []
177
176
  require_paths:
178
177
  - lib
@@ -187,8 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
186
  - !ruby/object:Gem::Version
188
187
  version: '0'
189
188
  requirements: []
190
- rubygems_version: 3.0.3
191
- signing_key:
189
+ rubygems_version: 3.2.15
190
+ signing_key:
192
191
  specification_version: 4
193
192
  summary: An extension to the sidekiq message processing to track your jobs
194
193
  test_files:
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 4"
6
-
7
- gemspec path: "../"