Skip to content

Commit fdbe5e7

Browse files
authored
Merge pull request #575 from 3scale/THREESCALE-12077-rails-72
THREESCALE-12077: Upgrade to Rails 7.2
2 parents 2fc175c + 5749073 commit fdbe5e7

13 files changed

Lines changed: 237 additions & 171 deletions

File tree

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ git_source(:github) do |repo_name|
66
"https://github.com/#{repo_name}.git"
77
end
88

9-
gem 'rails', '~> 7.1.6'
9+
gem "mutex_m", "~> 0.3.0"
10+
gem "csv", "~> 3.3"
11+
12+
gem 'rails', '~> 7.2.3'
1013
gem 'zeitwerk', '~> 2.6.18' # keep zeitwerk 2.6 until Ruby is 3.2 or higher
1114
gem 'pg', '~> 1.6.2'
1215

Gemfile.lock

Lines changed: 82 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -9,85 +9,79 @@ GEM
99
remote: https://rubygems.org/
1010
specs:
1111
3scale-api (1.4.0)
12-
actioncable (7.1.6)
13-
actionpack (= 7.1.6)
14-
activesupport (= 7.1.6)
12+
actioncable (7.2.3)
13+
actionpack (= 7.2.3)
14+
activesupport (= 7.2.3)
1515
nio4r (~> 2.0)
1616
websocket-driver (>= 0.6.1)
1717
zeitwerk (~> 2.6)
18-
actionmailbox (7.1.6)
19-
actionpack (= 7.1.6)
20-
activejob (= 7.1.6)
21-
activerecord (= 7.1.6)
22-
activestorage (= 7.1.6)
23-
activesupport (= 7.1.6)
24-
mail (>= 2.7.1)
25-
net-imap
26-
net-pop
27-
net-smtp
28-
actionmailer (7.1.6)
29-
actionpack (= 7.1.6)
30-
actionview (= 7.1.6)
31-
activejob (= 7.1.6)
32-
activesupport (= 7.1.6)
33-
mail (~> 2.5, >= 2.5.4)
34-
net-imap
35-
net-pop
36-
net-smtp
18+
actionmailbox (7.2.3)
19+
actionpack (= 7.2.3)
20+
activejob (= 7.2.3)
21+
activerecord (= 7.2.3)
22+
activestorage (= 7.2.3)
23+
activesupport (= 7.2.3)
24+
mail (>= 2.8.0)
25+
actionmailer (7.2.3)
26+
actionpack (= 7.2.3)
27+
actionview (= 7.2.3)
28+
activejob (= 7.2.3)
29+
activesupport (= 7.2.3)
30+
mail (>= 2.8.0)
3731
rails-dom-testing (~> 2.2)
38-
actionpack (7.1.6)
39-
actionview (= 7.1.6)
40-
activesupport (= 7.1.6)
32+
actionpack (7.2.3)
33+
actionview (= 7.2.3)
34+
activesupport (= 7.2.3)
4135
cgi
4236
nokogiri (>= 1.8.5)
4337
racc
44-
rack (>= 2.2.4)
38+
rack (>= 2.2.4, < 3.3)
4539
rack-session (>= 1.0.1)
4640
rack-test (>= 0.6.3)
4741
rails-dom-testing (~> 2.2)
4842
rails-html-sanitizer (~> 1.6)
49-
actiontext (7.1.6)
50-
actionpack (= 7.1.6)
51-
activerecord (= 7.1.6)
52-
activestorage (= 7.1.6)
53-
activesupport (= 7.1.6)
43+
useragent (~> 0.16)
44+
actiontext (7.2.3)
45+
actionpack (= 7.2.3)
46+
activerecord (= 7.2.3)
47+
activestorage (= 7.2.3)
48+
activesupport (= 7.2.3)
5449
globalid (>= 0.6.0)
5550
nokogiri (>= 1.8.5)
56-
actionview (7.1.6)
57-
activesupport (= 7.1.6)
51+
actionview (7.2.3)
52+
activesupport (= 7.2.3)
5853
builder (~> 3.1)
5954
cgi
6055
erubi (~> 1.11)
6156
rails-dom-testing (~> 2.2)
6257
rails-html-sanitizer (~> 1.6)
63-
activejob (7.1.6)
64-
activesupport (= 7.1.6)
58+
activejob (7.2.3)
59+
activesupport (= 7.2.3)
6560
globalid (>= 0.3.6)
66-
activemodel (7.1.6)
67-
activesupport (= 7.1.6)
68-
activerecord (7.1.6)
69-
activemodel (= 7.1.6)
70-
activesupport (= 7.1.6)
61+
activemodel (7.2.3)
62+
activesupport (= 7.2.3)
63+
activerecord (7.2.3)
64+
activemodel (= 7.2.3)
65+
activesupport (= 7.2.3)
7166
timeout (>= 0.4.0)
72-
activestorage (7.1.6)
73-
actionpack (= 7.1.6)
74-
activejob (= 7.1.6)
75-
activerecord (= 7.1.6)
76-
activesupport (= 7.1.6)
67+
activestorage (7.2.3)
68+
actionpack (= 7.2.3)
69+
activejob (= 7.2.3)
70+
activerecord (= 7.2.3)
71+
activesupport (= 7.2.3)
7772
marcel (~> 1.0)
78-
activesupport (7.1.6)
73+
activesupport (7.2.3)
7974
base64
8075
benchmark (>= 0.3)
8176
bigdecimal
82-
concurrent-ruby (~> 1.0, >= 1.0.2)
77+
concurrent-ruby (~> 1.0, >= 1.3.1)
8378
connection_pool (>= 2.2.5)
8479
drb
8580
i18n (>= 1.6, < 2)
8681
logger (>= 1.4.2)
8782
minitest (>= 5.1)
88-
mutex_m
8983
securerandom (>= 0.3)
90-
tzinfo (~> 2.0)
84+
tzinfo (~> 2.0, >= 2.0.5)
9185
addressable (2.8.0)
9286
public_suffix (>= 2.0.2, < 5.0)
9387
ansi (1.5.0)
@@ -103,16 +97,17 @@ GEM
10397
concurrent-ruby (~> 1.0)
10498
builder (3.3.0)
10599
byebug (12.0.0)
106-
cgi (0.5.0)
100+
cgi (0.5.1)
107101
codecov (0.4.3)
108102
simplecov (>= 0.15, < 0.22)
109103
coderay (1.1.3)
110-
concurrent-ruby (1.3.5)
111-
connection_pool (2.5.4)
104+
concurrent-ruby (1.3.6)
105+
connection_pool (3.0.2)
112106
crack (0.4.5)
113107
rexml
114108
crass (1.0.6)
115-
date (3.5.0)
109+
csv (3.3.5)
110+
date (3.5.1)
116111
debug_inspector (1.2.0)
117112
docile (1.3.5)
118113
drb (2.2.3)
@@ -142,8 +137,7 @@ GEM
142137
dry-inflector (~> 1.0)
143138
dry-logic (~> 1.4)
144139
zeitwerk (~> 2.6)
145-
erb (4.0.4)
146-
cgi (>= 0.3.3)
140+
erb (6.0.1)
147141
erubi (1.13.1)
148142
excon (0.112.0)
149143
faraday (1.3.0)
@@ -154,12 +148,12 @@ GEM
154148
globalid (1.3.0)
155149
activesupport (>= 6.1)
156150
hashdiff (1.2.1)
157-
i18n (1.14.7)
151+
i18n (1.14.8)
158152
concurrent-ruby (~> 1.0)
159153
ice_nine (0.11.2)
160154
interception (0.5)
161-
io-console (0.8.1)
162-
irb (1.15.3)
155+
io-console (0.8.2)
156+
irb (1.16.0)
163157
pp (>= 0.6.0)
164158
rdoc (>= 4.0.0)
165159
reline (>= 0.4.2)
@@ -193,7 +187,7 @@ GEM
193187
activesupport (>= 4)
194188
railties (>= 4)
195189
request_store (~> 1.0)
196-
loofah (2.24.1)
190+
loofah (2.25.0)
197191
crass (~> 1.0.2)
198192
nokogiri (>= 1.12.0)
199193
mail (2.9.0)
@@ -222,7 +216,7 @@ GEM
222216
mustermann (2.0.2)
223217
ruby2_keywords (~> 0.0.1)
224218
mutex_m (0.3.0)
225-
net-imap (0.5.12)
219+
net-imap (0.6.2)
226220
date
227221
net-protocol
228222
net-pop (0.1.2)
@@ -232,7 +226,7 @@ GEM
232226
net-smtp (0.5.1)
233227
net-protocol
234228
nio4r (2.7.5)
235-
nokogiri (1.18.10)
229+
nokogiri (1.19.0)
236230
mini_portile2 (~> 2.8.2)
237231
racc (~> 1.4)
238232
oauth2 (1.4.7)
@@ -266,7 +260,7 @@ GEM
266260
pry-stack_explorer (0.6.1)
267261
binding_of_caller (~> 1.0)
268262
pry (~> 0.13)
269-
psych (5.2.6)
263+
psych (5.3.1)
270264
date
271265
stringio
272266
public_suffix (4.0.6)
@@ -287,40 +281,40 @@ GEM
287281
rackup (1.0.1)
288282
rack (< 3)
289283
webrick
290-
rails (7.1.6)
291-
actioncable (= 7.1.6)
292-
actionmailbox (= 7.1.6)
293-
actionmailer (= 7.1.6)
294-
actionpack (= 7.1.6)
295-
actiontext (= 7.1.6)
296-
actionview (= 7.1.6)
297-
activejob (= 7.1.6)
298-
activemodel (= 7.1.6)
299-
activerecord (= 7.1.6)
300-
activestorage (= 7.1.6)
301-
activesupport (= 7.1.6)
284+
rails (7.2.3)
285+
actioncable (= 7.2.3)
286+
actionmailbox (= 7.2.3)
287+
actionmailer (= 7.2.3)
288+
actionpack (= 7.2.3)
289+
actiontext (= 7.2.3)
290+
actionview (= 7.2.3)
291+
activejob (= 7.2.3)
292+
activemodel (= 7.2.3)
293+
activerecord (= 7.2.3)
294+
activestorage (= 7.2.3)
295+
activesupport (= 7.2.3)
302296
bundler (>= 1.15.0)
303-
railties (= 7.1.6)
297+
railties (= 7.2.3)
304298
rails-dom-testing (2.3.0)
305299
activesupport (>= 5.0.0)
306300
minitest
307301
nokogiri (>= 1.6)
308302
rails-html-sanitizer (1.6.2)
309303
loofah (~> 2.21)
310304
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
311-
railties (7.1.6)
312-
actionpack (= 7.1.6)
313-
activesupport (= 7.1.6)
305+
railties (7.2.3)
306+
actionpack (= 7.2.3)
307+
activesupport (= 7.2.3)
314308
cgi
315-
irb
309+
irb (~> 1.13)
316310
rackup (>= 1.0.0)
317311
rake (>= 12.2)
318312
thor (~> 1.0, >= 1.2.2)
319313
tsort (>= 0.2)
320314
zeitwerk (~> 2.6)
321315
rainbow (3.1.1)
322316
rake (13.3.1)
323-
rdoc (6.15.1)
317+
rdoc (7.1.0)
324318
erb
325319
psych (>= 4.0.0)
326320
tsort
@@ -374,25 +368,26 @@ GEM
374368
rack (~> 2.2)
375369
rack-protection (= 2.2.3)
376370
tilt (~> 2.0)
377-
stringio (3.1.8)
378-
thor (1.4.0)
371+
stringio (3.2.0)
372+
thor (1.5.0)
379373
tilt (2.0.11)
380-
timeout (0.4.4)
374+
timeout (0.6.0)
381375
tomlrb (2.0.3)
382376
tsort (0.2.0)
383377
tzinfo (2.0.6)
384378
concurrent-ruby (~> 1.0)
385379
unicode-display_width (3.2.0)
386380
unicode-emoji (~> 4.1)
387381
unicode-emoji (4.1.0)
382+
useragent (0.16.11)
388383
validate_url (1.0.15)
389384
activemodel (>= 3.0.0)
390385
public_suffix
391386
webmock (3.11.2)
392387
addressable (>= 2.3.6)
393388
crack (>= 0.3.2)
394389
hashdiff (>= 0.4.0, < 2.0.0)
395-
webrick (1.8.2)
390+
webrick (1.9.2)
396391
websocket-driver (0.8.0)
397392
base64
398393
websocket-extensions (>= 0.1.0)
@@ -426,13 +421,15 @@ DEPENDENCIES
426421
bootsnap (>= 1.4.4)
427422
bugsnag
428423
codecov
424+
csv (~> 3.3)
429425
httpclient!
430426
k8s-ruby
431427
license_finder (~> 7.0.1)
432428
lograge
433429
message_bus
434430
minitest-reporters
435431
minitest-stub-const
432+
mutex_m (~> 0.3.0)
436433
oauth2
437434
pg (~> 1.6.2)
438435
prometheus-client (~> 2.1.0)
@@ -443,7 +440,7 @@ DEPENDENCIES
443440
puma (~> 5.2)
444441
que (~> 2.4.1)
445442
que-web
446-
rails (~> 7.1.6)
443+
rails (~> 7.2.3)
447444
responders (~> 3.0.1)
448445
rubocop
449446
rubocop-performance

