Rails 7.1 update (#25963)

This commit is contained in:
Matt Jankowski 2023-10-23 13:58:29 -04:00 committed by GitHub
parent 379115e601
commit e93a75f1a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 122 additions and 89 deletions

View file

@ -4,7 +4,7 @@ source 'https://rubygems.org'
ruby '>= 3.0.0' ruby '>= 3.0.0'
gem 'puma', '~> 6.3' gem 'puma', '~> 6.3'
gem 'rails', '~> 7.0' gem 'rails', '~> 7.1.1'
gem 'sprockets', '~> 3.7.2' gem 'sprockets', '~> 3.7.2'
gem 'thor', '~> 1.2' gem 'thor', '~> 1.2'
gem 'rack', '~> 2.2.7' gem 'rack', '~> 2.2.7'

View file

@ -39,75 +39,83 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (7.0.8) actioncable (7.1.1)
actionpack (= 7.0.8) actionpack (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailbox (7.0.8) zeitwerk (~> 2.6)
actionpack (= 7.0.8) actionmailbox (7.1.1)
activejob (= 7.0.8) actionpack (= 7.1.1)
activerecord (= 7.0.8) activejob (= 7.1.1)
activestorage (= 7.0.8) activerecord (= 7.1.1)
activesupport (= 7.0.8) activestorage (= 7.1.1)
activesupport (= 7.1.1)
mail (>= 2.7.1) mail (>= 2.7.1)
net-imap net-imap
net-pop net-pop
net-smtp net-smtp
actionmailer (7.0.8) actionmailer (7.1.1)
actionpack (= 7.0.8) actionpack (= 7.1.1)
actionview (= 7.0.8) actionview (= 7.1.1)
activejob (= 7.0.8) activejob (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
net-imap net-imap
net-pop net-pop
net-smtp net-smtp
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.2)
actionpack (7.0.8) actionpack (7.1.1)
actionview (= 7.0.8) actionview (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
rack (~> 2.0, >= 2.2.4) nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.0, >= 1.2.0) rails-html-sanitizer (~> 1.6)
actiontext (7.0.8) actiontext (7.1.1)
actionpack (= 7.0.8) actionpack (= 7.1.1)
activerecord (= 7.0.8) activerecord (= 7.1.1)
activestorage (= 7.0.8) activestorage (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (7.0.8) actionview (7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.11)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.1, >= 1.2.0) rails-html-sanitizer (~> 1.6)
active_model_serializers (0.10.14) active_model_serializers (0.10.14)
actionpack (>= 4.1) actionpack (>= 4.1)
activemodel (>= 4.1) activemodel (>= 4.1)
case_transform (>= 0.2) case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3) jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.8) activejob (7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (7.0.8) activemodel (7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
activerecord (7.0.8) activerecord (7.1.1)
activemodel (= 7.0.8) activemodel (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
activestorage (7.0.8) timeout (>= 0.4.0)
actionpack (= 7.0.8) activestorage (7.1.1)
activejob (= 7.0.8) actionpack (= 7.1.1)
activerecord (= 7.0.8) activejob (= 7.1.1)
activesupport (= 7.0.8) activerecord (= 7.1.1)
activesupport (= 7.1.1)
marcel (~> 1.0) marcel (~> 1.0)
mini_mime (>= 1.1.0) activesupport (7.1.1)
activesupport (7.0.8) base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0) tzinfo (~> 2.0)
addressable (2.8.5) addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
@ -158,6 +166,7 @@ GEM
erubi (~> 1.4) erubi (~> 1.4)
parser (>= 2.4) parser (>= 2.4)
smart_properties smart_properties
bigdecimal (3.1.4)
bindata (2.4.15) bindata (2.4.15)
binding_of_caller (1.0.0) binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
@ -237,6 +246,8 @@ GEM
dotenv-rails (2.8.1) dotenv-rails (2.8.1)
dotenv (= 2.8.1) dotenv (= 2.8.1)
railties (>= 3.2) railties (>= 3.2)
drb (2.1.1)
ruby2_keywords
ed25519 (1.3.0) ed25519 (1.3.0)
elasticsearch (7.13.3) elasticsearch (7.13.3)
elasticsearch-api (= 7.13.3) elasticsearch-api (= 7.13.3)
@ -305,8 +316,8 @@ GEM
fuubar (2.5.1) fuubar (2.5.1)
rspec-core (~> 3.0) rspec-core (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
globalid (1.1.0) globalid (1.2.1)
activesupport (>= 5.0) activesupport (>= 6.1)
haml (6.2.0) haml (6.2.0)
temple (>= 0.8.2) temple (>= 0.8.2)
thor thor
@ -357,7 +368,11 @@ GEM
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
terminal-table (>= 1.5.1) terminal-table (>= 1.5.1)
idn-ruby (0.1.5) idn-ruby (0.1.5)
io-console (0.6.0)
ipaddress (0.8.3) ipaddress (0.8.3)
irb (1.8.1)
rdoc
reline (>= 0.3.8)
jmespath (1.6.2) jmespath (1.6.2)
json (2.6.3) json (2.6.3)
json-canonicalization (0.3.2) json-canonicalization (0.3.2)
@ -434,7 +449,6 @@ GEM
azure-storage-blob (~> 2.0.1) azure-storage-blob (~> 2.0.1)
hashie (~> 5.0) hashie (~> 5.0)
memory_profiler (1.0.1) memory_profiler (1.0.1)
method_source (1.0.0)
mime-types (3.5.1) mime-types (3.5.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808) mime-types-data (3.2023.0808)
@ -444,11 +458,12 @@ GEM
msgpack (1.7.1) msgpack (1.7.1)
multi_json (1.15.0) multi_json (1.15.0)
multipart-post (2.3.0) multipart-post (2.3.0)
mutex_m (0.1.2)
net-http (0.3.2) net-http (0.3.2)
uri uri
net-http-persistent (4.0.2) net-http-persistent (4.0.2)
connection_pool (~> 2.2) connection_pool (~> 2.2)
net-imap (0.3.7) net-imap (0.4.1)
date date
net-protocol net-protocol
net-ldap (0.18.0) net-ldap (0.18.0)
@ -456,7 +471,7 @@ GEM
net-protocol net-protocol
net-protocol (0.2.1) net-protocol (0.2.1)
timeout timeout
net-smtp (0.3.3) net-smtp (0.4.0)
net-protocol net-protocol
nio4r (2.5.9) nio4r (2.5.9)
nokogiri (1.15.4) nokogiri (1.15.4)
@ -512,6 +527,8 @@ GEM
net-smtp net-smtp
premailer (~> 1.7, >= 1.7.9) premailer (~> 1.7, >= 1.7.9)
private_address_check (0.5.0) private_address_check (0.5.0)
psych (5.1.1)
stringio
public_suffix (5.0.3) public_suffix (5.0.3)
puma (6.4.0) puma (6.4.0)
nio4r (~> 2.0) nio4r (~> 2.0)
@ -534,22 +551,27 @@ GEM
rack rack
rack-proxy (0.7.6) rack-proxy (0.7.6)
rack rack
rack-session (1.0.1)
rack (< 3)
rack-test (2.1.0) rack-test (2.1.0)
rack (>= 1.3) rack (>= 1.3)
rails (7.0.8) rackup (1.0.0)
actioncable (= 7.0.8) rack (< 3)
actionmailbox (= 7.0.8) webrick
actionmailer (= 7.0.8) rails (7.1.1)
actionpack (= 7.0.8) actioncable (= 7.1.1)
actiontext (= 7.0.8) actionmailbox (= 7.1.1)
actionview (= 7.0.8) actionmailer (= 7.1.1)
activejob (= 7.0.8) actionpack (= 7.1.1)
activemodel (= 7.0.8) actiontext (= 7.1.1)
activerecord (= 7.0.8) actionview (= 7.1.1)
activestorage (= 7.0.8) activejob (= 7.1.1)
activesupport (= 7.0.8) activemodel (= 7.1.1)
activerecord (= 7.1.1)
activestorage (= 7.1.1)
activesupport (= 7.1.1)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 7.0.8) railties (= 7.1.1)
rails-controller-testing (1.0.5) rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1) actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1)
@ -564,19 +586,22 @@ GEM
rails-i18n (7.0.8) rails-i18n (7.0.8)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8) railties (>= 6.0.0, < 8)
railties (7.0.8) railties (7.1.1)
actionpack (= 7.0.8) actionpack (= 7.1.1)
activesupport (= 7.0.8) activesupport (= 7.1.1)
method_source irb
rackup (>= 1.0.0)
rake (>= 12.2) rake (>= 12.2)
thor (~> 1.0) thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.5) zeitwerk (~> 2.6)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.0.6)
rdf (3.2.11) rdf (3.2.11)
link_header (~> 0.0, >= 0.0.8) link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.6.1) rdf-normalize (0.6.1)
rdf (~> 3.2) rdf (~> 3.2)
rdoc (6.5.0)
psych (>= 4.0.0)
redcarpet (3.6.0) redcarpet (3.6.0)
redis (4.8.1) redis (4.8.1)
redis-namespace (1.11.0) redis-namespace (1.11.0)
@ -584,13 +609,15 @@ GEM
redlock (1.3.2) redlock (1.3.2)
redis (>= 3.0.0, < 6.0) redis (>= 3.0.0, < 6.0)
regexp_parser (2.8.2) regexp_parser (2.8.2)
reline (0.3.9)
io-console (~> 0.5)
request_store (1.5.1) request_store (1.5.1)
rack (>= 1.4) rack (>= 1.4)
responders (3.1.1) responders (3.1.1)
actionpack (>= 5.2) actionpack (>= 5.2)
railties (>= 5.2) railties (>= 5.2)
rexml (3.2.6) rexml (3.2.6)
rotp (6.2.2) rotp (6.3.0)
rouge (4.1.2) rouge (4.1.2)
rpam2 (4.0.2) rpam2 (4.0.2)
rqrcode (2.2.0) rqrcode (2.2.0)
@ -712,6 +739,7 @@ GEM
statsd-ruby (1.5.0) statsd-ruby (1.5.0)
stoplight (3.0.2) stoplight (3.0.2)
redlock (~> 1.0) redlock (~> 1.0)
stringio (3.0.8)
strong_migrations (0.8.0) strong_migrations (0.8.0)
activerecord (>= 5.2) activerecord (>= 5.2)
swd (1.3.0) swd (1.3.0)
@ -783,6 +811,7 @@ GEM
rack-proxy (>= 0.6.1) rack-proxy (>= 0.6.1)
railties (>= 5.2) railties (>= 5.2)
semantic_range (>= 2.3.0) semantic_range (>= 2.3.0)
webrick (1.8.1)
websocket (1.2.10) websocket (1.2.10)
websocket-driver (0.7.6) websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
@ -878,7 +907,7 @@ DEPENDENCIES
rack-attack (~> 6.6) rack-attack (~> 6.6)
rack-cors (~> 2.0) rack-cors (~> 2.0)
rack-test (~> 2.1) rack-test (~> 2.1)
rails (~> 7.0) rails (~> 7.1.1)
rails-controller-testing (~> 1.0) rails-controller-testing (~> 1.0)
rails-i18n (~> 7.0) rails-i18n (~> 7.0)
rails-settings-cached (~> 0.6)! rails-settings-cached (~> 0.6)!
@ -929,4 +958,4 @@ RUBY VERSION
ruby 3.2.2p53 ruby 3.2.2p53
BUNDLED WITH BUNDLED WITH
2.4.13 2.4.20

