deimos-ruby 1.24.0 → 1.24.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 +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.ruby-version +1 -2
- data/CHANGELOG.md +6 -0
- data/deimos-ruby.gemspec +1 -0
- data/lib/deimos/active_record_consume/mass_updater.rb +2 -1
- data/lib/deimos/kafka_topic_info.rb +7 -2
- data/lib/deimos/version.rb +1 -1
- data/spec/spec_helper.rb +9 -0
- metadata +17 -4
- data/.circleci/config.yml +0 -83
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2be475993ca3cec87d78682f7724b973f5aadb885612f98d5978169da2932bf
|
|
4
|
+
data.tar.gz: 5ab0f052676184f800965bf68aebecac80583d1da2f38561a305e5f5b57a68c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 918a363d9994537a221ccc6d00131c75a97f36c8cf89bdda47e0a6e6770b36fd1c3b07e5177d0ef284494020d90dd9081bc9d40ec41f4dc8bbe45e9c4165ea1f
|
|
7
|
+
data.tar.gz: 60d316ef05ce427234e366e32f44addd7188adb45345b025bfb9fd21f339d0c579f317f1e55db20185b9f5f825af3226c27cb53d5e9336ec805200d2a9ce5bd9
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -19,10 +19,10 @@ jobs:
|
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v3
|
|
21
21
|
|
|
22
|
-
- name: Set up Ruby
|
|
22
|
+
- name: Set up Ruby 3.3
|
|
23
23
|
uses: ruby/setup-ruby@v1
|
|
24
24
|
with:
|
|
25
|
-
ruby-version:
|
|
25
|
+
ruby-version: 3.3
|
|
26
26
|
bundler-cache: true
|
|
27
27
|
|
|
28
28
|
- name: Bundle install
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
strategy:
|
|
37
37
|
fail-fast: false
|
|
38
38
|
matrix:
|
|
39
|
-
ruby: [ '2.
|
|
39
|
+
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
|
|
40
40
|
|
|
41
41
|
steps:
|
|
42
42
|
- uses: actions/checkout@v3
|
data/.ruby-version
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
2.
|
|
2
|
-
|
|
1
|
+
3.2.2
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## UNRELEASED
|
|
9
9
|
|
|
10
|
+
# 1.24.2 - 2024-05-01
|
|
11
|
+
- Fix: Deprecation notice with Rails 7.
|
|
12
|
+
|
|
13
|
+
# 1.24.1 - 2024-03-26
|
|
14
|
+
- Fix: ActiveRecordConsumer batch consumption was not working with the trilogy adapter.
|
|
15
|
+
|
|
10
16
|
# 1.24.0 - 2024-02-26
|
|
11
17
|
|
|
12
18
|
***BREAKING CHANGE****
|
data/deimos-ruby.gemspec
CHANGED
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.add_runtime_dependency('sigurd', '>= 0.1.0', '< 1.0')
|
|
26
26
|
|
|
27
27
|
spec.add_development_dependency('activerecord-import')
|
|
28
|
+
spec.add_development_dependency('activerecord-trilogy-adapter')
|
|
28
29
|
spec.add_development_dependency('avro', '~> 1.9')
|
|
29
30
|
spec.add_development_dependency('database_cleaner', '~> 1.7')
|
|
30
31
|
spec.add_development_dependency('ddtrace', '>= 0.11')
|
|
@@ -50,7 +50,8 @@ module Deimos
|
|
|
50
50
|
|
|
51
51
|
options = if @key_cols.empty?
|
|
52
52
|
{} # Can't upsert with no key, just do regular insert
|
|
53
|
-
elsif ActiveRecord::Base.connection.adapter_name.downcase =~ /mysql/
|
|
53
|
+
elsif ActiveRecord::Base.connection.adapter_name.downcase =~ /mysql/ ||
|
|
54
|
+
ActiveRecord::Base.connection.adapter_name.downcase =~ /trilogy/
|
|
54
55
|
{
|
|
55
56
|
on_duplicate_key_update: columns
|
|
56
57
|
}
|
|
@@ -6,6 +6,11 @@ module Deimos
|
|
|
6
6
|
self.table_name = 'kafka_topic_info'
|
|
7
7
|
|
|
8
8
|
class << self
|
|
9
|
+
|
|
10
|
+
def quote_time(time)
|
|
11
|
+
time.respond_to?(:to_fs) ? time.to_fs(:db) : time.to_s(:db)
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
# Lock a topic for the given ID. Returns whether the lock was successful.
|
|
10
15
|
# @param topic [String]
|
|
11
16
|
# @param lock_id [String]
|
|
@@ -22,9 +27,9 @@ module Deimos
|
|
|
22
27
|
qtopic = self.connection.quote(topic)
|
|
23
28
|
qlock_id = self.connection.quote(lock_id)
|
|
24
29
|
qtable = self.connection.quote_table_name('kafka_topic_info')
|
|
25
|
-
qnow = self.connection.quote(Time.zone.now
|
|
30
|
+
qnow = self.connection.quote(quote_time(Time.zone.now))
|
|
26
31
|
qfalse = self.connection.quoted_false
|
|
27
|
-
qtime = self.connection.quote(1.minute.ago
|
|
32
|
+
qtime = self.connection.quote(quote_time(1.minute.ago))
|
|
28
33
|
|
|
29
34
|
# If a record is marked as error and less than 1 minute old,
|
|
30
35
|
# we don't want to pick it up even if not currently locked because
|
data/lib/deimos/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -14,6 +14,8 @@ require 'handlers/my_batch_consumer'
|
|
|
14
14
|
require 'handlers/my_consumer'
|
|
15
15
|
require 'rspec/rails'
|
|
16
16
|
require 'rspec/snapshot'
|
|
17
|
+
require "trilogy_adapter/connection"
|
|
18
|
+
ActiveRecord::Base.public_send :extend, TrilogyAdapter::Connection
|
|
17
19
|
Dir['./spec/schemas/**/*.rb'].sort.each { |f| require f }
|
|
18
20
|
|
|
19
21
|
# Constants used for consumer specs
|
|
@@ -94,6 +96,13 @@ module DbConfigs
|
|
|
94
96
|
database: 'test',
|
|
95
97
|
host: ENV['MYSQL_HOST'] || '127.0.0.1'
|
|
96
98
|
},
|
|
99
|
+
{
|
|
100
|
+
adapter: 'trilogy',
|
|
101
|
+
port: 3306,
|
|
102
|
+
username: 'root',
|
|
103
|
+
database: 'test',
|
|
104
|
+
host: ENV['MYSQL_HOST'] || '127.0.0.1'
|
|
105
|
+
},
|
|
97
106
|
{
|
|
98
107
|
adapter: 'sqlite3',
|
|
99
108
|
database: 'test.sqlite3'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deimos-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.24.
|
|
4
|
+
version: 1.24.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Orner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avro_turf
|
|
@@ -112,6 +112,20 @@ dependencies:
|
|
|
112
112
|
- - ">="
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
114
|
version: '0'
|
|
115
|
+
- !ruby/object:Gem::Dependency
|
|
116
|
+
name: activerecord-trilogy-adapter
|
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - ">="
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '0'
|
|
122
|
+
type: :development
|
|
123
|
+
prerelease: false
|
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - ">="
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '0'
|
|
115
129
|
- !ruby/object:Gem::Dependency
|
|
116
130
|
name: avro
|
|
117
131
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -401,7 +415,6 @@ executables:
|
|
|
401
415
|
extensions: []
|
|
402
416
|
extra_rdoc_files: []
|
|
403
417
|
files:
|
|
404
|
-
- ".circleci/config.yml"
|
|
405
418
|
- ".github/workflows/ci.yml"
|
|
406
419
|
- ".gitignore"
|
|
407
420
|
- ".gitmodules"
|
|
@@ -636,7 +649,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
636
649
|
- !ruby/object:Gem::Version
|
|
637
650
|
version: '0'
|
|
638
651
|
requirements: []
|
|
639
|
-
rubygems_version: 3.
|
|
652
|
+
rubygems_version: 3.4.10
|
|
640
653
|
signing_key:
|
|
641
654
|
specification_version: 4
|
|
642
655
|
summary: Kafka libraries for Ruby.
|
data/.circleci/config.yml
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
defaults: &defaults
|
|
2
|
-
parallelism: 1
|
|
3
|
-
working_directory: ~/workspace
|
|
4
|
-
docker:
|
|
5
|
-
- image: ruby:2.6
|
|
6
|
-
environment:
|
|
7
|
-
RAILS_ENV: test
|
|
8
|
-
DB_HOST_IP: 127.0.0.1
|
|
9
|
-
version: 2.1
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
<<: *defaults
|
|
13
|
-
steps:
|
|
14
|
-
- checkout
|
|
15
|
-
|
|
16
|
-
# Restore bundle cache & npm cache
|
|
17
|
-
- restore_cache:
|
|
18
|
-
key: 'rails-{{ checksum "Gemfile.lock" }}'
|
|
19
|
-
|
|
20
|
-
# Bundle install dependencies in /tmp/
|
|
21
|
-
# so Dockerfile does not copy them since
|
|
22
|
-
# its base image is different than CircleCI
|
|
23
|
-
- run:
|
|
24
|
-
name: Install bundler
|
|
25
|
-
command: gem install bundler:2.1.4
|
|
26
|
-
- run:
|
|
27
|
-
name: Bundle install
|
|
28
|
-
command: bundle install --path vendor/bundle --jobs=4 --retry=3
|
|
29
|
-
|
|
30
|
-
# Store bundle cache
|
|
31
|
-
- save_cache:
|
|
32
|
-
key: 'rails-{{ checksum "Gemfile.lock" }}'
|
|
33
|
-
paths:
|
|
34
|
-
- ~/workspace/vendor/bundle
|
|
35
|
-
|
|
36
|
-
- persist_to_workspace:
|
|
37
|
-
root: ~/workspace
|
|
38
|
-
paths:
|
|
39
|
-
- .
|
|
40
|
-
|
|
41
|
-
lint:
|
|
42
|
-
<<: *defaults
|
|
43
|
-
steps:
|
|
44
|
-
- attach_workspace:
|
|
45
|
-
at: ~/workspace
|
|
46
|
-
- run:
|
|
47
|
-
name: Install bundler
|
|
48
|
-
command: gem install bundler:2.1.4
|
|
49
|
-
- run:
|
|
50
|
-
name: Point bundle to vendor/bundle
|
|
51
|
-
command: bundle --path vendor/bundle
|
|
52
|
-
- run: bundle exec rubocop --display-only-fail-level-offenses --fail-level C
|
|
53
|
-
|
|
54
|
-
test-rspec:
|
|
55
|
-
<<: *defaults
|
|
56
|
-
steps:
|
|
57
|
-
- attach_workspace:
|
|
58
|
-
at: ~/workspace
|
|
59
|
-
- run:
|
|
60
|
-
name: Install bundler
|
|
61
|
-
command: gem install bundler:2.1.4
|
|
62
|
-
- run:
|
|
63
|
-
name: Point bundle to vendor/bundle
|
|
64
|
-
command: bundle --path vendor/bundle
|
|
65
|
-
- run: mkdir result
|
|
66
|
-
- run:
|
|
67
|
-
name: Running rspec
|
|
68
|
-
command: bundle exec rspec --format progress --format RspecJunitFormatter -o result/rspec.xml
|
|
69
|
-
when: always
|
|
70
|
-
- store_test_results:
|
|
71
|
-
path: ~/workspace/result
|
|
72
|
-
|
|
73
|
-
workflows:
|
|
74
|
-
version: 2
|
|
75
|
-
build-and-test:
|
|
76
|
-
jobs:
|
|
77
|
-
- build
|
|
78
|
-
- test-rspec:
|
|
79
|
-
requires:
|
|
80
|
-
- build
|
|
81
|
-
- lint:
|
|
82
|
-
requires:
|
|
83
|
-
- build
|