lhm-shopify 4.2.0 → 4.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1a16e83f2a989c0624948b4ef8bfe2c3b7359aa1420ee5d2c41dee1b9ec6e29
4
- data.tar.gz: 9baa1e49780b70edd51caec39460a3ad440f2d7f10f65aa8295da541a762cd42
3
+ metadata.gz: 0c6d17339f7cb0ec6d9dfa2620e24e5912a4af9302e376297e212be626bd2b15
4
+ data.tar.gz: a50feeaf0d1fa60c07c0410b1e01024a82ec1b5b243bf25013ea57c5c7a84c07
5
5
  SHA512:
6
- metadata.gz: 0d96f3ba67d232682ecb5fa27f9f7cb33f850125546364a41ede17c6dda187e00d8b91e6ab8a5189022e9fd3117af4e9bb6272c1392d0d8510252cea6ae9ac00
7
- data.tar.gz: 407a0497d1ce019d3f7e835ceb157441a1cd76f5723a7a7d3a61d95c2232adb42ac56b6aba9b07d5720eeeab0e6ce6a68d50d297dbd9736fd4e641835d372a86
6
+ metadata.gz: dcd984207e3b4a341ddf72b3be5674d175330a72b292e754a1e7d646924dd191a454c5dbe3c38ed1e2772f08347f3da2e467e16adb9bb107d4fd9f38b3d6d63d
7
+ data.tar.gz: 1e8e0771a774b017c2d8dd64092d7eaaf5fbaba98cbc5772e478be2871d882f55769607abe92b63bd10d62e717e3cb07d90e8e0bb685801994debd48ab618ebb
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ registries:
3
+ ruby-shopify:
4
+ type: rubygems-server
5
+ url: https://pkgs.shopify.io/basic/gems/ruby
6
+ username: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_USERNAME}}
7
+ password: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_PASSWORD}}
8
+ github-com:
9
+ type: git
10
+ url: https://github.com
11
+ username: ${{secrets.DEPENDENCIES_GITHUB_USER}}
12
+ password: ${{secrets.DEPENDENCIES_GITHUB_TOKEN}}
13
+ updates:
14
+ - package-ecosystem: bundler
15
+ directory: "/"
16
+ schedule:
17
+ interval: daily
18
+ open-pull-requests-limit: 100
19
+ insecure-external-code-execution: allow
20
+ registries: "*"
@@ -15,7 +15,7 @@ jobs:
15
15
  fail-fast: false
16
16
  matrix:
17
17
  activerecord: ["6.1", "7.0", "7.1"]
18
- ruby: ["3.0", "3.1", "3.2", "head"]
18
+ ruby: ["3.0", "3.1", "3.2", "3.3", "head"]
19
19
  mysql: ["5.7", "8.0"]
20
20
  adapter: ["mysql2", "trilogy"]
