Skip to content

Commit e5cfbc0

Browse files
authored
Merge pull request #4125 from envato/rails-7.0
Bump Rails from 6.1 to 7.0
2 parents 26b3832 + 416f254 commit e5cfbc0

32 files changed

+249
-132
lines changed

.bundler-audit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
# - leave file with `ignore: []` if ignore list is empty
55
ignore:
66
- CVE-2024-6484 # ignore until a patch is available https://github.com/advisories/GHSA-9mvj-f7w8-pvh2
7-
- CVE-2024-54133 # ignore until Rails is upgraded to >= 7.0

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ vendor/bundle
3333

3434
# rake assets:precompile results
3535
/public/assets
36+
/public/assets_dev
3637

3738
# app/models/git_repository.rb repository storage
3839
/cached_repos/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
# rake assets:precompile results
2222
/public/assets
23+
/public/assets_dev
2324

2425
# app/models/git_repository.rb repository storage
2526
/cached_repos/

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ ruby File.read('.ruby-version').strip
55

66
# gems that have rails engines are are always needed
77
group :preload do
8-
rails_version = '~> 6.1.7'
8+
rails_version = '~> 7.0.8'
99
gem 'railties', rails_version
1010
gem 'actioncable', rails_version
1111
gem 'actionmailer', rails_version
1212
gem 'activerecord', rails_version
1313

14+
gem 'mutex_m' # An undeclared activesupport dependency. Remove once running Rails 7.1.
15+
16+
gem 'csv'
1417
gem 'dotenv'
1518
gem 'connection_pool'
1619
gem 'marco-polo' # TODO: https://github.com/arches/marco-polo/pull/16

