yabeda-sidekiq 0.10.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +7 -5
- data/lib/yabeda/sidekiq/config.rb +7 -0
- data/lib/yabeda/sidekiq/server_middleware.rb +4 -2
- data/lib/yabeda/sidekiq/version.rb +1 -1
- data/lib/yabeda/sidekiq.rb +25 -23
- data/yabeda-sidekiq.gemspec +7 -2
- metadata +8 -15
- data/.github/workflows/build-release.yml +0 -82
- data/.github/workflows/lint.yml +0 -25
- data/.github/workflows/test.yml +0 -47
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.rubocop.yml +0 -67
- data/Gemfile +0 -16
- data/Rakefile +0 -11
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/yabeda-sidekiq-logo.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a429f27fdff4c0295a99045e54af89fac47d0ed6bcae3e13988c1c1b811e8b0
|
4
|
+
data.tar.gz: 6508f78bfc9d19697b688fef975c82de7be3177ee05df1aceea9befc0e271b6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127a4ffc2ad85ac7f472dc4de218df07be1612b05c145ceb8edc14c14cbb31390e45c1608a676c03bcfa927fe2a1398f7d2855731ee4d42a547388e8f45d975c
|
7
|
+
data.tar.gz: 362af4e3b0058f6d8453a0f8fc19ee81ce2963f285a5a82aafbfc4e7f09ae5a73ce5b73ccdfe044b60c83c31a9ce5a9408b9a07852d57c0dd5e51cb671abd642
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 0.12.0 - 2024-03-08
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Optional capture of error class for failed jobs counter.
|
15
|
+
|
16
|
+
Set `label_for_error_class_on_sidekiq_jobs_failed` to `true` to add `error` label to `sidekiq_jobs_failed_total` metric.
|
17
|
+
|
18
|
+
Pull request [#34](https://github.com/yabeda-rb/yabeda-sidekiq/pull/34) by [@niborg]
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Stop including development-related files into packaged gem to avoid confusing users or software tools. [@Envek]
|
23
|
+
|
24
|
+
## 0.11.0 - 2024-02-07
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- `retries_segmented_by_queue` configuration setting to allow segmentation of retry count by queue.
|
29
|
+
|
30
|
+
It is disabled by default as it requires to iterate over all jobs in the retry set and may be very slow if number of retries is huge.
|
31
|
+
|
32
|
+
Pull request [#32](https://github.com/yabeda-rb/yabeda-sidekiq/pull/32) by [@SxDx]
|
33
|
+
|
10
34
|
## 0.10.0 - 2022-10-25
|
11
35
|
|
12
36
|
### Added
|
@@ -119,3 +143,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
119
143
|
[@asusikov]: https://github.com/asusikov "Alexander Susikov"
|
120
144
|
[@mrexox]: https://github.com/mrexox "Valentine Kiselev"
|
121
145
|
[@LukinEgor]: https://github.com/LukinEgor "Egor Lukin"
|
146
|
+
[@SxDx]: https://github.com/SxDx "René Koller"
|
147
|
+
[@niborg]: https://github.com/niborg "Nick Knipe"
|
data/README.md
CHANGED
@@ -99,14 +99,16 @@ end
|
|
99
99
|
|
100
100
|
Configuration is handled by [anyway_config] gem. With it you can load settings from environment variables (upcased and prefixed with `YABEDA_SIDEKIQ_`), YAML files, and other sources. See [anyway_config] docs for details.
|
101
101
|
|
102
|
-
Config key
|
103
|
-
|
104
|
-
`collect_cluster_metrics`
|
105
|
-
`declare_process_metrics`
|
102
|
+
| Config key | Type | Default | Description |
|
103
|
+
|------------------------------------------------|---------|---------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
104
|
+
| `collect_cluster_metrics` | boolean | Enabled in Sidekiq worker processes, disabled otherwise | Defines whether this Ruby process should collect and expose metrics representing state of the whole Sidekiq installation (queues, processes, etc). |
|
105
|
+
| `declare_process_metrics` | boolean | Enabled in Sidekiq worker processes, disabled otherwise | Declare metrics that are only tracked inside worker process even outside of them. Useful for multiprocess metric collection. |
|
106
|
+
| `retries_segmented_by_queue` | boolean | Disabled | Defines wheter retries are segemented by queue or reported as a single metric |
|
107
|
+
| `label_for_error_class_on_sidekiq_jobs_failed` | boolean | Disabled | Defines whether `error` label should be added to `sidekiq_jobs_failed_total` metric. |
|
106
108
|
|
107
109
|
# Roadmap (TODO or Help wanted)
|
108
110
|
|
109
|
-
- Implement optional segmentation of
|
111
|
+
- Implement optional segmentation of schedule/dead sets
|
110
112
|
|
111
113
|
It should be disabled by default as it requires to iterate over all jobs in sets and may be very slow on large sets.
|
112
114
|
|
@@ -16,6 +16,13 @@ module Yabeda
|
|
16
16
|
|
17
17
|
# Declare metrics that are only tracked inside worker process even outside them
|
18
18
|
attr_config declare_process_metrics: ::Sidekiq.server?
|
19
|
+
|
20
|
+
# Retries are tracked by default as a single metric. If you want to track them separately for each queue, set this to +true+
|
21
|
+
# Disabled by default because it is quite slow if the retry set is large
|
22
|
+
attr_config retries_segmented_by_queue: false
|
23
|
+
|
24
|
+
# If set to true, an `:error` label will be added with name of the error class to all failed jobs
|
25
|
+
attr_config label_for_error_class_on_sidekiq_jobs_failed: false
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
@@ -20,8 +20,10 @@ module Yabeda
|
|
20
20
|
yield
|
21
21
|
end
|
22
22
|
Yabeda.sidekiq_jobs_success_total.increment(labels)
|
23
|
-
rescue Exception # rubocop: disable Lint/RescueException
|
24
|
-
|
23
|
+
rescue Exception => e # rubocop: disable Lint/RescueException
|
24
|
+
jobs_failed_labels = labels.dup
|
25
|
+
jobs_failed_labels[:error] = e.class.name if Yabeda::Sidekiq.config.label_for_error_class_on_sidekiq_jobs_failed
|
26
|
+
Yabeda.sidekiq_jobs_failed_total.increment(jobs_failed_labels)
|
25
27
|
raise
|
26
28
|
ensure
|
27
29
|
Yabeda.sidekiq_job_runtime.measure(labels, elapsed(start))
|
data/lib/yabeda/sidekiq.rb
CHANGED
@@ -29,9 +29,11 @@ module Yabeda
|
|
29
29
|
counter :jobs_rerouted_total, tags: %i[from_queue to_queue worker], comment: "A counter of the total number of rerouted jobs sidekiq enqueued."
|
30
30
|
|
31
31
|
if config.declare_process_metrics # defaults to +::Sidekiq.server?+
|
32
|
+
failed_total_tags = config.label_for_error_class_on_sidekiq_jobs_failed ? %i[queue worker error] : %i[queue worker]
|
33
|
+
|
32
34
|
counter :jobs_executed_total, tags: %i[queue worker], comment: "A counter of the total number of jobs sidekiq executed."
|
33
35
|
counter :jobs_success_total, tags: %i[queue worker], comment: "A counter of the total number of jobs successfully processed by sidekiq."
|
34
|
-
counter :jobs_failed_total, tags:
|
36
|
+
counter :jobs_failed_total, tags: failed_total_tags, comment: "A counter of the total number of jobs failed in sidekiq."
|
35
37
|
|
36
38
|
gauge :running_job_runtime, tags: %i[queue worker], aggregation: :max, unit: :seconds,
|
37
39
|
comment: "How long currently running jobs are running (useful for detection of hung jobs)"
|
@@ -49,13 +51,16 @@ module Yabeda
|
|
49
51
|
# Metrics not specific for current Sidekiq process, but representing state of the whole Sidekiq installation (queues, processes, etc)
|
50
52
|
# You can opt-out from collecting these by setting YABEDA_SIDEKIQ_COLLECT_CLUSTER_METRICS to falsy value (+no+ or +false+)
|
51
53
|
if config.collect_cluster_metrics # defaults to +::Sidekiq.server?+
|
52
|
-
|
53
|
-
|
54
|
-
gauge :
|
55
|
-
gauge :
|
56
|
-
|
57
|
-
gauge :
|
58
|
-
gauge :
|
54
|
+
retry_count_tags = config.retries_segmented_by_queue ? %i[queue] : []
|
55
|
+
|
56
|
+
gauge :jobs_waiting_count, tags: %i[queue], aggregation: :most_recent, comment: "The number of jobs waiting to process in sidekiq."
|
57
|
+
gauge :active_workers_count, tags: [], aggregation: :most_recent,
|
58
|
+
comment: "The number of currently running machines with sidekiq workers."
|
59
|
+
gauge :jobs_scheduled_count, tags: [], aggregation: :most_recent, comment: "The number of jobs scheduled for later execution."
|
60
|
+
gauge :jobs_retry_count, tags: retry_count_tags, aggregation: :most_recent, comment: "The number of failed jobs waiting to be retried"
|
61
|
+
gauge :jobs_dead_count, tags: [], aggregation: :most_recent, comment: "The number of jobs exceeded their retry count."
|
62
|
+
gauge :active_processes, tags: [], aggregation: :most_recent, comment: "The number of active Sidekiq worker processes."
|
63
|
+
gauge :queue_latency, tags: %i[queue], aggregation: :most_recent,
|
59
64
|
comment: "The queue latency, the difference in seconds since the oldest job in the queue was enqueued"
|
60
65
|
end
|
61
66
|
|
@@ -73,21 +78,22 @@ module Yabeda
|
|
73
78
|
sidekiq_jobs_scheduled_count.set({}, stats.scheduled_size)
|
74
79
|
sidekiq_jobs_dead_count.set({}, stats.dead_size)
|
75
80
|
sidekiq_active_processes.set({}, stats.processes_size)
|
76
|
-
sidekiq_jobs_retry_count.set({}, stats.retry_size)
|
77
81
|
|
78
82
|
::Sidekiq::Queue.all.each do |queue|
|
79
83
|
sidekiq_queue_latency.set({ queue: queue.name }, queue.latency)
|
80
84
|
end
|
81
85
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
86
|
+
if config.retries_segmented_by_queue
|
87
|
+
retries_by_queues =
|
88
|
+
::Sidekiq::RetrySet.new.each_with_object(Hash.new(0)) do |job, cntr|
|
89
|
+
cntr[job["queue"]] += 1
|
90
|
+
end
|
91
|
+
retries_by_queues.each do |queue, count|
|
92
|
+
sidekiq_jobs_retry_count.set({ queue: queue }, count)
|
93
|
+
end
|
94
|
+
else
|
95
|
+
sidekiq_jobs_retry_count.set({}, stats.retry_size)
|
96
|
+
end
|
91
97
|
end
|
92
98
|
end
|
93
99
|
|
@@ -112,11 +118,7 @@ module Yabeda
|
|
112
118
|
end
|
113
119
|
|
114
120
|
def worker_class(worker, job)
|
115
|
-
|
116
|
-
if worker.is_a?(ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper) || worker == ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper
|
117
|
-
return job["wrapped"].to_s
|
118
|
-
end
|
119
|
-
end
|
121
|
+
worker = job["wrapped"] || worker
|
120
122
|
(worker.is_a?(String) || worker.is_a?(Class) ? worker : worker.class).to_s
|
121
123
|
end
|
122
124
|
|
data/yabeda-sidekiq.gemspec
CHANGED
@@ -15,8 +15,13 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.homepage = "https://github.com/yabeda-rb/yabeda-sidekiq"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
18
|
-
spec.
|
19
|
-
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
20
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
21
|
+
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
|
22
|
+
|
23
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
f.match(%r{^(\.|bin/|spec/|tmp/|Gemfile|Rakefile|yabeda-sidekiq-logo\.png)})
|
20
25
|
end
|
21
26
|
spec.bindir = "exe"
|
22
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|
@@ -122,30 +122,23 @@ executables: []
|
|
122
122
|
extensions: []
|
123
123
|
extra_rdoc_files: []
|
124
124
|
files:
|
125
|
-
- ".github/workflows/build-release.yml"
|
126
|
-
- ".github/workflows/lint.yml"
|
127
|
-
- ".github/workflows/test.yml"
|
128
|
-
- ".gitignore"
|
129
|
-
- ".rspec"
|
130
|
-
- ".rubocop.yml"
|
131
125
|
- CHANGELOG.md
|
132
|
-
- Gemfile
|
133
126
|
- LICENSE.txt
|
134
127
|
- README.md
|
135
|
-
- Rakefile
|
136
|
-
- bin/console
|
137
|
-
- bin/setup
|
138
128
|
- lib/yabeda/sidekiq.rb
|
139
129
|
- lib/yabeda/sidekiq/client_middleware.rb
|
140
130
|
- lib/yabeda/sidekiq/config.rb
|
141
131
|
- lib/yabeda/sidekiq/server_middleware.rb
|
142
132
|
- lib/yabeda/sidekiq/version.rb
|
143
|
-
- yabeda-sidekiq-logo.png
|
144
133
|
- yabeda-sidekiq.gemspec
|
145
134
|
homepage: https://github.com/yabeda-rb/yabeda-sidekiq
|
146
135
|
licenses:
|
147
136
|
- MIT
|
148
|
-
metadata:
|
137
|
+
metadata:
|
138
|
+
homepage_uri: https://github.com/yabeda-rb/yabeda-sidekiq
|
139
|
+
source_code_uri: https://github.com/yabeda-rb/yabeda-sidekiq
|
140
|
+
changelog_uri: https://github.com/yabeda-rb/yabeda-sidekiq/blob/master/CHANGELOG.md
|
141
|
+
bug_tracker_uri: https://github.com/yabeda-rb/yabeda-sidekiq/issues
|
149
142
|
post_install_message:
|
150
143
|
rdoc_options: []
|
151
144
|
require_paths:
|
@@ -161,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
154
|
- !ruby/object:Gem::Version
|
162
155
|
version: '0'
|
163
156
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.5.3
|
165
158
|
signing_key:
|
166
159
|
specification_version: 4
|
167
160
|
summary: Extensible Prometheus exporter for monitoring your Sidekiq
|
@@ -1,82 +0,0 @@
|
|
1
|
-
name: Build and release gem to RubyGems
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- v*
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
release:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v2
|
13
|
-
with:
|
14
|
-
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
|
15
|
-
- uses: ruby/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: 2.7
|
18
|
-
- name: "Extract data from tag: version, message, body"
|
19
|
-
id: tag
|
20
|
-
run: |
|
21
|
-
git fetch --tags --force # Really fetch annotated tag. See https://github.com/actions/checkout/issues/290#issuecomment-680260080
|
22
|
-
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
|
23
|
-
echo ::set-output name=subject::$(git for-each-ref $GITHUB_REF --format='%(contents:subject)')
|
24
|
-
BODY="$(git for-each-ref $GITHUB_REF --format='%(contents:body)')"
|
25
|
-
# Extract changelog entries between this and previous version headers
|
26
|
-
escaped_version=$(echo ${GITHUB_REF#refs/tags/v} | sed -e 's/[]\/$*.^[]/\\&/g')
|
27
|
-
changelog=$(awk "BEGIN{inrelease=0} /## ${escaped_version}/{inrelease=1;next} /## [0-9]+\.[0-9]+\.[0-9]+/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md)
|
28
|
-
# Multiline body for release. See https://github.community/t/set-output-truncates-multiline-strings/16852/5
|
29
|
-
BODY="${BODY}"$'\n'"${changelog}"
|
30
|
-
BODY="${BODY//'%'/'%25'}"
|
31
|
-
BODY="${BODY//$'\n'/'%0A'}"
|
32
|
-
BODY="${BODY//$'\r'/'%0D'}"
|
33
|
-
echo "::set-output name=body::$BODY"
|
34
|
-
# Add pre-release option if tag name has any suffix after vMAJOR.MINOR.PATCH
|
35
|
-
if [[ ${GITHUB_REF#refs/tags/} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then
|
36
|
-
echo ::set-output name=prerelease::true
|
37
|
-
fi
|
38
|
-
- name: Build gem
|
39
|
-
run: gem build
|
40
|
-
- name: Calculate checksums
|
41
|
-
run: sha256sum yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem > SHA256SUM
|
42
|
-
- name: Check version
|
43
|
-
run: ls -l yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem
|
44
|
-
- name: Create Release
|
45
|
-
id: create_release
|
46
|
-
uses: actions/create-release@v1
|
47
|
-
env:
|
48
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
49
|
-
with:
|
50
|
-
tag_name: ${{ github.ref }}
|
51
|
-
release_name: ${{ steps.tag.outputs.subject }}
|
52
|
-
body: ${{ steps.tag.outputs.body }}
|
53
|
-
draft: false
|
54
|
-
prerelease: ${{ steps.tag.outputs.prerelease }}
|
55
|
-
- name: Upload built gem as release asset
|
56
|
-
uses: actions/upload-release-asset@v1
|
57
|
-
env:
|
58
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
59
|
-
with:
|
60
|
-
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
61
|
-
asset_path: yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem
|
62
|
-
asset_name: yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem
|
63
|
-
asset_content_type: application/x-tar
|
64
|
-
- name: Upload checksums as release asset
|
65
|
-
uses: actions/upload-release-asset@v1
|
66
|
-
env:
|
67
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
68
|
-
with:
|
69
|
-
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
70
|
-
asset_path: SHA256SUM
|
71
|
-
asset_name: SHA256SUM
|
72
|
-
asset_content_type: text/plain
|
73
|
-
- name: Publish to GitHub packages
|
74
|
-
env:
|
75
|
-
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
|
76
|
-
run: |
|
77
|
-
gem push yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
|
78
|
-
- name: Publish to RubyGems
|
79
|
-
env:
|
80
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
|
81
|
-
run: |
|
82
|
-
gem push yabeda-sidekiq-${{ steps.tag.outputs.version }}.gem
|
data/.github/workflows/lint.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
name: Lint
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
push:
|
6
|
-
branches:
|
7
|
-
- '**'
|
8
|
-
tags-ignore:
|
9
|
-
- 'v*'
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
rubocop:
|
13
|
-
# Skip running tests for local pull requests (use push event instead), run only for foreign ones
|
14
|
-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
|
15
|
-
name: RuboCop
|
16
|
-
runs-on: ubuntu-latest
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v2
|
19
|
-
- uses: ruby/setup-ruby@v1
|
20
|
-
with:
|
21
|
-
ruby-version: "3.0"
|
22
|
-
bundler-cache: true
|
23
|
-
- name: Lint Ruby code with RuboCop
|
24
|
-
run: |
|
25
|
-
bundle exec rubocop
|
data/.github/workflows/test.yml
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
name: Tests
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
push:
|
6
|
-
branches:
|
7
|
-
- '**'
|
8
|
-
tags-ignore:
|
9
|
-
- 'v*'
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
test:
|
13
|
-
name: 'Ruby ${{ matrix.ruby }}'
|
14
|
-
# Skip running tests for local pull requests (use push event instead), run only for foreign ones
|
15
|
-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
|
16
|
-
runs-on: ubuntu-latest
|
17
|
-
strategy:
|
18
|
-
fail-fast: false
|
19
|
-
matrix:
|
20
|
-
include:
|
21
|
-
- ruby: '3.1'
|
22
|
-
- ruby: '3.0'
|
23
|
-
- ruby: '2.7'
|
24
|
-
- ruby: '2.6'
|
25
|
-
- ruby: '2.5'
|
26
|
-
container:
|
27
|
-
image: ruby:${{ matrix.ruby }}
|
28
|
-
env:
|
29
|
-
CI: true
|
30
|
-
steps:
|
31
|
-
- uses: actions/checkout@v2
|
32
|
-
- uses: actions/cache@v2
|
33
|
-
with:
|
34
|
-
path: vendor/bundle
|
35
|
-
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
36
|
-
restore-keys: |
|
37
|
-
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
38
|
-
bundle-${{ matrix.ruby }}-
|
39
|
-
- name: Upgrade Bundler to 2.0 (for older Rubies)
|
40
|
-
run: gem install bundler -v '~> 2.0'
|
41
|
-
- name: Bundle install
|
42
|
-
run: |
|
43
|
-
bundle config path vendor/bundle
|
44
|
-
bundle install
|
45
|
-
bundle update
|
46
|
-
- name: Run RSpec
|
47
|
-
run: bundle exec rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
---
|
2
|
-
require:
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 2.3
|
7
|
-
|
8
|
-
Metrics/BlockLength:
|
9
|
-
Enabled: false
|
10
|
-
Exclude:
|
11
|
-
- "Gemfile"
|
12
|
-
- "spec/**/*"
|
13
|
-
|
14
|
-
Layout/LineLength:
|
15
|
-
Max: 160
|
16
|
-
|
17
|
-
Style/StringLiterals:
|
18
|
-
EnforcedStyle: double_quotes
|
19
|
-
|
20
|
-
# Allow to use let!
|
21
|
-
RSpec/LetSetup:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
RSpec/MultipleExpectations:
|
25
|
-
Enabled: false
|
26
|
-
|
27
|
-
Bundler/OrderedGems:
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Style/TrailingCommaInArguments:
|
31
|
-
Description: 'Checks for trailing comma in argument lists.'
|
32
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
33
|
-
Enabled: true
|
34
|
-
EnforcedStyleForMultiline: consistent_comma
|
35
|
-
|
36
|
-
Style/TrailingCommaInArrayLiteral:
|
37
|
-
Description: 'Checks for trailing comma in array literals.'
|
38
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
39
|
-
Enabled: true
|
40
|
-
EnforcedStyleForMultiline: consistent_comma
|
41
|
-
|
42
|
-
Style/TrailingCommaInHashLiteral:
|
43
|
-
Description: 'Checks for trailing comma in hash literals.'
|
44
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
45
|
-
Enabled: true
|
46
|
-
EnforcedStyleForMultiline: consistent_comma
|
47
|
-
|
48
|
-
Style/HashEachMethods:
|
49
|
-
Enabled: true
|
50
|
-
|
51
|
-
Style/HashTransformKeys:
|
52
|
-
Enabled: true
|
53
|
-
|
54
|
-
Style/HashTransformValues:
|
55
|
-
Enabled: true
|
56
|
-
|
57
|
-
RSpec/ExampleLength:
|
58
|
-
Enabled: false
|
59
|
-
|
60
|
-
Style/Documentation:
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
Metrics/MethodLength:
|
64
|
-
Max: 15
|
65
|
-
|
66
|
-
Metrics/AbcSize:
|
67
|
-
Max: 17
|
data/Gemfile
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
-
|
7
|
-
# Specify your gem's dependencies in yabeda-sidekiq.gemspec
|
8
|
-
gemspec
|
9
|
-
|
10
|
-
group :development, :test do
|
11
|
-
gem "pry"
|
12
|
-
gem "pry-byebug", platform: :mri
|
13
|
-
|
14
|
-
gem "rubocop", "~> 0.80.0"
|
15
|
-
gem "rubocop-rspec"
|
16
|
-
end
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "yabeda/sidekiq"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/yabeda-sidekiq-logo.png
DELETED
Binary file
|