sidekiq-undertaker 1.0.0.rc03 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +9 -2
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_codeclimate.yml +5 -0
- data/.rubocop_todo.yml +5 -5
- data/.travis.yml +22 -17
- data/README.md +3 -2
- data/Rakefile +2 -0
- data/lib/sidekiq/undertaker/dead_job.rb +1 -1
- data/lib/sidekiq/undertaker/version.rb +1 -1
- data/lib/sidekiq/undertaker/web_extension/api_helpers.rb +5 -1
- data/lib/sidekiq/undertaker/web_extension.rb +2 -0
- data/lib/sidekiq/undertaker.rb +1 -1
- data/sidekiq-undertaker.gemspec +9 -6
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_filter_page_is_called/behaves_like_a_page/{the_displayed_page_is_correct.approved.txt → the_displayed_page_is_correct_for_sidekiqv6.approved.txt} +1 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classbucket_page_is_called/behaves_like_a_page/{the_displayed_page_is_correct.approved.txt → the_displayed_page_is_correct_for_sidekiqv6.approved.txt} +1 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classbucket_page_is_polled/behaves_like_a_page/{the_displayed_page_is_correct.approved.txt → the_displayed_page_is_correct_for_sidekiqv6.approved.txt} +1 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_all_failures_and_errors/behaves_like_a_page/{the_displayed_page_is_correct.approved.txt → the_displayed_page_is_correct_for_sidekiqv6.approved.txt} +5 -1
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_specific_job_class_and_a_specific_error/behaves_like_a_page/{the_displayed_page_is_correct.approved.txt → the_displayed_page_is_correct_for_sidekiqv6.approved.txt} +5 -1
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_specific_job_class_and_a_specific_error/with_pagination/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +1304 -0
- data/spec/sidekiq/undertaker/dead_jobs_spec.rb +1 -1
- data/spec/sidekiq/undertaker/job_distributor_spec.rb +2 -2
- data/spec/sidekiq/undertaker/job_filter_spec.rb +1 -0
- data/spec/sidekiq/undertaker/web_extension_spec.rb +12 -2
- data/web/views/morgue.erb +3 -5
- metadata +43 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6cd46224be393f0a6c8fa5fd45a4e09e32bb43d02b236d10d4bf020a0925576
|
4
|
+
data.tar.gz: 82347d2923ee1e9b81c6ac1aa881c2d1011b439d4a9531a7684814c7fc4ca278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f8ecf4113b5c094925bbcc1f938e87a84050381c66c4b05e17f9bac7318a67411e94ba53f7a72001ff68f5e924d8e42a9e0f95331d8906f1af39de51635b20
|
7
|
+
data.tar.gz: 3f6253dc261ce23278e89f2bd3e553d28b8dce618727867c4410eb7bec0fc6b3ea07412ff7cc8141149307df88ba3f14e1e172aecea584db542f62703db8993a
|
data/.codeclimate.yml
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
version: "2"
|
2
|
+
prepare:
|
3
|
+
fetch:
|
4
|
+
- url: "https://raw.githubusercontent.com/runtastic/rt_rubocop_defaults/master/config/default.yml"
|
5
|
+
path: .rt_rubocop_defaults.yml
|
2
6
|
plugins:
|
3
7
|
git-legal:
|
4
8
|
enabled: true
|
5
|
-
|
6
|
-
|
9
|
+
rubocop:
|
10
|
+
enabled: true
|
11
|
+
channel: rubocop-1-8-1
|
12
|
+
config:
|
13
|
+
file: .rubocop_codeclimate.yml
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-01-26 20:10:48 UTC using RuboCop version 1.8.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 2
|
10
|
-
# Configuration parameters: Severity.
|
10
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Severity.
|
11
11
|
Metrics/AbcSize:
|
12
12
|
Max: 22
|
13
13
|
|
14
|
-
# Offense count:
|
15
|
-
# Configuration parameters: CountComments, ExcludedMethods, Severity.
|
14
|
+
# Offense count: 2
|
15
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods, Severity.
|
16
16
|
Metrics/MethodLength:
|
17
|
-
Max:
|
17
|
+
Max: 14
|
18
18
|
|
19
19
|
# Offense count: 5
|
20
20
|
# Configuration parameters: .
|
data/.travis.yml
CHANGED
@@ -1,41 +1,46 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
rvm:
|
4
|
-
-
|
5
|
-
- 2.
|
6
|
-
- 2.6.
|
7
|
-
-
|
8
|
-
- jruby
|
9
|
-
|
4
|
+
# - 3.0.0 # Not yet supported by all dependencies
|
5
|
+
- 2.7.2
|
6
|
+
- 2.6.6
|
7
|
+
- 2.5.8
|
8
|
+
- jruby # latest
|
9
|
+
- jruby-9.2.14.0
|
10
|
+
#
|
11
|
+
# 1. https://github.com/oracle/truffleruby/issues/1398
|
12
|
+
# 2. Nokogiri build fails
|
13
|
+
# - truffleruby # latest
|
14
|
+
# - truffleruby-21.0.0
|
10
15
|
jdk:
|
11
16
|
- oraclejdk11
|
12
17
|
env:
|
13
18
|
global:
|
14
19
|
- CC_TEST_REPORTER_ID=7b2f0f3c9e20e50573e293fe3743a322a74e54087f95abc98d0f1dd1f3dd0a97
|
15
20
|
matrix:
|
16
|
-
- "JRUBY_OPTS='--
|
21
|
+
- "JRUBY_OPTS='--debug'"
|
17
22
|
- "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
18
23
|
|
19
24
|
matrix:
|
20
25
|
exclude:
|
21
|
-
- rvm:
|
26
|
+
- rvm: 3.0.0
|
22
27
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
23
|
-
- rvm: 2.
|
28
|
+
- rvm: 2.7.2
|
24
29
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
25
|
-
- rvm: 2.6.
|
30
|
+
- rvm: 2.6.6
|
31
|
+
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
32
|
+
- rvm: 2.5.8
|
33
|
+
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
34
|
+
- rvm: truffleruby-21.0.0
|
35
|
+
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
36
|
+
- rvm: truffleruby
|
26
37
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
27
38
|
allow_failures:
|
28
39
|
- rvm: truffleruby
|
29
|
-
-
|
30
|
-
|
40
|
+
- rvm: truffleruby-21.0.0
|
31
41
|
services:
|
32
42
|
- redis-server
|
33
43
|
|
34
|
-
before_install:
|
35
|
-
- gem update --system
|
36
|
-
- gem install bundler -v "~> 1.0"
|
37
|
-
- gem install bundler -v "~> 2.0"
|
38
|
-
|
39
44
|
before_script:
|
40
45
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
41
46
|
- chmod +x ./cc-test-reporter
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[![Build Status](https://travis-ci.org/ThomasKoppensteiner/sidekiq-undertaker.svg?branch=master)](https://travis-ci.org/ThomasKoppensteiner/sidekiq-undertaker)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/ThomasKoppensteiner/sidekiq-undertaker.svg)](https://codeclimate.com/github/ThomasKoppensteiner/sidekiq-undertaker)
|
6
6
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/d442eb0a323d8911661f/test_coverage)](https://codeclimate.com/github/ThomasKoppensteiner/sidekiq-undertaker/test_coverage)
|
7
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
|
7
8
|
|
8
9
|
## About
|
9
10
|
|
@@ -32,7 +33,7 @@ Or install it yourself as:
|
|
32
33
|
$ gem install sidekiq-undertaker
|
33
34
|
````
|
34
35
|
|
35
|
-
#### Install the Rubocop Pre-Commit Hook
|
36
|
+
#### Development: Install the Rubocop Pre-Commit Hook
|
36
37
|
|
37
38
|
````sh
|
38
39
|
$ rake rubocop:install
|
@@ -80,7 +81,7 @@ this fork was renamed to `sidekiq-undertaker`.
|
|
80
81
|
|
81
82
|
The [Sidekiq-Cleaner](https://github.com/HackingHabits/sidekiq-cleaner) gem was originally created by [Madan Thangavelu](https://github.com/HackingHabits).
|
82
83
|
[Tout](https://github.com/Tout/sidekiq-cleaner) and [TheWudu](https://github.com/TheWudu/sidekiq-cleaner) also contributed to it.
|
83
|
-
For the complete list of network members have a look at the [fork overview](https://github.com/ThomasKoppensteiner/sidekiq-
|
84
|
+
For the complete list of network members have a look at the [fork overview](https://github.com/ThomasKoppensteiner/sidekiq-undertaker/network/members).
|
84
85
|
|
85
86
|
## Alternative Projects
|
86
87
|
|
data/Rakefile
CHANGED
@@ -50,7 +50,7 @@ module Sidekiq
|
|
50
50
|
|
51
51
|
attr_writer :job_class, :time_elapsed_since_failure, :error_class, :bucket_name, :job
|
52
52
|
|
53
|
-
def job_eql?(other_job) # rubocop:disable Metrics/AbcSize
|
53
|
+
def job_eql?(other_job) # rubocop:disable Metrics/AbcSize
|
54
54
|
job.jid == other_job.jid &&
|
55
55
|
job.item == other_job.item &&
|
56
56
|
job.args == other_job.args &&
|
@@ -35,7 +35,7 @@ module Sidekiq
|
|
35
35
|
# Display dead jobs as list
|
36
36
|
@dead_jobs = @dead_jobs.map(&:job)
|
37
37
|
|
38
|
-
@undertaker_path = "undertaker/#{@req_job_class}/#{@req_error_class}/#{@req_bucket_name}"
|
38
|
+
@undertaker_path = "undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{@req_bucket_name}"
|
39
39
|
|
40
40
|
# Pagination
|
41
41
|
@total_dead = @dead_jobs.size
|
@@ -43,6 +43,10 @@ module Sidekiq
|
|
43
43
|
@count = 50 # per page
|
44
44
|
@dead_jobs = @dead_jobs[((@current_page - 1) * @count), @count]
|
45
45
|
|
46
|
+
# HINT: For making the pagination from sidekiq work, @total_size needs to be set
|
47
|
+
# https://github.com/mperham/sidekiq/blob/master/web/views/_paging.erb#L1
|
48
|
+
@total_size = @total_dead
|
49
|
+
|
46
50
|
# Remove unrelated arguments to allow _paginate url to be clean
|
47
51
|
# Hack to continue to reuse sidekiq's _pagination template
|
48
52
|
params.delete("job_class")
|
@@ -5,6 +5,7 @@ require "sidekiq/undertaker/web_extension/api_helpers"
|
|
5
5
|
module Sidekiq
|
6
6
|
module Undertaker
|
7
7
|
module WebExtension
|
8
|
+
# rubocop:disable Metrics/MethodLength
|
8
9
|
def self.registered(app)
|
9
10
|
app.helpers APIHelpers
|
10
11
|
|
@@ -32,6 +33,7 @@ module Sidekiq
|
|
32
33
|
post_undertaker_job_class_error_class_buckent_name_retry
|
33
34
|
end
|
34
35
|
end
|
36
|
+
# rubocop:enable Metrics/MethodLength
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/sidekiq/undertaker.rb
CHANGED
data/sidekiq-undertaker.gemspec
CHANGED
@@ -25,15 +25,17 @@ Gem::Specification.new do |spec|
|
|
25
25
|
"build_status_uri" => "https://travis-ci.org/ThomasKoppensteiner/sidekiq-undertaker"
|
26
26
|
}
|
27
27
|
|
28
|
+
spec.required_ruby_version = ">= 2.5.0"
|
29
|
+
|
28
30
|
spec.files = `git ls-files -z`.split("\x0")
|
29
31
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
30
32
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
31
33
|
spec.require_paths = ["lib", "lib/sidekiq/undertaker"]
|
32
34
|
|
33
35
|
spec.add_development_dependency "bundler", ">= 1.17", "<3"
|
34
|
-
spec.add_development_dependency "rake", "~>
|
36
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
35
37
|
|
36
|
-
spec.add_development_dependency "approvals", "~> 0.0
|
38
|
+
spec.add_development_dependency "approvals", "~> 0.0.24"
|
37
39
|
spec.add_development_dependency "mock_redis", "~> 0.19"
|
38
40
|
spec.add_development_dependency "pry", "~> 0.12"
|
39
41
|
spec.add_development_dependency "rack-test", "~> 1.1"
|
@@ -42,13 +44,14 @@ Gem::Specification.new do |spec|
|
|
42
44
|
spec.add_development_dependency "rspec-core", "~> 3.8"
|
43
45
|
spec.add_development_dependency "rspec-mocks", "~> 3.8"
|
44
46
|
spec.add_development_dependency "rspec-sidekiq", "~> 3.0"
|
45
|
-
spec.add_development_dependency "rt_rubocop_defaults", "~>
|
46
|
-
spec.add_development_dependency "rubocop", "~>
|
47
|
-
spec.add_development_dependency "rubocop-
|
47
|
+
spec.add_development_dependency "rt_rubocop_defaults", "~> 2.3"
|
48
|
+
spec.add_development_dependency "rubocop", "~> 1.8"
|
49
|
+
spec.add_development_dependency "rubocop-rake", "~> 0.5"
|
50
|
+
spec.add_development_dependency "rubocop-rspec", "~> 2.0"
|
48
51
|
spec.add_development_dependency "rubocop_runner", "~> 2.1"
|
49
52
|
spec.add_development_dependency "simplecov", "~> 0.14"
|
50
53
|
spec.add_development_dependency "sinatra", "~> 2.0"
|
51
54
|
spec.add_development_dependency "timecop", "~> 0.9"
|
52
55
|
|
53
|
-
spec.add_runtime_dependency "sidekiq", "
|
56
|
+
spec.add_runtime_dependency "sidekiq", ">= 5.2", "< 7"
|
54
57
|
end
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
<link href="/sidekiq/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
12
|
+
<link href="/sidekiq/stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
12
13
|
|
13
14
|
|
14
15
|
<link rel="shortcut icon" type="image/ico" href="/sidekiq/images/favicon.ico" />
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
<link href="/sidekiq/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
12
|
+
<link href="/sidekiq/stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
12
13
|
|
13
14
|
|
14
15
|
<link rel="shortcut icon" type="image/ico" href="/sidekiq/images/favicon.ico" />
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
<link href="/sidekiq/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
12
|
+
<link href="/sidekiq/stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
12
13
|
|
13
14
|
|
14
15
|
<link rel="shortcut icon" type="image/ico" href="/sidekiq/images/favicon.ico" />
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
<link href="/sidekiq/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
12
|
+
<link href="/sidekiq/stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
12
13
|
|
13
14
|
|
14
15
|
<link rel="shortcut icon" type="image/ico" href="/sidekiq/images/favicon.ico" />
|
@@ -164,7 +165,10 @@
|
|
164
165
|
</h3>
|
165
166
|
</div>
|
166
167
|
<div class="col-sm-12">
|
167
|
-
|
168
|
+
<div class="col-sm-4">
|
169
|
+
|
170
|
+
|
171
|
+
</div>
|
168
172
|
</div>
|
169
173
|
</header>
|
170
174
|
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
<link href="/sidekiq/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
12
|
+
<link href="/sidekiq/stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
12
13
|
|
13
14
|
|
14
15
|
<link rel="shortcut icon" type="image/ico" href="/sidekiq/images/favicon.ico" />
|
@@ -164,7 +165,10 @@
|
|
164
165
|
</h3>
|
165
166
|
</div>
|
166
167
|
<div class="col-sm-12">
|
167
|
-
|
168
|
+
<div class="col-sm-4">
|
169
|
+
|
170
|
+
|
171
|
+
</div>
|
168
172
|
</div>
|
169
173
|
</header>
|
170
174
|
|