Skip to content

Commit

Permalink
Merge pull request #4125 from envato/rails-7.0
Browse files Browse the repository at this point in the history
Bump Rails from 6.1 to 7.0
  • Loading branch information
grosser authored Jan 26, 2025
2 parents 26b3832 + 416f254 commit e5cfbc0
Show file tree
Hide file tree
Showing 32 changed files with 249 additions and 132 deletions.
1 change: 0 additions & 1 deletion .bundler-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
# - leave file with `ignore: []` if ignore list is empty
ignore:
- CVE-2024-6484 # ignore until a patch is available https://github.com/advisories/GHSA-9mvj-f7w8-pvh2
- CVE-2024-54133 # ignore until Rails is upgraded to >= 7.0
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ vendor/bundle

# rake assets:precompile results
/public/assets
/public/assets_dev

# app/models/git_repository.rb repository storage
/cached_repos/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# rake assets:precompile results
/public/assets
/public/assets_dev

# app/models/git_repository.rb repository storage
/cached_repos/
Expand Down
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ ruby File.read('.ruby-version').strip

# gems that have rails engines are are always needed
group :preload do
rails_version = '~> 6.1.7'
rails_version = '~> 7.0.8'
gem 'railties', rails_version
gem 'actioncable', rails_version
gem 'actionmailer', rails_version
gem 'activerecord', rails_version

gem 'mutex_m' # An undeclared activesupport dependency. Remove once running Rails 7.1.