Gemfile.lock

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -211,58 +211,60 @@ GEM
211211
GEM
212212
remote: https://rubygems.org/
213213
specs:
214-
actioncable (6.1.7.10)
215-
actionpack (= 6.1.7.10)
216-
activesupport (= 6.1.7.10)
214+
actioncable (7.0.8.7)
215+
actionpack (= 7.0.8.7)
216+
activesupport (= 7.0.8.7)
217217
nio4r (~> 2.0)
218218
websocket-driver (>= 0.6.1)
219-
actionmailer (6.1.7.10)
220-
actionpack (= 6.1.7.10)
221-
actionview (= 6.1.7.10)
222-
activejob (= 6.1.7.10)
223-
activesupport (= 6.1.7.10)
219+
actionmailer (7.0.8.7)
220+
actionpack (= 7.0.8.7)
221+
actionview (= 7.0.8.7)
222+
activejob (= 7.0.8.7)
223+
activesupport (= 7.0.8.7)
224224
mail (~> 2.5, >= 2.5.4)
225+
net-imap
226+
net-pop
227+
net-smtp
225228
rails-dom-testing (~> 2.0)
226-
actionpack (6.1.7.10)
227-
actionview (= 6.1.7.10)
228-
activesupport (= 6.1.7.10)
229-
rack (~> 2.0, >= 2.0.9)
229+
actionpack (7.0.8.7)
230+
actionview (= 7.0.8.7)
231+
activesupport (= 7.0.8.7)
232+
rack (~> 2.0, >= 2.2.4)
230233
rack-test (>= 0.6.3)
231234
rails-dom-testing (~> 2.0)
232235
rails-html-sanitizer (~> 1.0, >= 1.2.0)
233-
actionview (6.1.7.10)
234-
activesupport (= 6.1.7.10)
236+
actionview (7.0.8.7)
237+
activesupport (= 7.0.8.7)
235238
builder (~> 3.1)
236239
erubi (~> 1.4)
237240
rails-dom-testing (~> 2.0)
238241
rails-html-sanitizer (~> 1.1, >= 1.2.0)
239242
active_hash (3.2.1)
240243
activesupport (>= 5.0.0)
241-
activejob (6.1.7.10)
242-
activesupport (= 6.1.7.10)
244+
activejob (7.0.8.7)
245+
activesupport (= 7.0.8.7)
243246
globalid (>= 0.3.6)
244-
activemodel (6.1.7.10)
245-
activesupport (= 6.1.7.10)
246-
activerecord (6.1.7.10)
247-
activemodel (= 6.1.7.10)
248-
activesupport (= 6.1.7.10)
249-
activesupport (6.1.7.10)
247+
activemodel (7.0.8.7)
248+
activesupport (= 7.0.8.7)
249+
activerecord (7.0.8.7)
250+
activemodel (= 7.0.8.7)
251+
activesupport (= 7.0.8.7)
252+
activesupport (7.0.8.7)
250253
concurrent-ruby (~> 1.0, >= 1.0.2)
251254
i18n (>= 1.6, < 2)
252255
minitest (>= 5.1)
253256
tzinfo (~> 2.0)
254-
zeitwerk (~> 2.3)
255257
addressable (2.8.6)
256258
public_suffix (>= 2.0.2, < 6.0)
257-
airbrake (11.0.3)
258-
airbrake-ruby (~> 5.1)
259-
airbrake-ruby (5.2.1)
260-
rbtree3 (~> 0.5)
259+
airbrake (13.0.4)
260+
airbrake-ruby (~> 6.0)
261+
airbrake-ruby (6.2.2)
262+
rbtree3 (~> 0.6)
261263
ansible (0.2.2)
262-
ar_multi_threaded_transactional_tests (0.5.0)
263-
activerecord (>= 4.2.0, < 6.2.0)
264+
ar_multi_threaded_transactional_tests (0.6.1)
265+
activerecord (>= 6.1.0, < 7.2.0)
264266
ast (2.4.2)
265-
attr_encrypted (3.1.0)
267+
attr_encrypted (4.1.1)
266268
encryptor (~> 3.0.0)
267269
audited (5.4.3)
268270
activerecord (>= 5.0, < 7.2)
@@ -301,7 +303,7 @@ GEM
301303
bootstrap3-datetimepicker-rails (4.17.47)
302304
momentjs-rails (>= 2.8.1)
303305
brakeman (5.4.1)
304-
builder (3.2.4)
306+
builder (3.3.0)
305307
bundler-audit (0.9.1)
306308
bundler (>= 1.2.0, < 3)
307309
thor (~> 1.0)
@@ -310,12 +312,13 @@ GEM
310312
concurrent-ruby
311313
coderay (1.1.3)
312314
commonmarker (0.23.10)
313-
concurrent-ruby (1.3.1)
315+
concurrent-ruby (1.3.4)
314316
connection_pool (2.4.1)
315317
crack (0.4.6)
316318
bigdecimal
317319
rexml
318320
crass (1.0.6)
321+
csv (3.3.2)
319322
dalli (3.2.7)
320323
base64
321324
date (3.3.4)
@@ -329,7 +332,7 @@ GEM
329332
railties (>= 5)
330333
dotenv (2.8.1)
331334
encryptor (3.0.0)
332-
erubi (1.12.0)
335+
erubi (1.13.0)
333336
execjs (2.9.1)
334337
faraday (2.8.1)
335338
base64
@@ -357,17 +360,17 @@ GEM
357360
flowdock (0.7.1)
358361
httparty (~> 0.7)
359362
multi_json
360-
forking_test_runner (1.13.0)
363+
forking_test_runner (1.15.0)
361364
parallel_tests (>= 1.3.7)
362365
git_diff_parser (3.2.0)
363366
gitlab (4.19.0)
364367
httparty (~> 0.20)
365368
terminal-table (>= 1.5.1)
366369
globalid (1.2.1)
367370
activesupport (>= 6.1)
368-
goldiloader (3.2.0)
369-
activerecord (>= 4.2, < 6.3)
370-
activesupport (>= 4.2, < 6.3)
371+
goldiloader (5.3.1)
372+
activerecord (>= 6.1, < 8)
373+
activesupport (>= 6.1, < 8)
371374
hashie (5.0.0)
372375
http (5.2.0)
373376
addressable (~> 2.8)
@@ -382,7 +385,7 @@ GEM
382385
httparty (0.21.0)
383386
mini_mime (>= 1.0.0)
384387
multi_xml (>= 0.5.2)
385-
i18n (1.14.5)
388+
i18n (1.14.6)
386389
concurrent-ruby (~> 1.0)
387390
inflection (1.0.0)
388391
interception (0.5)
@@ -442,6 +445,7 @@ GEM
442445
multi_json (1.15.0)
443446
multi_xml (0.6.0)
444447
multipart-post (2.3.0)
448+
mutex_m (0.3.0)
445449
mysql2 (0.5.6)
446450
net-http-persistent (4.0.2)
447451
connection_pool (~> 2.2)
@@ -501,7 +505,7 @@ GEM
501505
omniauth (~> 2.0)
502506
pagy (4.11.0)
503507
parallel (1.26.3)
504-
parallel_tests (2.32.0)
508+
parallel_tests (4.7.2)
505509
parallel
506510
parser (3.3.6.0)
507511
ast (~> 2.4.1)
@@ -527,7 +531,7 @@ GEM
527531
nio4r (~> 2.0)
528532
pyu-ruby-sasl (0.0.3.3)
529533
racc (1.8.1)
530-
rack (2.2.9)
534+
rack (2.2.10)
531535
rack-mini-profiler (3.3.0)
532536
rack (>= 1.2.0)
533537
rack-protection (3.2.0)
@@ -546,12 +550,13 @@ GEM
546550
rails-html-sanitizer (1.6.2)
547551
loofah (~> 2.21)
548552
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)
549-
railties (6.1.7.10)
550-
actionpack (= 6.1.7.10)
551-
activesupport (= 6.1.7.10)
553+
railties (7.0.8.7)
554+
actionpack (= 7.0.8.7)
555+
activesupport (= 7.0.8.7)
552556
method_source
553557
rake (>= 12.2)
554558
thor (~> 1.0)
559+
zeitwerk (~> 2.5)
555560
rainbow (3.1.1)
556561
rake (13.2.1)
557562
rbtree3 (0.7.1)
@@ -637,7 +642,7 @@ GEM
637642
stackprof (0.2.12)
638643
terminal-table (3.0.2)
639644
unicode-display_width (>= 1.1.1, < 3)
640-
thor (1.3.1)
645+
thor (1.3.2)
641646
tilt (2.3.0)
642647
timeout (0.4.1)
643648
tzinfo (2.0.6)
@@ -657,7 +662,7 @@ GEM
657662
websocket-driver (0.7.6)
658663
websocket-extensions (>= 0.1.0)
659664
websocket-extensions (0.1.5)
660-
zeitwerk (2.6.15)
665+
zeitwerk (2.7.1)
661666
zendesk_api (2.0.1)
662667
faraday (> 2.0.0)
663668
faraday-multipart
@@ -675,10 +680,10 @@ PLATFORMS
675680
x86_64-linux
676681

