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

Set load_defaults to current Rails version in bug_report_templates #49631

Merged

Conversation

zzak
Copy link
Member

@zzak zzak commented Oct 14, 2023

Currently only Action Mailbox and Active Storage use initialized apps, so at least in those cases we can ensure the correct defaults are used by bug reporters.

@rails-bot rails-bot bot added the docs label Oct 14, 2023
@ghiculescu
Copy link
Member

Another question is why not use load_defaults to the latest version in the bug_report_templates?

I think this would simpler and would make the templates better reflect a real app.

Copy link
Member

@jonathanhefner jonathanhefner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another question is why not use load_defaults to the latest version in the bug_report_templates?

I think this would simpler and would make the templates better reflect a real app.

Agreed. However, instead of specifying 7.1, let's use config.load_defaults Rails::VERSION::STRING.to_f, as we do when generating dummy apps. That way we don't have to update the version in the future, and the guides/bug_report_templates/*_main.rb files will pick up the 7.2 defaults.

guides/bug_report_templates/action_mailbox_gem.rb Outdated Show resolved Hide resolved
Currently only Action Mailbox and Active Storage use initialized apps, so at least in those cases we can ensure the correct defaults are used by bug reporters.
@zzak zzak force-pushed the bug_report_templates/cache_format_version branch from bea032e to f522f99 Compare October 31, 2023 08:57
@zzak zzak changed the title Add cache_format_version 7.0 to bug_report_templates Set load_defaults to current Rails version in bug_report_templates Oct 31, 2023
@zzak
Copy link
Member Author

zzak commented Oct 31, 2023

Let's use load_defaults then, but actually this doesn't get rid of the cache_format_version message because the default is still set to 6.1 -- but that deprecation will be removed from main soon enough.

Still, I think part of my intention here was to reduce noise from the bug report templates which might lead contributors astray.

@jonathanhefner jonathanhefner merged commit 2947e5b into rails:main Oct 31, 2023
4 checks passed
@jonathanhefner
Copy link
Member

Thank you, @zzak! 👍

Let's use load_defaults then, but actually this doesn't get rid of the cache_format_version message because the default is still set to 6.1 -- but that deprecation will be removed from main soon enough.

I don't follow. config.active_support.cache_format_version is set to 7.1 when using config.load_defaults 7.1:

active_support.cache_format_version = 7.1

I ran both active_storage_gem.rb and active_storage_main.rb without this change and saw the deprecation warning. I then ran them with this change and no longer see the deprecation warning. Am I missing something?

@zzak zzak deleted the bug_report_templates/cache_format_version branch November 3, 2023 02:02
@zzak
Copy link
Member Author

zzak commented Nov 3, 2023

Sorry, I was confused. You're correct using load_defaults will fix this.

Otherwise the default value is still set to 6.1:
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/cache.rb#L55

This comes up a bit, so it's easy to forget the two. (#49543, #49892)

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

Successfully merging this pull request may close these issues.

None yet

3 participants