-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge latest master from gzigzigzeo/sidekiq-grouping (#6)
* fix mistype: elasic -> elastic * fix require active_support * fix deprecation warnings about redis multi * Version bump * readme: add gem version badge * pass args to worker as array in inline mode * Optimized Lua script for Redis >= 6.2.0 * Remove trailing spaces * Use sadd? to remove warning message * Fixes sidekiq deprecation * chore: Configure Rubocop and fix all lint issues Signed-off-by: Valentin Kiselev <[email protected]> * ci: Add test github action Signed-off-by: Valentin Kiselev <[email protected]> * ci: Add lint github action Signed-off-by: Valentin Kiselev <[email protected]> * chore: YAML fix * ci: Fix redis service ports mapping Signed-off-by: Valentin Kiselev <[email protected]> * fix: Remove occasional fix for interval Signed-off-by: Valentin Kiselev <[email protected]> * chore: Add lefthook configuration Signed-off-by: Valentin Kiselev <[email protected]> * chore: Remove Travis config Signed-off-by: Valentin Kiselev <[email protected]> * chore: Appraise setting Signed-off-by: Valentin Kiselev <[email protected]> * fix: Fix tests Signed-off-by: Valentin Kiselev <[email protected]> * chore: Apply rubocop settings Signed-off-by: Valentin Kiselev <[email protected]> * chore: Bump version upto 1.2.0 Signed-off-by: Valentin Kiselev <[email protected]> * ci: Remove jruby from matrix Signed-off-by: Valentin Kiselev <[email protected]> * fix: Use more verbose var name Signed-off-by: Valentin Kiselev <[email protected]> * chore: Run tests before pushing Signed-off-by: Valentin Kiselev <[email protected]> * feature: Support Sidekiq 7 Signed-off-by: Valentin Kiselev <[email protected]> * chore: Fix rubocop issues Signed-off-by: Valentin Kiselev <[email protected]> * chore: Bump version Signed-off-by: Valentin Kiselev <[email protected]> * chore: Update lefthook.yml Signed-off-by: Valentin Kiselev <[email protected]> * chore: Update lefthook.yml Signed-off-by: Valentin Kiselev <[email protected]> * Fix rubocop * Add Ruby 3.3 * Set fail-fast: false * Move fail-fast inside strategy --------- Signed-off-by: Valentin Kiselev <[email protected]> Co-authored-by: Staskov Sergey <[email protected]> Co-authored-by: Grey Moore <[email protected]> Co-authored-by: Victor Sokolov <[email protected]> Co-authored-by: Vladimir Dementyev <[email protected]> Co-authored-by: Egor Lukin <[email protected]> Co-authored-by: russointroitoa <[email protected]> Co-authored-by: Ross-Hunter <[email protected]> Co-authored-by: Valentin Kiselev <[email protected]>
- Loading branch information
1 parent
cd446d5
commit 3e27904
Showing
28 changed files
with
784 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
rubocop: | ||
name: Rubocop | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby ${{ matrix.ruby_version }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler: 2 | ||
ruby-version: 2.7 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ matrix.ruby-version }}-${{ hashFiles('./*.gemspec') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Bundle install | ||
run: | | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run Rubocop | ||
run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
rspec: | ||
name: Rspec | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis:6 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { ruby_version: 2.7 } | ||
- { ruby_version: 3.0 } | ||
- { ruby_version: 3.1 } | ||
- { ruby_version: 3.3 } | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby ${{ matrix.ruby_version }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler: 2 | ||
ruby-version: ${{ matrix.ruby_version }} | ||
|
||
# Appraisal doesn't support vendored install | ||
# See: https://github.com/thoughtbot/appraisal/issues/173 | ||
# https://github.com/thoughtbot/appraisal/pull/174 | ||
- name: Bundle install | ||
run: | | ||
bundle install --jobs 4 --retry 3 | ||
bundle exec appraisal install | ||
- name: Run tests | ||
run: bundle exec appraisal rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ spec/reports | |
test/tmp | ||
test/version_tmp | ||
tmp | ||
.lefthook-local.yml | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,88 @@ | ||
--- | ||
require: rubocop-rspec | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.7.0 | ||
SuggestExtensions: false | ||
NewCops: enable | ||
Include: | ||
- ./Gemfile | ||
- ./Rakefile | ||
- '*.gemspec' | ||
- '**/*.rb' | ||
|
||
Documentation: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes | ||
|
||
Style/ClassAndModuleChildren: | ||
EnforcedStyle: compact | ||
RSpec/ExampleLength: | ||
Enabled: false | ||
|
||
RSpec/AnyInstance: | ||
Enabled: false | ||
|
||
RSpec/SpecFilePathFormat: | ||
Enabled: false | ||
|
||
RSpec/NamedSubject: | ||
Enabled: false | ||
|
||
RSpec/ContextWording: | ||
Enabled: false | ||
|
||
RSpec/RepeatedExampleGroupDescription: | ||
Enabled: false | ||
|
||
RSpec/NestedGroups: | ||
Enabled: false | ||
|
||
RSpec/FilePath: | ||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
|
||
RSpec/ExampleWording: | ||
Enabled: false | ||
|
||
Metrics/MethodLength: | ||
Max: 15 | ||
Exclude: | ||
- 'lib/sidekiq/grouping/flusher.rb' | ||
- 'lib/sidekiq/grouping/middleware.rb' | ||
- 'lib/sidekiq/grouping/batch.rb' | ||
|
||
Metrics/ClassLength: | ||
Max: 150 | ||
|
||
Metrics/AbcSize: | ||
Exclude: | ||
- 'lib/sidekiq/grouping/flusher.rb' | ||
- 'lib/sidekiq/grouping/middleware.rb' | ||
- 'spec/modules/batch_spec.rb' | ||
|
||
Metrics/CyclomaticComplexity: | ||
Exclude: | ||
- 'lib/sidekiq/grouping/flusher.rb' | ||
- 'lib/sidekiq/grouping/middleware.rb' | ||
|
||
Metrics/PerceivedComplexity: | ||
Exclude: | ||
- 'lib/sidekiq/grouping/middleware.rb' | ||
|
||
Layout/LineLength: | ||
Max: 90 | ||
Exclude: | ||
- 'lib/sidekiq/grouping/flusher.rb' | ||
- 'lib/sidekiq/grouping/web.rb' | ||
|
||
Layout/FirstArgumentIndentation: | ||
EnforcedStyle: consistent | ||
|
||
Layout/FirstMethodArgumentLineBreak: | ||
Enabled: true | ||
|
||
Layout/MultilineMethodArgumentLineBreaks: | ||
Enabled: true | ||
|
||
Gemspec/DevelopmentDependencies: | ||
EnforcedStyle: gemspec |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require "bundler/setup" | ||
require "sidekiq/grouping" | ||
|
||
require "pry" | ||
Pry.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "sidekiq", "~> 6.0.0" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "sidekiq", "~> 6.5.0" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "sidekiq", "~> 7.0.0" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
# Git hooks configuration | ||
# | ||
# See: github.com/evilmartians/lefthook | ||
|
||
pre-commit: | ||
parallel: true | ||
commands: | ||
appraisal: | ||
glob: "{Appraisals,*.gemfile}" | ||
run: echo {staged_files} > /dev/null; bundle exec appraisal install && git add gemfiles/*.gemfile | ||
rubocop: | ||
glob: "{*.rb,*.gemspec,Gemfile,Rakefile}" | ||
run: bundle exec rubocop -A {staged_files} && git add {staged_files} | ||
|
||
pre-push: | ||
commands: | ||
rspec: | ||
glob: "*.rb" | ||
run: echo {push_files} > /dev/null; bundle exec appraisal rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.