-
Notifications
You must be signed in to change notification settings - Fork 166
Upgrade to Rails 6.1 to prepare to replace secure_headers gem (LG-3832) #4544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env ruby | ||
| require 'pathname' | ||
|
|
||
| APP_ROOT = File.expand_path('..', __dir__) | ||
| Dir.chdir(APP_ROOT) do | ||
| executable_path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |path| | ||
| normalized_path = File.expand_path(path) | ||
|
|
||
| normalized_path != __dir__ && File.executable?(Pathname.new(normalized_path).join('yarn')) | ||
| end | ||
|
|
||
| if executable_path | ||
| exec File.expand_path(Pathname.new(executable_path).join('yarn')), *ARGV | ||
| else | ||
| $stderr.puts "Yarn executable was not detected in the system." | ||
| $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" | ||
| exit 1 | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| require_relative 'boot' | ||
| require 'rails/all' | ||
|
|
||
| require 'active_record/railtie' | ||
| require 'action_controller/railtie' | ||
| require 'action_view/railtie' | ||
| require 'action_mailer/railtie' | ||
| require 'rails/test_unit/railtie' | ||
| require 'sprockets/railtie' | ||
|
|
||
| require_relative '../lib/upaya_log_formatter' | ||
| require_relative '../lib/app_config' | ||
| require_relative '../lib/fingerprinter' | ||
|
|
@@ -12,17 +19,19 @@ module Upaya | |
| class Application < Rails::Application | ||
| AppConfig.setup(YAML.safe_load(File.read(Rails.root.join('config', 'application.yml')))) | ||
|
|
||
| config.load_defaults '6.0' | ||
| config.load_defaults '6.1' | ||
| config.active_record.belongs_to_required_by_default = false | ||
| config.assets.unknown_asset_fallback = true | ||
|
|
||
| # We can enable this once we know we're not rolling back from Rails 6 | ||
| # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#purpose-in-signed-or-encrypted-cookie-is-now-embedded-within-cookies | ||
| config.action_dispatch.use_cookies_with_metadata = false | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've had a couple releases on Rails 6, so it's probably safe to assume we aren't rolling back to 5.2 |
||
|
|
||
| config.active_job.queue_adapter = 'inline' | ||
| config.time_zone = 'UTC' | ||
|
|
||
| # Generate CSRF tokens that are encoded in URL-safe Base64. | ||
| # | ||
| # This change is not backwards compatible with earlier Rails versions. | ||
| # It's best enabled when your entire app is migrated and stable on 6.1. | ||
| Rails.application.config.action_controller.urlsafe_csrf_tokens = false | ||
|
|
||
| config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{yml}')] | ||
| config.i18n.available_locales = AppConfig.env.available_locales.try(:split, ' ') || %w[en] | ||
| config.i18n.default_locale = :en | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was getting errors related to active storage not being configured when it was required by
rails/all. We don't use it (or some of the other things like action cable), so I've only included the ones we use: https://guides.rubyonrails.org/initialization.html#railties-lib-rails-all-rbThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big fan of explicit requires like this!