View file

@ -2,7 +2,7 @@ import './public-path';
import React from 'react'; import React from 'react';
import { createRoot } from 'react-dom/client'; import { createRoot } from 'react-dom/client';
import { delegate } from '@rails/ujs'; import delegate from '@rails/ujs';
import ready from '../mastodon/ready'; import ready from '../mastodon/ready';

View file

@ -5,7 +5,7 @@ import './public-path';
import { IntlMessageFormat } from 'intl-messageformat'; import { IntlMessageFormat } from 'intl-messageformat';
import { defineMessages } from 'react-intl'; import { defineMessages } from 'react-intl';
import { delegate } from '@rails/ujs'; import delegate from '@rails/ujs';
import axios from 'axios'; import axios from 'axios';
import { throttle } from 'lodash'; import { throttle } from 'lodash';

View file

@ -2,7 +2,7 @@
class CacheBuster class CacheBuster
def initialize(options = {}) def initialize(options = {})
ActiveSupport::Deprecation.warn('Default values for the cache buster secret header name and values will be removed in Mastodon 4.3. Please set them explicitely if you rely on those.') unless options[:http_method] || (options[:secret] && options[:secret_header]) Rails.application.deprecators[:mastodon].warn('Default values for the cache buster secret header name and values will be removed in Mastodon 4.3. Please set them explicitely if you rely on those.') unless options[:http_method] || (options[:secret] && options[:secret_header])
@secret_header = options[:secret_header] || @secret_header = options[:secret_header] ||
(options[:http_method] ? nil : 'Secret-Header') (options[:http_method] ? nil : 'Secret-Header')

