Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: use bundler-cache from ruby/setup-ruby #26

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,24 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.x
- name: Install dependencies
run: bundle install
ruby-version: 2.7
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop --format progress
build:
needs: [linting]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.5.x', '2.6.x', '2.7.x']
ruby: ['2.5', '2.6', '2.7']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
bundler-cache: true
- name: Run tests
run: bundle exec rake
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source 'https://rubygems.org'

# Specify your gem's dependencies in sidekiq-logstash.gemspec

gemspec

gem 'rubocop-rake'
gem 'rubocop-rspec'
18 changes: 9 additions & 9 deletions lib/sidekiq/logging/argument_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ def call(original_args, parents = [])
parents.push(key) if deep_regexps
if regexps.any? { |r| key =~ r }
value = FILTERED
elsif deep_regexps && (joined = parents.join('.')) && deep_regexps.any? { |r| joined =~ r }
elsif deep_regexps && (joined = parents.join('.')) && deep_regexps.any? { |r| joined =~ r } # rubocop:disable Lint/DuplicateBranch
value = FILTERED
elsif value.is_a?(Hash)
value = call(value, parents)
elsif value.is_a?(Array)
value = value.map { |v| v.is_a?(Hash) ? call(v, parents) : v }
elsif blocks.any?
key = begin
key.dup
rescue StandardError
key
end
key.dup
rescue StandardError
key
end
value = begin
value.dup
rescue StandardError
value
end
value.dup
rescue StandardError
value
end
blocks.each { |b| b.call(key, value) }
end
parents.pop if deep_regexps
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/logging/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def filter_args
def deep_stringify!(args)
case args
when Hash
Hash[args.map { |key, value| [deep_stringify!(key), deep_stringify!(value)] }]
args.map { |key, value| [deep_stringify!(key), deep_stringify!(value)] }.to_h
when Array
args.map! { |val| deep_stringify!(val) }
else
Expand Down
1 change: 1 addition & 0 deletions sidekiq-logstash.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-json_expectations', '~> 2.1.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
spec.metadata['rubygems_mfa_required'] = 'true'
end