sidekiq-failures 1.0.0 → 1.0.1
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 +5 -5
- data/.travis.yml +0 -3
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -0
- data/lib/sidekiq/failures/version.rb +1 -1
- data/lib/sidekiq/failures/views/failures.erb +4 -4
- data/lib/sidekiq/failures/web_extension.rb +1 -1
- data/sidekiq-failures.gemspec +8 -0
- data/test/middleware_test.rb +10 -2
- data/test/test_helper.rb +1 -0
- data/test/web_extension_test.rb +9 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 411bc0eb000e29f27b3d5afd27e39719c693df17ce7b08baace66e42f4b8c402
|
4
|
+
data.tar.gz: 88174d41395b3953bf089590775e8e34725c4f47109a379727df08c4331ad8d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90a60cb2e7b0e8dac73aa3cc188d81e4616354ecdc259bb82680fea63cf2e171e19ddb009f21b686ab95fe30fcb9b0090d45335aaaf16c4985d9770e584aa749
|
7
|
+
data.tar.gz: 76886912d60887ed578b1b9d2e3ac0b4824b0db0087d776f590ef6c2cf060ad543d331848173c4e0c285ce72789c315586a4bbea6ce7f8b777db9ea17a293057
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 1.0.1
|
4
|
+
|
5
|
+
* Add license config to the gemspec (#115 @reiz)
|
6
|
+
* Guard against failure error_message being `nil` (#122 @mcasper)
|
7
|
+
* Fix filtering failures with 0 results on Sidekiq Pro (#125 @substars)
|
8
|
+
|
3
9
|
## 1.0.0
|
4
10
|
|
5
11
|
* WebUI improvements (@bbtfr)
|
data/Gemfile
CHANGED
@@ -4,3 +4,9 @@ source 'https://rubygems.org'
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
gem 'sidekiq', ENV['SIDEKIQ_VERSION'] if ENV['SIDEKIQ_VERSION']
|
7
|
+
|
8
|
+
# to test Pro-specific functionality, set SIDEKIQ_PRO_CREDS on `bundle install`
|
9
|
+
# and SIDEKIQ_PRO_VERSION on `bundle install` and `rake test`
|
10
|
+
source "https://#{ENV['SIDEKIQ_PRO_CREDS']}@enterprise.contribsys.com/" do
|
11
|
+
gem 'sidekiq-pro', ENV['SIDEKIQ_PRO_VERSION'] if ENV['SIDEKIQ_PRO_VERSION']
|
12
|
+
end if ENV['SIDEKIQ_PRO_VERSION']
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="col-sm-5">
|
3
3
|
<h3><%= t('FailedJobs') %></h3>
|
4
4
|
</div>
|
5
|
-
<% if @failures.
|
5
|
+
<% if @failures.count > 0 && @total_size > @count %>
|
6
6
|
<div class="col-sm-4">
|
7
7
|
<%= erb :_paging, :locals => { :url => "#{root_path}failures" } %>
|
8
8
|
</div>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<%= filtering('failures') if respond_to?(:filtering) %>
|
11
11
|
</header>
|
12
12
|
|
13
|
-
<% if @failures.
|
13
|
+
<% if @failures.count > 0 %>
|
14
14
|
<form action="<%= root_path %>failures" method="post">
|
15
15
|
<%= csrf_tag if respond_to?(:csrf_tag) %>
|
16
16
|
<table class="table table-striped table-bordered table-white">
|
@@ -45,7 +45,7 @@
|
|
45
45
|
</td>
|
46
46
|
<td style="overflow: auto; padding: 10px;">
|
47
47
|
<a class="backtrace" href="#" onclick="$(this).next().toggle(); return false">
|
48
|
-
<%= h entry['error_class'] %>: <%= h entry['error_message'].size > 500 ? entry['error_message'][0..500] + '...' : entry['error_message'] %>
|
48
|
+
<%= h entry['error_class'] %>: <%= h entry['error_message'].to_s.size > 500 ? entry['error_message'][0..500] + '...' : entry['error_message'] %>
|
49
49
|
</a>
|
50
50
|
<pre style="display: none; background: none; border: 0; width: 100%; max-height: 30em; font-size: 0.8em; white-space: nowrap; overflow: auto;">
|
51
51
|
<%= entry['error_backtrace'].join("<br />") if entry['error_backtrace'] %>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
<input class="btn btn-danger btn-xs pull-right" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
71
71
|
</form>
|
72
72
|
|
73
|
-
<% if @failures.
|
73
|
+
<% if @failures.count > 0 && @total_size > @count %>
|
74
74
|
<div class="col-sm-4">
|
75
75
|
<%= erb :_paging, :locals => { :url => "#{root_path}failures" } %>
|
76
76
|
</div>
|
@@ -86,7 +86,7 @@ module Sidekiq
|
|
86
86
|
app.post '/filter/failures' do
|
87
87
|
@failures = Sidekiq::Failures::FailureSet.new.scan("*#{params[:substr]}*")
|
88
88
|
@current_page = 1
|
89
|
-
@count = @total_size = @failures.
|
89
|
+
@count = @total_size = @failures.count
|
90
90
|
render(:erb, File.read(File.join(view_path, "failures.erb")))
|
91
91
|
end
|
92
92
|
end
|
data/sidekiq-failures.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = %q{Keep track of Sidekiq failed jobs}
|
8
8
|
gem.summary = %q{Keeps track of Sidekiq failed jobs and adds a tab to the Web UI to let you browse them. Makes use of Sidekiq's custom tabs and middleware chain.}
|
9
9
|
gem.homepage = "https://github.com/mhfs/sidekiq-failures/"
|
10
|
+
gem.license = "MIT"
|
10
11
|
|
11
12
|
gem.files = `git ls-files`.split($\)
|
12
13
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -17,6 +18,13 @@ Gem::Specification.new do |gem|
|
|
17
18
|
|
18
19
|
gem.add_dependency "sidekiq", ">= 4.0.0"
|
19
20
|
|
21
|
+
# Redis 4.X is incompatible with Ruby < 2.3, but the Ruby version constraint
|
22
|
+
# wasn't added until 4.1.2, meaning you can get an incompatible version of the
|
23
|
+
# redis gem when running Ruby 2.2 without this constraint.
|
24
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.3.0")
|
25
|
+
gem.add_dependency "redis", "< 4.0"
|
26
|
+
end
|
27
|
+
|
20
28
|
gem.add_development_dependency "minitest"
|
21
29
|
gem.add_development_dependency "rake"
|
22
30
|
gem.add_development_dependency "rack-test"
|
data/test/middleware_test.rb
CHANGED
@@ -6,7 +6,7 @@ module Sidekiq
|
|
6
6
|
before do
|
7
7
|
$invokes = 0
|
8
8
|
@boss = MiniTest::Mock.new
|
9
|
-
|
9
|
+
num_options_calls.times { @boss.expect(:options, {:queues => ['default'] }, []) }
|
10
10
|
@processor = ::Sidekiq::Processor.new(@boss)
|
11
11
|
Sidekiq.server_middleware {|chain| chain.add Sidekiq::Failures::Middleware }
|
12
12
|
Sidekiq.redis = REDIS
|
@@ -232,7 +232,7 @@ module Sidekiq
|
|
232
232
|
|
233
233
|
3.times do
|
234
234
|
boss = MiniTest::Mock.new
|
235
|
-
|
235
|
+
num_options_calls.times { boss.expect(:options, {:queues => ['default'] }, []) }
|
236
236
|
processor = ::Sidekiq::Processor.new(boss)
|
237
237
|
|
238
238
|
actor = MiniTest::Mock.new
|
@@ -278,6 +278,14 @@ module Sidekiq
|
|
278
278
|
def create_work(msg)
|
279
279
|
Sidekiq::BasicFetch::UnitOfWork.new('default', Sidekiq.dump_json(msg))
|
280
280
|
end
|
281
|
+
|
282
|
+
def num_options_calls
|
283
|
+
if Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('5.0.3')
|
284
|
+
3
|
285
|
+
else
|
286
|
+
2
|
287
|
+
end
|
288
|
+
end
|
281
289
|
end
|
282
290
|
end
|
283
291
|
end
|
data/test/test_helper.rb
CHANGED
data/test/web_extension_test.rb
CHANGED
@@ -5,7 +5,7 @@ module Sidekiq
|
|
5
5
|
describe "WebExtension" do
|
6
6
|
include Rack::Test::Methods
|
7
7
|
|
8
|
-
TOKEN =
|
8
|
+
TOKEN = SecureRandom.base64(32).freeze
|
9
9
|
|
10
10
|
def app
|
11
11
|
Sidekiq::Web
|
@@ -138,6 +138,14 @@ module Sidekiq
|
|
138
138
|
last_response.status.must_equal 200
|
139
139
|
last_response.body.must_match(/No failed jobs found/)
|
140
140
|
end
|
141
|
+
|
142
|
+
it 'can handle failures with nil error_message' do
|
143
|
+
create_sample_failure(error_message: nil)
|
144
|
+
|
145
|
+
get '/failures'
|
146
|
+
|
147
|
+
last_response.status.must_equal 200
|
148
|
+
end
|
141
149
|
end
|
142
150
|
|
143
151
|
describe 'when there is failure' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-failures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Silveira
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -126,9 +126,10 @@ files:
|
|
126
126
|
- test/test_helper.rb
|
127
127
|
- test/web_extension_test.rb
|
128
128
|
homepage: https://github.com/mhfs/sidekiq-failures/
|
129
|
-
licenses:
|
129
|
+
licenses:
|
130
|
+
- MIT
|
130
131
|
metadata: {}
|
131
|
-
post_install_message:
|
132
|
+
post_install_message:
|
132
133
|
rdoc_options: []
|
133
134
|
require_paths:
|
134
135
|
- lib
|
@@ -143,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
144
|
- !ruby/object:Gem::Version
|
144
145
|
version: '0'
|
145
146
|
requirements: []
|
146
|
-
|
147
|
-
|
148
|
-
signing_key:
|
147
|
+
rubygems_version: 3.2.3
|
148
|
+
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Keeps track of Sidekiq failed jobs and adds a tab to the Web UI to let you
|
151
151
|
browse them. Makes use of Sidekiq's custom tabs and middleware chain.
|