Skip to content

Commit 05c1980

Browse files
feat: support ruby 3.4 (#359)
* feat: ruby 3.1 * Force CI re-evaluation * more details * more details * less details * more details * add exclusion to nightly unit tests
1 parent c25c56b commit 05c1980

File tree

8 files changed

+42
-10
lines changed

8 files changed

+42
-10
lines changed

.github/workflows/acceptance-tests-on-emulator.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ jobs:
1818
strategy:
1919
max-parallel: 4
2020
matrix:
21-
ruby: ["3.1", "3.2", "3.3"]
21+
ruby: ["3.1", "3.2", "3.3", "3.4"]
2222
ar: ["~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"]
2323
# Exclude combinations that are not supported.
2424
exclude:
2525
- ruby: "3.1"
2626
ar: "~> 8.0.0"
27+
- ruby: "3.4"
28+
ar: "~> 7.0.0"
29+
- ruby: "3.4"
30+
ar: "~> 7.1.0"
31+
- ruby: "3.4"
32+
ar: "~> 7.2.0"
2733
env:
2834
AR_VERSION: ${{ matrix.ar }}
2935
steps:

.github/workflows/ci.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ jobs:
1010
strategy:
1111
max-parallel: 4
1212
matrix:
13-
ruby: ["3.1", "3.2", "3.3"]
13+
ruby: ["3.1", "3.2", "3.3", "3.4"]
1414
ar: ["~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"]
1515
# Exclude combinations that are not supported.
1616
exclude:
1717
- ruby: "3.1"
1818
ar: "~> 8.0.0"
19+
- ruby: "3.4"
20+
ar: "~> 7.0.0"
21+
- ruby: "3.4"
22+
ar: "~> 7.1.0"
23+
- ruby: "3.4"
24+
ar: "~> 7.2.0"
1925
env:
2026
AR_VERSION: ${{ matrix.ar }}
2127
steps:
@@ -30,4 +36,4 @@ jobs:
3036
- name: Install dependencies
3137
run: bundle install
3238
- name: Run tests
33-
run: bundle exec rake test TESTOPTS="-v"
39+
run: bundle exec rake test --trace TESTOPTS="-v"

.github/workflows/nightly-acceptance-tests-on-emulator.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ jobs:
1818
strategy:
1919
max-parallel: 4
2020
matrix:
21-
ruby: ["3.1", "3.2", "3.3"]
21+
ruby: ["3.1", "3.2", "3.3", "3.4"]
2222
ar: ["~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"]
2323
# Exclude combinations that are not supported.
2424
exclude:
2525
- ruby: "3.1"
2626
ar: "~> 8.0.0"
27+
- ruby: "3.4"
28+
ar: "~> 7.0.0"
29+
- ruby: "3.4"
30+
ar: "~> 7.1.0"
31+
- ruby: "3.4"
32+
ar: "~> 7.2.0"
2733
env:
2834
AR_VERSION: ${{ matrix.ar }}
2935
steps:

.github/workflows/nightly-unit-tests.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ jobs:
1111
max-parallel: 4
1212
matrix:
1313
# Run acceptance tests all supported combinations of Ruby and ActiveRecord.
14-
ruby: ["3.1", "3.2", "3.3"]
14+
ruby: ["3.1", "3.2", "3.3", "3.4"]
1515
ar: ["~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"]
1616
# Exclude combinations that are not supported.
1717
exclude:
1818
- ruby: "3.1"
1919
ar: "~> 8.0.0"
20+
- ruby: "3.4"
21+
ar: "~> 7.0.0"
22+
- ruby: "3.4"
23+
ar: "~> 7.1.0"
24+
- ruby: "3.4"
25+
ar: "~> 7.2.0"
2026
env:
2127
AR_VERSION: ${{ matrix.ar }}
2228
steps:

.github/workflows/samples.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
ruby: ["3.1", "3.2", "3.3"]
11+
ruby: ["3.1", "3.2", "3.3", "3.4"]
1212
ar: ["~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"]
1313
# Exclude combinations that are not supported.
1414
exclude:
1515
- ruby: "3.1"
1616
ar: "~> 8.0.0"
17+
- ruby: "3.4"
18+
ar: "~> 7.0.0"
19+
- ruby: "3.4"
20+
ar: "~> 7.1.0"
21+
- ruby: "3.4"
22+
ar: "~> 7.2.0"
1723
env:
1824
AR_VERSION: ${{ matrix.ar }}
1925
steps:

activerecord-spanner-adapter.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030

3131
spec.add_development_dependency "autotest-suffix", "~> 1.1"
3232
spec.add_development_dependency "bundler", "~> 2.0"
33-
spec.add_development_dependency "google-style", "~> 1.30.1"
33+
spec.add_development_dependency "google-style", "~> 1.31.0"
3434
spec.add_development_dependency "minitest", "~> 5.10"
3535
spec.add_development_dependency "minitest-autotest", "~> 1.0"
3636
spec.add_development_dependency "minitest-focus", "~> 1.1"

lib/active_record/connection_adapters/spanner/database_statements.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def internal_exec_query sql, name = "SQL", binds = [], prepare: false, async: fa
2929
end
3030

3131
def internal_execute sql, name = "SQL", binds = [],
32-
prepare: false, async: false, allow_retry: false # rubocop:disable Lint/UnusedMethodArgument, /
32+
prepare: false, async: false, allow_retry: false # rubocop:disable Lint/UnusedMethodArgument
3333
statement_type = sql_statement_type sql
3434
# Call `transform` to invoke any query transformers that might have been registered.
3535
sql = transform sql
@@ -406,8 +406,10 @@ def create_delete_all_mutation arel
406406
end
407407

408408
DDL_REGX = build_sql_statement_regexp(:create, :alter, :drop).freeze
409+
private_constant :DDL_REGX
409410

410411
DML_REGX = build_sql_statement_regexp(:insert, :delete, :update).freeze
412+
private_constant :DML_REGX
411413

412414
def sql_statement_type sql
413415
case sql

lib/activerecord_spanner_adapter/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Base
2121
# Creates an object (or multiple objects) and saves it to the database. This method will use mutations instead
2222
# of DML if there is no active transaction, or if the active transaction has been created with the option
2323
# isolation: :buffered_mutations.
24-
def self.create! attributes = nil, &block
24+
def self.create!(attributes = nil, &)
2525
return super unless spanner_adapter?
2626
return super if active_transaction?
2727

@@ -30,7 +30,7 @@ def self.create! attributes = nil, &block
3030
end
3131
end
3232

33-
def self.create attributes = nil, &block
33+
def self.create(attributes = nil, &)
3434
return super unless spanner_adapter?
3535
return super if active_transaction?
3636

0 commit comments

Comments
 (0)