21
21
  exclude:
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  .bundle
3
3
  pkg/*
4
4
  .rvmrc
5
- .ruby-version
6
5
  .ruby-gemset
7
6
  bin/rake
8
7
  gemfiles/vendor
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Unreleased
2
2
 
3
+ # 4.2.2 (Jun, 2024)
4
+ * Avoid using the INSTANT algorithm.
5
+
6
+ # 4.2.1 (Mar, 2024)
7
+ * Retry more errors when using Trilogy.
8
+
3
9
  # 4.2.0 (Mar, 2024)
4
10
  * Support `DROP DEFAULT` & `SET DEFAULT` in `change_column` operations.
5
11
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lhm-shopify (4.2.0)
4
+ lhm-shopify (4.2.2)
5
5
  retriable (>= 3.0.0)
6
6
 
7
7
  GEM
data/dev.yml CHANGED
@@ -5,7 +5,7 @@ up:
5
5
  or: [mysql@5.7]
6
6
  conflicts: [shopify/shopify/mysql-client, mysql-connector-c, mysql, mysql-client]
7
7
  - wget
8
- - ruby: 3.2.2
8
+ - ruby
9
9
  - bundler
10
10
  - podman
11
11
  - custom:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lhm-shopify (4.2.0)
4
+ lhm-shopify (4.2.2)
5
5
  retriable (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lhm-shopify (4.2.0)
4
+ lhm-shopify (4.2.2)
5
5
  retriable (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lhm-shopify (4.2.0)
4
+ lhm-shopify (4.2.2)
5
5
  retriable (>= 3.0.0)
6
6
 
7
7
  GEM
data/lib/lhm/migrator.rb CHANGED
@@ -53,7 +53,7 @@ module Lhm
53
53
  # @param [String] name Name of the column to add
54
54
  # @param [String] definition Valid SQL column definition
55
55
  def add_column(name, definition)
56
- ddl('alter table `%s` add column `%s` %s' % [@name, name, definition])
56
+ ddl('alter table `%s` add column `%s` %s, ALGORITHM=INPLACE' % [@name, name, definition])
57
57
  end
58
58
 
59
59
  # Change an existing column to a new definition
@@ -94,7 +94,7 @@ module Lhm
94
94
  definition += " COMMENT #{@connection.quote(col[:comment])}" if col[:comment]
95
95
  definition += " COLLATE #{@connection.quote(col[:collate])}" if col[:collate]
96
96
 
97
- ddl('alter table `%s` change column `%s` `%s` %s' % [@name, old, nu, definition])
97
+ ddl('alter table `%s` change column `%s` `%s` %s, ALGORITHM=INPLACE' % [@name, old, nu, definition])
98
98
  @renames[old.to_s] = nu.to_s
99
99
  end
100
100
 
@@ -108,7 +108,7 @@ module Lhm
108
108
  #
109
109
  # @param [String] name Name of the column to delete
110
110
  def remove_column(name)
111
- ddl('alter table `%s` drop `%s`' % [@name, name])
111
+ ddl('alter table `%s` drop `%s`, ALGORITHM=INPLACE' % [@name, name])
112
112
  end
113
113
 
114
114
  # Add an index to a table
data/lib/lhm/sql_retry.rb CHANGED
@@ -186,13 +186,26 @@ module Lhm
186
186
  def retriable_trilogy_errors
187
187
  return unless defined?(Trilogy::BaseError)
188
188
 
189
- {
189
+ errors = {
190
190
  ActiveRecord::StatementInvalid => [
191
- # Those sometimes appear as Trilogy::TimeoutError, and sometimes as ActiveRecord::StatementInvalid
192
191
  /Lock wait timeout exceeded/,
192
+ /Timeout waiting for a response from the last query/,
193
+ /Deadlock found when trying to get lock/,
194
+ /Query execution was interrupted/,
195
+ /Lost connection to MySQL server during query/,
196
+ /Max connect timeout reached/,
197
+ /Unknown MySQL server host/,
198
+ /connection is locked to hostgroup/,
199
+ /The MySQL server is running with the --read-only option so it cannot execute this statement/,
193
200
  ],
194
201
  Trilogy::ConnectionError => nil,
195
202
  }
203
+
204
+ if ActiveRecord::VERSION::STRING >= "7.1"
205
+ errors[ActiveRecord::ConnectionFailed] = nil
206
+ end
207
+
208
+ errors
196
209
  end
197
210
  end
198
211
  end
data/lib/lhm/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Schmidt
3
3
 
4
4
  module Lhm
5
- VERSION = '4.2.0'
5
+ VERSION = '4.2.2'
6
6
  end
@@ -2,6 +2,7 @@
2
2
  # Schmidt
3
3
 
4
4
  require File.expand_path(File.dirname(__FILE__)) + '/integration_helper'
5
+ require 'ostruct'
5
6
 
6
7
  describe Lhm, 'cleanup' do
7
8
  include IntegrationHelper
@@ -97,7 +97,7 @@ describe Lhm::Migrator do
97
97
  @creator.add_column('logins', 'INT(12)')
98
98
 
99
99
  value(@creator.statements).must_equal([
100
- 'alter table `lhmn_alt` add column `logins` INT(12)'
100
+ 'alter table `lhmn_alt` add column `logins` INT(12), ALGORITHM=INPLACE'
101
101
  ])
102
102
  end
103
103
 
@@ -105,7 +105,7 @@ describe Lhm::Migrator do
105
105
  @creator.remove_column('logins')
106
106
 
107
107
  value(@creator.statements).must_equal([
108
- 'alter table `lhmn_alt` drop `logins`'
108
+ 'alter table `lhmn_alt` drop `logins`, ALGORITHM=INPLACE'
109
109
  ])
110
110
  end
111
111
 
@@ -151,10 +151,10 @@ describe Lhm::Migrator do
151
151
  value(@creator.statements.length).must_equal(2)
152
152
 
153
153
  value(@creator.statements[0])
154
- .must_equal('alter table `lhmn_alt` add column `first` VARCHAR(64)')
154
+ .must_equal('alter table `lhmn_alt` add column `first` VARCHAR(64), ALGORITHM=INPLACE')
155
155
 
156
156
  value(@creator.statements[1])
157
- .must_equal('alter table `lhmn_alt` add column `last` VARCHAR(64)')
157
+ .must_equal('alter table `lhmn_alt` add column `last` VARCHAR(64), ALGORITHM=INPLACE')
158
158
  end
159
159
  end
160
160
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhm-shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SoundCloud
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2024-03-04 00:00:00.000000000 Z
15
+ date: 2024-06-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: retriable
@@ -190,9 +190,11 @@ executables: []
190
190
  extensions: []
191
191
  extra_rdoc_files: []
192
192
  files:
193
+ - ".github/dependabot.yml"
193
194
  - ".github/workflows/test.yml"
194
195
  - ".gitignore"
195
196
  - ".rubocop.yml"
197
+ - ".ruby-version"
196
198
  - Appraisals
197
199
  - CHANGELOG.md
198
200
  - Gemfile
@@ -320,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
320
322
  - !ruby/object:Gem::Version
321
323
  version: '0'
322
324
  requirements: []
323
- rubygems_version: 3.5.6
325
+ rubygems_version: 3.5.11
324
326
  signing_key:
325
327
  specification_version: 4
326
328
  summary: online schema changer for mysql