View file

@ -4,7 +4,7 @@ module HasUserSettings
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
serialize :settings, UserSettingsSerializer serialize :settings, coder: UserSettingsSerializer
end end
def settings_attributes=(attributes) def settings_attributes=(attributes)

View file

@ -15,7 +15,7 @@ module StatusSafeReblogInsert
# #
# The code is kept similar to ActiveRecord::Persistence code and calls it # The code is kept similar to ActiveRecord::Persistence code and calls it
# directly when we are not handling a reblog. # directly when we are not handling a reblog.
def _insert_record(values) def _insert_record(values, returning)
return super unless values.is_a?(Hash) && values['reblog_of_id']&.value.present? return super unless values.is_a?(Hash) && values['reblog_of_id']&.value.present?
primary_key = self.primary_key primary_key = self.primary_key
@ -34,7 +34,7 @@ module StatusSafeReblogInsert
# Instead, we use a custom builder when a reblog is happening: # Instead, we use a custom builder when a reblog is happening:
im = _compile_reblog_insert(values) im = _compile_reblog_insert(values)
connection.insert(im, "#{self} Create", primary_key || false, primary_key_value).tap do |result| connection.insert(im, "#{self} Create", primary_key || false, primary_key_value, returning: returning).tap do |result|
# Since we are using SELECT instead of VALUES, a non-error `nil` return is possible. # Since we are using SELECT instead of VALUES, a non-error `nil` return is possible.
# For our purposes, it's equivalent to a foreign key constraint violation # For our purposes, it's equivalent to a foreign key constraint violation
raise ActiveRecord::InvalidForeignKey, "(reblog_of_id)=(#{values['reblog_of_id'].value}) is not present in table \"statuses\"" if result.nil? raise ActiveRecord::InvalidForeignKey, "(reblog_of_id)=(#{values['reblog_of_id'].value}) is not present in table \"statuses\"" if result.nil?

View file

@ -196,7 +196,7 @@ module Mastodon
config.active_job.queue_adapter = :sidekiq config.active_job.queue_adapter = :sidekiq
config.action_mailer.deliver_later_queue_name = 'mailers' config.action_mailer.deliver_later_queue_name = 'mailers'
config.action_mailer.preview_path = Rails.root.join('spec', 'mailers', 'previews') config.action_mailer.preview_paths << Rails.root.join('spec', 'mailers', 'previews')
# We use our own middleware for this # We use our own middleware for this
config.public_file_server.enabled = false config.public_file_server.enabled = false
@ -205,6 +205,10 @@ module Mastodon
config.middleware.use Rack::Attack config.middleware.use Rack::Attack
config.middleware.use Mastodon::RackMiddleware config.middleware.use Mastodon::RackMiddleware
initializer :deprecator do |app|
app.deprecators[:mastodon] = ActiveSupport::Deprecation.new('4.3', 'mastodon/mastodon')
end
config.to_prepare do config.to_prepare do
Doorkeeper::AuthorizationsController.layout 'modal' Doorkeeper::AuthorizationsController.layout 'modal'
Doorkeeper::AuthorizedApplicationsController.layout 'admin' Doorkeeper::AuthorizedApplicationsController.layout 'admin'

View file

@ -13,7 +13,7 @@ module ActiveRecord
column_names.unshift(primary_key) column_names.unshift(primary_key)
relation = relation.reorder(batch_order(order)).limit(batch_limit) relation = relation.reorder(build_batch_orders(order).to_h).limit(batch_limit)
relation.skip_query_cache! relation.skip_query_cache!
batch_relation = relation batch_relation = relation

View file

@ -45,7 +45,7 @@
"@gamestdio/websocket": "^0.3.2", "@gamestdio/websocket": "^0.3.2",
"@github/webauthn-json": "^2.1.1", "@github/webauthn-json": "^2.1.1",
"@material-design-icons/svg": "^0.14.10", "@material-design-icons/svg": "^0.14.10",
"@rails/ujs": "^7.0.6", "@rails/ujs": "^7.1.1",
"@reduxjs/toolkit": "^1.9.5", "@reduxjs/toolkit": "^1.9.5",
"@renchap/compression-webpack-plugin": "^6.1.4", "@renchap/compression-webpack-plugin": "^6.1.4",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",

View file

@ -1,13 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper' require 'rails_helper'
require 'rails/generators/testing/behaviour' require 'rails/generators/testing/behavior'
require 'rails/generators/testing/assertions' require 'rails/generators/testing/assertions'
require 'generators/post_deployment_migration/post_deployment_migration_generator' require 'generators/post_deployment_migration/post_deployment_migration_generator'
describe PostDeploymentMigrationGenerator, type: :generator do describe PostDeploymentMigrationGenerator, type: :generator do
include Rails::Generators::Testing::Behaviour include Rails::Generators::Testing::Behavior
include Rails::Generators::Testing::Assertions include Rails::Generators::Testing::Assertions
include FileUtils include FileUtils

View file

@ -31,7 +31,7 @@ describe CacheBuster do
around do |example| around do |example|
# Disables the CacheBuster.new deprecation warning about default arguments. # Disables the CacheBuster.new deprecation warning about default arguments.
# Remove this `silence` block when default arg support is removed from CacheBuster # Remove this `silence` block when default arg support is removed from CacheBuster
ActiveSupport::Deprecation.silence do Rails.application.deprecators[:mastodon].silence do
example.run example.run
end end
end end

View file

@ -1839,10 +1839,10 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
"@rails/ujs@^7.0.6": "@rails/ujs@^7.1.1":
version "7.0.8" version "7.1.1"
resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.0.8.tgz#59853367d0827b3955d2c4bedfd5eba4a79d3422" resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.1.1.tgz#f8df96e406a2a824084b637880e57c257073cb05"
integrity sha512-tOQQBVH8LsUpGXqDnk+kaOGVsgZ8maHAhEiw3Git3p88q+c0Slgu47HuDnL6sVxeCfz24zbq7dOjsVYDiTpDIA== integrity sha512-ywGwWNiqXN3Bb1BifVQTrkWEWcAGLHW3D0JNQMQeu57LsoluRzvnenNLPsmdoDPkrmSIASDXNsJiCIpUzFj8CA==
"@reduxjs/toolkit@^1.9.5": "@reduxjs/toolkit@^1.9.5":
version "1.9.7" version "1.9.7"