gem 'csv'
gem 'dotenv'
gem 'connection_pool'
gem 'marco-polo' # TODO: https://github.com/arches/marco-polo/pull/16
Expand Down
105 changes: 56 additions & 49 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,58 +211,60 @@ GEM
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
actioncable (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
actionmailer (7.0.8.7)
actionpack (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.8.7)
actionview (= 7.0.8.7)
activesupport (= 7.0.8.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
actionview (7.0.8.7)
activesupport (= 7.0.8.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_hash (3.2.1)
activesupport (>= 5.0.0)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
activejob (7.0.8.7)
activesupport (= 7.0.8.7)
globalid (>= 0.3.6)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activesupport (6.1.7.10)
activemodel (7.0.8.7)
activesupport (= 7.0.8.7)
activerecord (7.0.8.7)
activemodel (= 7.0.8.7)
activesupport (= 7.0.8.7)
activesupport (7.0.8.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
airbrake (11.0.3)
airbrake-ruby (~> 5.1)
airbrake-ruby (5.2.1)
rbtree3 (~> 0.5)
airbrake (13.0.4)
airbrake-ruby (~> 6.0)
airbrake-ruby (6.2.2)
rbtree3 (~> 0.6)
ansible (0.2.2)
ar_multi_threaded_transactional_tests (0.5.0)
activerecord (>= 4.2.0, < 6.2.0)
ar_multi_threaded_transactional_tests (0.6.1)
activerecord (>= 6.1.0, < 7.2.0)
ast (2.4.2)
attr_encrypted (3.1.0)
attr_encrypted (4.1.1)
encryptor (~> 3.0.0)
audited (5.4.3)
activerecord (>= 5.0, < 7.2)
Expand Down Expand Up @@ -301,7 +303,7 @@ GEM
bootstrap3-datetimepicker-rails (4.17.47)
momentjs-rails (>= 2.8.1)
brakeman (5.4.1)
builder (3.2.4)
builder (3.3.0)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
Expand All @@ -310,12 +312,13 @@ GEM
concurrent-ruby
coderay (1.1.3)
commonmarker (0.23.10)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (0.4.6)
bigdecimal
rexml
crass (1.0.6)
csv (3.3.2)
dalli (3.2.7)
base64
date (3.3.4)
Expand All @@ -329,7 +332,7 @@ GEM
railties (>= 5)
dotenv (2.8.1)
encryptor (3.0.0)
erubi (1.12.0)
erubi (1.13.0)
execjs (2.9.1)
faraday (2.8.1)
base64
Expand Down Expand Up @@ -357,17 +360,17 @@ GEM
flowdock (0.7.1)
httparty (~> 0.7)
multi_json
forking_test_runner (1.13.0)
forking_test_runner (1.15.0)
parallel_tests (>= 1.3.7)
git_diff_parser (3.2.0)
gitlab (4.19.0)
httparty (~> 0.20)
terminal-table (>= 1.5.1)
globalid (1.2.1)
activesupport (>= 6.1)
goldiloader (3.2.0)
activerecord (>= 4.2, < 6.3)
activesupport (>= 4.2, < 6.3)
goldiloader (5.3.1)
activerecord (>= 6.1, < 8)
activesupport (>= 6.1, < 8)
hashie (5.0.0)
http (5.2.0)
addressable (~> 2.8)
Expand All @@ -382,7 +385,7 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
inflection (1.0.0)
interception (0.5)
Expand Down Expand Up @@ -442,6 +445,7 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
mutex_m (0.3.0)
mysql2 (0.5.6)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
Expand Down Expand Up @@ -501,7 +505,7 @@ GEM
omniauth (~> 2.0)
pagy (4.11.0)
parallel (1.26.3)
parallel_tests (2.32.0)
parallel_tests (4.7.2)
parallel
parser (3.3.6.0)
ast (~> 2.4.1)
Expand All @@ -527,7 +531,7 @@ GEM
nio4r (~> 2.0)
pyu-ruby-sasl (0.0.3.3)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-mini-profiler (3.3.0)
rack (>= 1.2.0)
rack-protection (3.2.0)
Expand All @@ -546,12 +550,13 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
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)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
railties (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.2.1)
rbtree3 (0.7.1)
Expand Down Expand Up @@ -637,7 +642,7 @@ GEM
stackprof (0.2.12)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
thor (1.3.2)
tilt (2.3.0)
timeout (0.4.1)
tzinfo (2.0.6)
Expand All @@ -657,7 +662,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.15)
zeitwerk (2.7.1)
zendesk_api (2.0.1)
faraday (> 2.0.0)
faraday-multipart
Expand All @@ -675,10 +680,10 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
actioncable (~> 6.1.7)
actionmailer (~> 6.1.7)
actioncable (~> 7.0.8)
actionmailer (~> 7.0.8)
active_hash
activerecord (~> 6.1.7)
activerecord (~> 7.0.8)
ansible
ar_multi_threaded_transactional_tests
attr_encrypted
Expand All @@ -693,6 +698,7 @@ DEPENDENCIES
commonmarker
concurrent-ruby
connection_pool
csv
dalli
diffy
dogstatsd-ruby
Expand All @@ -715,6 +721,7 @@ DEPENDENCIES
maxitest
mocha
momentjs-rails
mutex_m
mysql2
net-http-persistent
net-imap
Expand Down Expand Up @@ -751,7 +758,7 @@ DEPENDENCIES
rails-assets-underscore!
rails-assets-x-editable!
rails-controller-testing
railties (~> 6.1.7)
railties (~> 7.0.8)
rubocop
rubocop-rails
samson_airbrake!
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class DashboardsController < ApplicationController
before_action :find_environment

def show
@before = Time.parse(params[:before] || Time.now.to_s(:db))
@before = Time.parse(params[:before] || Time.now.to_fs(:db))
@deploy_groups = @environment.deploy_groups
@projects = Project.all
@failed_deploys = (params[:failed_deploys] == "true")
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/resource_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def render_as_csv(items)
csv << ['-', 'url:', request.original_url]
end

file = "#{controller_name}_#{Time.now.to_s(:db).tr(':', '-')}.csv"
file = "#{controller_name}_#{Time.now.to_fs(:db).tr(':', '-')}.csv"
send_data csv, type: :csv, filename: file
end
end
2 changes: 1 addition & 1 deletion app/models/concerns/attr_encrypted_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def as_json(options = {})
options[:except] ||= []
options[:except] += [
:encryption_key_sha,
*self.class.encrypted_attributes.keys.flat_map do |column|
*self.class.attr_encrypted_encrypted_attributes.keys.flat_map do |column|
[column, :"encrypted_#{column}_iv", :"encrypted_#{column}"]
end
]
Expand Down
2 changes: 1 addition & 1 deletion app/models/csv_export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def status?(state)
end

def download_name
"deploys_#{filters_project}#{created_at.to_s(:number)}.csv"
"deploys_#{filters_project}#{created_at.to_fs(:number)}.csv"
end

def path_file
Expand Down
2 changes: 1 addition & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def repository_homepage_gitlab
def deploys_by_group(before, include_failed_deploys: false)
stages.each_with_object({}) do |stage, result|
stage_filter = include_failed_deploys ? stage.deploys : stage.deploys.succeeded.where(release: true)
deploy = stage_filter.find_by("deploys.updated_at <= ?", before.to_s(:db))
deploy = stage_filter.find_by("deploys.updated_at <= ?", before.to_fs(:db))
next unless deploy
stage.deploy_groups.pluck(:id).each { |id| (result[id] ||= []) << deploy }
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<% if SAMSON_VERSION %>
<li>
<%= link_to SAMSON_VERSION.first(7), "https://github.com/zendesk/samson/commit/#{SAMSON_VERSION}",
title: "Currently deployed samson version since #{Rails.application.config.samson.start_time.to_s(:db)}", class: "sha" %>
title: "Currently deployed samson version since #{Rails.application.config.samson.start_time.to_fs(:db)}", class: "sha" %>
</li>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/_stage.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<% if deploy = stage.last_deploy %>
<td>
<%= link_to deploy.short_reference, [@project, deploy], title: "#{deploy.reference} at #{deploy.updated_at.to_s(:db)}" %>
<%= link_to deploy.short_reference, [@project, deploy], title: "#{deploy.reference} at #{deploy.updated_at.to_fs(:db)}" %>
by
<%= deploy.user.name %>
<%= status_badge deploy.job.status %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/secrets/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<% end %>

<%= form.input :deprecated, as: :check_box, label: "Deprecated #{secret[:deprecated_at]}" do %>
<%= form.check_box :deprecated_at, {}, secret[:deprecated_at] || Time.now.to_s(:db), "0" %>
<%= form.check_box :deprecated_at, {}, secret[:deprecated_at] || Time.now.to_fs(:db), "0" %>
<% end %>

<% needs_value = @duplicate_secret_error || !id %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_merges/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Delete selected empty user and change #<%= @user.id %> <%= @user.name_and_email
<h2>Users with the same name or email</h2>
<ul>
<% candidates.each do |user| %>
<li>ID <%= user.id %> <%= link_to user.name_and_email, user %>, last seen <%= user.last_seen_at&.to_s(:db) || "Never" %></li>
<li>ID <%= user.id %> <%= link_to user.name_and_email, user %>, last seen <%= user.last_seen_at&.to_fs(:db) || "Never" %></li>
<% end %>
</ul>
<% end %>
Expand Down
Loading

0 comments on commit e5cfbc0

Please sign in to comment.