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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +9 -2
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +4 -0
  5. data/.rubocop_codeclimate.yml +5 -0
  6. data/.rubocop_todo.yml +5 -5
  7. data/.travis.yml +22 -17
  8. data/README.md +3 -2
  9. data/Rakefile +2 -0
  10. data/lib/sidekiq/undertaker/dead_job.rb +1 -1
  11. data/lib/sidekiq/undertaker/version.rb +1 -1
  12. data/lib/sidekiq/undertaker/web_extension/api_helpers.rb +5 -1
  13. data/lib/sidekiq/undertaker/web_extension.rb +2 -0
  14. data/lib/sidekiq/undertaker.rb +1 -1
  15. data/sidekiq-undertaker.gemspec +9 -6
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. data/spec/sidekiq/undertaker/dead_jobs_spec.rb +1 -1
  23. data/spec/sidekiq/undertaker/job_distributor_spec.rb +2 -2
  24. data/spec/sidekiq/undertaker/job_filter_spec.rb +1 -0
  25. data/spec/sidekiq/undertaker/web_extension_spec.rb +12 -2
  26. data/web/views/morgue.erb +3 -5
  27. metadata +43 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eb7300c8f81d6db508193768a040c00e629c82e95be2a6a6add76612fc53b3b
4
- data.tar.gz: b8d272902163a23080340d3721e8f54afd3584246be09ddcd48d58f759eb6ab0
3
+ metadata.gz: d6cd46224be393f0a6c8fa5fd45a4e09e32bb43d02b236d10d4bf020a0925576
4
+ data.tar.gz: 82347d2923ee1e9b81c6ac1aa881c2d1011b439d4a9531a7684814c7fc4ca278
5
5
  SHA512:
6
- metadata.gz: 232fac29cea4aa2c649d34c65ec27075dac17be33c77beee59cf7e526d301898c45c523555cba07cd4097b0ee20e8efc825dc27b914f11c4746c3f018cf9ed96
7
- data.tar.gz: eb0bf23995ca860d24804ec4fa354a9df3b62f3868b517dafdcb5410c119ec57ec05fa0c6440286519717a92463975e6510c4dd2ef01df27d9dda4b279359345
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
- # rubocop:
6
- # enabled: true
9
+ rubocop:
10
+ enabled: true
11
+ channel: rubocop-1-8-1
12
+ config:
13
+ file: .rubocop_codeclimate.yml
data/.gitignore CHANGED
@@ -9,6 +9,7 @@ _yardoc
9
9
  *.gem
10
10
  *.rbc
11
11
  *.received.*
12
+ *.rt_rubocop_defaults.yml
12
13
  coverage
13
14
  doc/
14
15
  Gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  require:
2
+ - rubocop-rake
2
3
  - rubocop-rspec
3
4
  - rt_rubocop_defaults
4
5
 
5
6
  inherit_from: .rubocop_todo.yml
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.5
@@ -0,0 +1,5 @@
1
+ require:
2
+ - rubocop-rspec
3
+ inherit_from:
4
+ - .rt_rubocop_defaults.yml
5
+ - .rubocop_todo.yml
data/.rubocop_todo.yml CHANGED
@@ -1,20 +1,20 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-12-06 21:33:12 +0100 using RuboCop version 0.77.0.
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: 3
15
- # Configuration parameters: CountComments, ExcludedMethods, Severity.
14
+ # Offense count: 2
15
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods, Severity.
16
16
  Metrics/MethodLength:
17
- Max: 19
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
- - 2.4.9
5
- - 2.5.7
6
- - 2.6.5
7
- - jruby-9.1.17.0
8
- - jruby-9.2.9.0
9
- # - truffleruby # https://github.com/oracle/truffleruby/issues/1398
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='--dev --debug'"
21
+ - "JRUBY_OPTS='--debug'"
17
22
  - "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
18
23
 
19
24
  matrix:
20
25
  exclude:
21
- - rvm: 2.4.9
26
+ - rvm: 3.0.0
22
27
  env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
23
- - rvm: 2.5.7
28
+ - rvm: 2.7.2
24
29
  env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
25
- - rvm: 2.6.5
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
- - env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
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-under/network/members).
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
@@ -28,6 +28,8 @@ begin
28
28
  RSpec::Core::RakeTask.new(:spec)
29
29
 
30
30
  task default: :spec
31
+
32
+ desc "run specs"
31
33
  task test: :spec
32
34
  rescue LoadError
33
35
  puts "RSpec not available!"
@@ -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, Metrics/CyclomaticComplexity
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 &&
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Undertaker
5
- VERSION = "1.0.0.rc03"
5
+ VERSION = "1.0.2"
6
6
  end
7
7
  end
@@ -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
@@ -5,7 +5,7 @@ require "sidekiq/undertaker/web_extension"
5
5
 
6
6
  begin
7
7
  require "sidekiq/web"
8
- rescue LoadError # rubocop:disable Lint/SuppressedException
8
+ rescue LoadError
9
9
  # client-only usage
10
10
  end
11
11
 
@@ -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", "~> 12.3"
36
+ spec.add_development_dependency "rake", "~> 13.0"
35
37
 
36
- spec.add_development_dependency "approvals", "~> 0.0", ">= 0.0.24"
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", "~> 1.2"
46
- spec.add_development_dependency "rubocop", "~> 0.77"
47
- spec.add_development_dependency "rubocop-rspec", "~> 1.30"
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", "~> 5.2", "< 7"
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