sidekiq-status 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +17 -0
- data/.travis.yml +6 -1
- data/CHANGELOG.md +3 -0
- data/lib/sidekiq-status/version.rb +1 -1
- data/lib/sidekiq-status/web.rb +6 -0
- data/spec/lib/sidekiq-status/web_spec.rb +11 -0
- data/spec/support/test_jobs.rb +7 -0
- data/web/views/status.erb +18 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 328bd95affe0aa84cd7c797f63ba97b3d93a7d60fa003d75ede0e9996b88c399
|
4
|
+
data.tar.gz: db96de58b9b6e45f5ec0ecc600839778b82c4956ce43de7af55fafe42478af10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bfe5b5a0f8566f64d3778dff4f4a923103da2fb0926c4a43eb7677b689d3898641c2c0d53438cd88f8f72c1bd6bfa1e6db60326fed08cb953ede14ec7bc43d3
|
7
|
+
data.tar.gz: ba8f04547ff36c3c77c6cffd75f92f908afb7dd13291eaf454838a48d5a19014d6fb8e8a3fe663f6802e496e2a60588c64e477bbda97a504dd8936f8a0c37d7a
|
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
dependency_scanning:
|
2
|
+
image: docker:stable
|
3
|
+
variables:
|
4
|
+
DOCKER_DRIVER: overlay2
|
5
|
+
allow_failure: true
|
6
|
+
services:
|
7
|
+
- docker:stable-dind
|
8
|
+
script:
|
9
|
+
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
10
|
+
- docker run
|
11
|
+
--env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
|
12
|
+
--volume "$PWD:/code"
|
13
|
+
--volume /var/run/docker.sock:/var/run/docker.sock
|
14
|
+
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
|
15
|
+
artifacts:
|
16
|
+
reports:
|
17
|
+
dependency_scanning: gl-dependency-scanning-report.json
|
data/.travis.yml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.2
|
4
3
|
- 2.3
|
5
4
|
- 2.4
|
6
5
|
- 2.5
|
6
|
+
- 2.6
|
7
|
+
- ruby-head
|
7
8
|
gemfile:
|
8
9
|
- gemfiles/sidekiq_3.x.gemfile
|
9
10
|
- gemfiles/sidekiq_4.x.gemfile
|
@@ -14,3 +15,7 @@ before_install:
|
|
14
15
|
services: redis
|
15
16
|
notifications:
|
16
17
|
email: false
|
18
|
+
matrix:
|
19
|
+
fast_finish: true
|
20
|
+
allow_failures:
|
21
|
+
- rvm: ruby-head
|
data/CHANGELOG.md
CHANGED
data/lib/sidekiq-status/web.rb
CHANGED
@@ -8,6 +8,7 @@ module Sidekiq::Status
|
|
8
8
|
|
9
9
|
DEFAULT_PER_PAGE_OPTS = [25, 50, 100].freeze
|
10
10
|
DEFAULT_PER_PAGE = 25
|
11
|
+
COMMON_STATUS_HASH_KEYS = %w(update_time jid status worker args label pct_complete total at message)
|
11
12
|
|
12
13
|
class << self
|
13
14
|
def per_page_opts= arr
|
@@ -47,9 +48,14 @@ module Sidekiq::Status
|
|
47
48
|
def add_details_to_status(status)
|
48
49
|
status['label'] = status_label(status['status'])
|
49
50
|
status["pct_complete"] ||= pct_complete(status)
|
51
|
+
status["custom"] = process_custom_data(status)
|
50
52
|
return status
|
51
53
|
end
|
52
54
|
|
55
|
+
def process_custom_data(hash)
|
56
|
+
hash.reject { |key, _| COMMON_STATUS_HASH_KEYS.include?(key) }
|
57
|
+
end
|
58
|
+
|
53
59
|
def pct_complete(status)
|
54
60
|
return 100 if status['status'] == 'complete'
|
55
61
|
Sidekiq::Status::pct_complete(status['jid']) || 0
|
@@ -43,6 +43,17 @@ describe 'sidekiq status web' do
|
|
43
43
|
expect(last_response.body).to match(/working/)
|
44
44
|
end
|
45
45
|
|
46
|
+
it 'shows custom data for a single job' do
|
47
|
+
capture_status_updates(3) do
|
48
|
+
CustomDataJob.perform_async
|
49
|
+
end
|
50
|
+
|
51
|
+
get "/statuses/#{job_id}"
|
52
|
+
expect(last_response).to be_ok
|
53
|
+
expect(last_response.body).to match(/mister_cat/)
|
54
|
+
expect(last_response.body).to match(/meow/)
|
55
|
+
end
|
56
|
+
|
46
57
|
it 'show an error when the requested job ID is not found' do
|
47
58
|
get '/statuses/12345'
|
48
59
|
expect(last_response).to be_not_found
|
data/spec/support/test_jobs.rb
CHANGED
data/web/views/status.erb
CHANGED
@@ -65,6 +65,24 @@
|
|
65
65
|
</p>
|
66
66
|
</div>
|
67
67
|
</div>
|
68
|
+
|
69
|
+
<% if @status["custom"].any? %>
|
70
|
+
<hr>
|
71
|
+
<% @status["custom"].each do |key, val| %>
|
72
|
+
<div class="row">
|
73
|
+
<div class="col-sm-2">
|
74
|
+
<strong><%= key %></strong>
|
75
|
+
</div>
|
76
|
+
<div class="col-sm-10">
|
77
|
+
<% if val && val.include?("\n") %>
|
78
|
+
<pre><%= val %></pre>
|
79
|
+
<% else %>
|
80
|
+
<p><%= val || "<i>none</i>" %></p>
|
81
|
+
<% end %>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
<% end %>
|
85
|
+
<% end %>
|
68
86
|
</div>
|
69
87
|
</div>
|
70
88
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Tsvigun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -132,6 +132,7 @@ extensions: []
|
|
132
132
|
extra_rdoc_files: []
|
133
133
|
files:
|
134
134
|
- ".gitignore"
|
135
|
+
- ".gitlab-ci.yml"
|
135
136
|
- ".rspec"
|
136
137
|
- ".travis.yml"
|
137
138
|
- Appraisals
|
@@ -186,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
- !ruby/object:Gem::Version
|
187
188
|
version: '0'
|
188
189
|
requirements: []
|
189
|
-
|
190
|
-
rubygems_version: 2.7.6
|
190
|
+
rubygems_version: 3.0.1
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: An extension to the sidekiq message processing to track your jobs
|