sidekiq-status 1.1.1 → 1.1.2

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: db6a8c9de958b260f3c12afef53ed33781ebbc227bbdf3b14792b41fb3ad2e20
4
- data.tar.gz: 9226346a24ff25fed5608d2fd75671c5f7ae4c637c44bbf096f9cd67464b4996
3
+ metadata.gz: 328bd95affe0aa84cd7c797f63ba97b3d93a7d60fa003d75ede0e9996b88c399
4
+ data.tar.gz: db96de58b9b6e45f5ec0ecc600839778b82c4956ce43de7af55fafe42478af10
5
5
  SHA512:
6
- metadata.gz: fc3a3e5537f38c180df517dcb69674fa8cef9b1938b57324db8e26b41bcaf9b3c0ef0857f5b9ebbb6ee54106440e33203d2f1d8f4f5ccea4e205ae9d71b67c6f
7
- data.tar.gz: c1223771b2b7d8101d7f9ae3ef602c81cb1e408d66b6411023a2f37c7b9022d2f21dbb93addb12a8327847cb2e327df5c883f909ada59d85abdfe2f333619ba5
6
+ metadata.gz: 8bfe5b5a0f8566f64d3778dff4f4a923103da2fb0926c4a43eb7677b689d3898641c2c0d53438cd88f8f72c1bd6bfa1e6db60326fed08cb953ede14ec7bc43d3
7
+ data.tar.gz: ba8f04547ff36c3c77c6cffd75f92f908afb7dd13291eaf454838a48d5a19014d6fb8e8a3fe663f6802e496e2a60588c64e477bbda97a504dd8936f8a0c37d7a
@@ -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
@@ -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
@@ -1,3 +1,6 @@
1
+ **Version 1.1.2**
2
+ * Job detail pages now show custom data keys (#139)
3
+
1
4
  **Version 1.1.1**
2
5
  * Uses SCAN rather than KEYS when retrieving job ids from Redis (#139)
3
6
 
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Status
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
@@ -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
@@ -31,6 +31,13 @@ class DataJob < StubJob
31
31
  end
32
32
  end
33
33
 
34
+ class CustomDataJob < StubJob
35
+ def perform
36
+ store({mister_cat: 'meow'})
37
+ sleep 0.5
38
+ end
39
+ end
40
+
34
41
  class ProgressJob < StubJob
35
42
  def perform
36
43
  total 500
@@ -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.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: 2018-12-19 00:00:00.000000000 Z
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
- rubyforge_project:
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