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

Update redis #9

Merged
merged 9 commits into from
Oct 11, 2023
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
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: CI

on: [push, pull_request]
on:
pull_request:
branches:
- "*"
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

# We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/table_sync'

strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1"]
ruby: ["2.7", "3.0", "3.1", "3.2"]

name: ${{ matrix.ruby }}

Expand Down
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_gem:
rubocop-config-umbrellio: lib/rubocop.yml

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7

Layout/HashAlignment:
EnforcedHashRocketStyle:
Expand All @@ -12,6 +12,9 @@ Layout/HashAlignment:
- key
- table

RSpec/IndexedLet:
Max: 3

Naming/VariableNumber:
Exclude:
- 'spec/**/*'
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.1.0]
- Updated Ruby version to 2.7, because version below is no longer officially used.
- Update 'redis' to the latest version to support redis-sentinel.
- Redis-namespace dependency moved to development dependency.
- Lock development dependency gem versions.

## [1.0.2]
- Redis-namespace dependency now requires version 1.8.2 or more recent, because thread safety was broken in 1.8.1
- Adds processing for case when `watch` fails in redis transactions (during unlocking).
Expand All @@ -15,4 +21,4 @@ All notable changes to this project will be documented in this file.

## [1.0.0]

Initial public release
Initial public release
155 changes: 87 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,122 +1,141 @@
PATH
remote: .
specs:
simple_mutex (1.0.2)
redis
redis-namespace (>= 1.8.2)
simple_mutex (1.1.0)
redis (>= 5.0)
sidekiq

GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.6)
activesupport (7.1.0)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
ast (2.4.2)
base64 (0.1.1)
bigdecimal (3.1.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
diff-lcs (1.5.0)
docile (1.4.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
minitest (5.16.2)
mock_redis (0.32.0)
drb (2.1.1)
ruby2_keywords
parallel (1.22.1)
parser (3.1.2.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.20.0)
mock_redis (0.37.0)
mutex_m (0.1.2)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
rack (2.2.4)
racc
racc (1.7.1)
rack (3.0.8)
rainbow (3.1.1)
redis (4.7.1)
redis-namespace (1.8.2)
redis (>= 3.0.4)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.17.0)
connection_pool
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.8.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.30.1)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
rubocop-config-umbrellio (1.30.0.65)
rubocop (~> 1.30.0)
rubocop-performance (~> 1.14.0)
rubocop-rails (~> 2.14.2)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-config-umbrellio (1.50.0.85)
rubocop (~> 1.50.0)
rubocop-performance (~> 1.17.0)
rubocop-rails (~> 2.19.0)
rubocop-rake (~> 0.6.0)
rubocop-rspec (~> 2.11.1)
rubocop-rspec (~> 2.20.0)
rubocop-sequel (~> 0.3.3)
rubocop-performance (1.14.2)
rubocop-performance (1.17.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.14.2)
rubocop-rails (2.19.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop (>= 1.33.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.11.1)
rubocop (~> 1.19)
rubocop-rspec (2.20.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-sequel (0.3.4)
rubocop (~> 1.0)
ruby-progressbar (1.11.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sidekiq (6.5.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
simplecov (0.21.2)
sidekiq (7.1.5)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.14.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
thor (1.2.1)
timecop (0.9.5)
tzinfo (2.0.4)
thor (1.2.2)
timecop (0.9.8)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.2.0)
zeitwerk (2.6.0)
unicode-display_width (2.5.0)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
bundler
bundler-audit
mock_redis
rspec
rubocop
rubocop-config-umbrellio
rubocop-rspec
bundler (~> 2.4, >= 2.4.20)
bundler-audit (~> 0.9.1)
mock_redis (~> 0.37.0)
redis-namespace (~> 1.11)
rspec (~> 3.12)
rubocop (~> 1.50, >= 1.50)
rubocop-config-umbrellio (~> 1.50, >= 1.50.0.85)
rubocop-rspec (~> 2.20, >= 2.20)
simple_mutex!
simplecov
simplecov-lcov
timecop
simplecov (~> 0.22.0)
simplecov-lcov (~> 0.8.0)
timecop (~> 0.9.8)

BUNDLED WITH
2.3.17
2.4.20
4 changes: 2 additions & 2 deletions lib/simple_mutex/base_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def end_msg
end

def generate_log_msg(lock_key, raw_data, return_value)
"Trying to delete row with key <#{lock_key.inspect}> "\
"and value <#{raw_data.inspect}>. "\
"Trying to delete row with key <#{lock_key.inspect}> " \
"and value <#{raw_data.inspect}>. " \
"MULTI returned value <#{return_value.inspect}>."
end

Expand Down
2 changes: 1 addition & 1 deletion lib/simple_mutex/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SimpleMutex
VERSION = "1.0.2"
VERSION = "1.1.0"
end
26 changes: 13 additions & 13 deletions simple_mutex.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/umbrellio/simple_mutex"
spec.license = "MIT"

spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand All @@ -25,18 +25,18 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_runtime_dependency "redis"
spec.add_runtime_dependency "redis-namespace", ">= 1.8.2"
spec.add_runtime_dependency "redis", ">= 5.0"
spec.add_runtime_dependency "sidekiq"

spec.add_development_dependency "bundler"
spec.add_development_dependency "bundler-audit"
spec.add_development_dependency "mock_redis"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rubocop"
spec.add_development_dependency "rubocop-config-umbrellio"
spec.add_development_dependency "rubocop-rspec"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "simplecov-lcov"
spec.add_development_dependency "timecop"
spec.add_development_dependency "bundler", "~> 2.4", ">= 2.4.20"
spec.add_development_dependency "bundler-audit", "~> 0.9.1"
spec.add_development_dependency "mock_redis", "~> 0.37.0"
spec.add_development_dependency "redis-namespace", "~> 1.11"
spec.add_development_dependency "rspec", "~> 3.12"
spec.add_development_dependency "rubocop", "~> 1.50", ">= 1.50"
spec.add_development_dependency "rubocop-config-umbrellio", "~> 1.50", ">= 1.50.0.85"
spec.add_development_dependency "rubocop-rspec", "~> 2.20", ">= 2.20"
spec.add_development_dependency "simplecov", "~> 0.22.0"
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
spec.add_development_dependency "timecop", "~> 0.9.8"
end
10 changes: 5 additions & 5 deletions spec/simple_mutex/helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
end

describe "#get" do
it "works" do
it "getting lock" do
expect(described_class.get("lock_key_1")).to eq(
key: "lock_key_1",
value: data_1,
Expand All @@ -88,7 +88,7 @@

describe "#list" do
context "when mode: :default" do
it "works" do
it "return job and batch locks" do
list = described_class.list(mode: :default)

expect(list).to(
Expand All @@ -101,7 +101,7 @@
end

context "when mode: :all" do
it "works" do
it "return all locks including manual" do
list = described_class.list(mode: :all)

expect(list).to(
Expand All @@ -116,7 +116,7 @@
end

context "when mode: :job" do
it "works" do
it "return job locks" do
list = described_class.list(mode: :job)

expect(list).to(
Expand All @@ -128,7 +128,7 @@
end

context "when mode: :batch" do
it "works" do
it "return batch locks" do
list = described_class.list(mode: :batch)

expect(list).to(
Expand Down
Loading
Loading