app/models/integration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Integration < ApplicationRecord
44
belongs_to :model
55
has_many :integration_states, dependent: :destroy
66

7-
enum state: %i[active disabled].index_with{ |status| status.to_s }
7+
enum :state, %i[active disabled].index_with{ |status| status.to_s }
88

99
def self.tenant_or_model(tenant, model)
1010
by_tenant = where(tenant: tenant, model_id: nil)

bin/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require "fileutils"
33

44
# path to your application root.
55
APP_ROOT = File.expand_path("..", __dir__)
6+
APP_NAME = "zync"
67

78
def system!(*args)
89
system(*args, exception: true)

config/application.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
module Zync
2222
class Application < Rails::Application
2323
# Initialize configuration defaults for originally generated Rails version.
24-
config.load_defaults 7.1
24+
config.load_defaults 7.2
2525

2626
# Please, add to the `ignore` list any other `lib` subdirectories that do
2727
# not contain `.rb` files, or that should not be reloaded or eager loaded.
2828
# Common ones are `templates`, `generators`, or `middleware`, for example.
29-
# config.autoload_lib(ignore: %w(tasks puma generators prometheus que))
29+
# config.autoload_lib(ignore: %w(assets tasks puma generators prometheus que))
3030

3131
# Que needs :sql because of advanced PostgreSQL features
3232
config.active_record.schema_format = :sql
@@ -41,6 +41,13 @@ class Application < Rails::Application
4141

4242
config.active_job.queue_adapter = :que
4343

44+
# This rails setting changed several time for the last Rails version
45+
# https://github.com/rails/rails/blob/6f39910d26eb590cb214a0fce5858fe0d7ddfff8/activejob/CHANGELOG.md?plain=1#L48-L58
46+
#
47+
# For Rails 7.2, set it to `:always`: https://github.com/que-rb/que/issues/430
48+
# For Rails 8.0+, Remove it
49+
config.active_job.enqueue_after_transaction_commit = :always
50+
4451
begin
4552
que = config_for(:que)&.deep_symbolize_keys
4653

0 commit comments

Comments
 (0)