Skip to content
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

Enable config.load_defaults in rails application.rb and determine which defaults we need to modify #23172

Open
jrafanie opened this issue Sep 3, 2024 · 1 comment · May be fixed by #23176
Open

Comments

@jrafanie
Copy link
Member

jrafanie commented Sep 3, 2024

We currently disable loading defaults for one known reason, belongs_to_required_by_default. It's hard to know or remember if there are others we need to change from the defaults. We should try to enable defaults and manually undo specific defaults we still need the old behavior.

As of right now, it's hard to tell what changes we have from the defaults. At least if we enumerate our needed changes, we can try to fix each one separately and move our application closer to the defaults.

EDIT: Note, rails documents the defaults for each version here: https://guides.rubyonrails.org/configuring.html#versioned-default-values

@Fryguy
Copy link
Member

Fryguy commented Sep 3, 2024

FWIW, when I changed the manageiq-schema dummy app to Rails 7.0, this was one of the ones I kept in place:

You can see how we load the defaults, and then change 2 settings here: https://github.com/ManageIQ/manageiq-schema/blob/688930bd09ae0c39a91edc8a6770d41234563749/spec/dummy/config/application.rb

jrafanie added a commit to jrafanie/manageiq that referenced this issue Sep 5, 2024
As far as I can see, belongs_to_required_by_default, is the only override in
load_defaults that we manually override.  See:
https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92

This change makes the override explicit.

Fixes ManageIQ#23172
@jrafanie jrafanie linked a pull request Sep 5, 2024 that will close this issue
1 task
jrafanie added a commit to jrafanie/manageiq that referenced this issue Sep 6, 2024
https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92
* belongs_to_required_by_default must be overridden or seeding fails
* Partial inserts cause test failures in ui-classic, content, and amazon provider
* Need to investigate the X-XSS-Protection change before using default of disabling it
* Allow deprecations to be found and fixed

Fixes ManageIQ#23172
jrafanie added a commit to jrafanie/manageiq that referenced this issue Sep 12, 2024
https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92
* belongs_to_required_by_default must be overridden or seeding fails
* Partial inserts cause test failures in ui-classic, content, and amazon provider
* Need to investigate the X-XSS-Protection change before using default of disabling it
* Allow deprecations to be found and fixed

Fixes ManageIQ#23172
jrafanie added a commit to jrafanie/manageiq that referenced this issue Sep 20, 2024
https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92
* belongs_to_required_by_default must be overridden or seeding fails
* Partial inserts cause test failures in ui-classic, content, and amazon provider
* Need to investigate the X-XSS-Protection change before using default of disabling it
* Allow deprecations to be found and fixed

Fixes ManageIQ#23172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants