Upgrade to Rails 7.1

We're disabling `action_controller.raise_on_missing_callback_actions`
because sometimes we include `before_action :something, only: actions`
in concerns, and we include these concerns in controllers that don't
have all these actions.

Note that Rails 7.1 logs to STDOUT by default [1]; we're re-adding the
condition `if ENV["RAILS_LOG_TO_STDOUT"].present?` because we're still
using files and we're rotating the logs to avoid running out of space.

Also note that the GraphQL controller test (which is actually a request
test, since it's got `type: :request`) that was raising an exception no
longer does it thanks to the new default value for the
`config.action_dispatch.show_exceptions` configuration option. So we're
updating the test accordingly. This option doesn't affect regular
controller tests (without the `type: :request` option), so in other
tests we're still checking exceptions.

[1] Pull request 47138 in https://github.com/rails/rails
This commit is contained in:
Javi Martín
2024-04-14 20:45:01 +02:00
parent 3eaa40892d
commit 0b1cfcd5da
13 changed files with 460 additions and 123 deletions

View File

@@ -90,8 +90,13 @@ describe GraphqlController, type: :request do
before { Setting["feature.graphql_api"] = false }
it "is disabled" do
expect { get "/graphql" }.to raise_exception(FeatureFlags::FeatureDisabled)
expect { post "/graphql" }.to raise_exception(FeatureFlags::FeatureDisabled)
get "/graphql", params: { query: query_string }
expect(response).to have_http_status(:forbidden)
post "/graphql", params: { query: query_string }
expect(response).to have_http_status(:forbidden)
end
end
end