677682
DEPENDENCIES
678-
actioncable (~> 6.1.7)
679-
actionmailer (~> 6.1.7)
683+
actioncable (~> 7.0.8)
684+
actionmailer (~> 7.0.8)
680685
active_hash
681-
activerecord (~> 6.1.7)
686+
activerecord (~> 7.0.8)
682687
ansible
683688
ar_multi_threaded_transactional_tests
684689
attr_encrypted
@@ -693,6 +698,7 @@ DEPENDENCIES
693698
commonmarker
694699
concurrent-ruby
695700
connection_pool
701+
csv
696702
dalli
697703
diffy
698704
dogstatsd-ruby
@@ -715,6 +721,7 @@ DEPENDENCIES
715721
maxitest
716722
mocha
717723
momentjs-rails
724+
mutex_m
718725
mysql2
719726
net-http-persistent
720727
net-imap
@@ -751,7 +758,7 @@ DEPENDENCIES
751758
rails-assets-underscore!
752759
rails-assets-x-editable!
753760
rails-controller-testing
754-
railties (~> 6.1.7)
761+
railties (~> 7.0.8)
755762
rubocop
756763
rubocop-rails
757764
samson_airbrake!

app/controllers/dashboards_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class DashboardsController < ApplicationController
33
before_action :find_environment
44

55
def show
6-
@before = Time.parse(params[:before] || Time.now.to_s(:db))
6+
@before = Time.parse(params[:before] || Time.now.to_fs(:db))
77
@deploy_groups = @environment.deploy_groups
88
@projects = Project.all
99
@failed_deploys = (params[:failed_deploys] == "true")

app/controllers/resource_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def render_as_csv(items)
195195
csv << ['-', 'url:', request.original_url]
196196
end
197197

198-
file = "#{controller_name}_#{Time.now.to_s(:db).tr(':', '-')}.csv"
198+
file = "#{controller_name}_#{Time.now.to_fs(:db).tr(':', '-')}.csv"
199199
send_data csv, type: :csv, filename: file
200200
end
201201
end

app/models/concerns/attr_encrypted_support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def as_json(options = {})
1515
options[:except] ||= []
1616
options[:except] += [
1717
:encryption_key_sha,
18-
*self.class.encrypted_attributes.keys.flat_map do |column|
18+
*self.class.attr_encrypted_encrypted_attributes.keys.flat_map do |column|
1919
[column, :"encrypted_#{column}_iv", :"encrypted_#{column}"]
2020
end
2121
]

app/models/csv_export.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def status?(state)
2626
end
2727

2828
def download_name
29-
"deploys_#{filters_project}#{created_at.to_s(:number)}.csv"
29+
"deploys_#{filters_project}#{created_at.to_fs(:number)}.csv"
3030
end
3131

3232
def path_file

app/models/project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def repository_homepage_gitlab
249249
def deploys_by_group(before, include_failed_deploys: false)
250250
stages.each_with_object({}) do |stage, result|
251251
stage_filter = include_failed_deploys ? stage.deploys : stage.deploys.succeeded.where(release: true)
252-
deploy = stage_filter.find_by("deploys.updated_at <= ?", before.to_s(:db))
252+
deploy = stage_filter.find_by("deploys.updated_at <= ?", before.to_fs(:db))
253253
next unless deploy
254254
stage.deploy_groups.pluck(:id).each { |id| (result[id] ||= []) << deploy }
255255
end

0 commit comments

Comments
 (0)