-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Installer UI improvements #4675
Installer UI improvements #4675
Conversation
This change allows to run samples within the app without breaking anything.
This is an ancient workaround that we no longer need to keep around. From https://github.com/rails/rails/blob/7-0-stable/guides/source/upgrading_ruby_on_rails.md?plain=1#L1876-L1878 Rails 4.1 now defaults the I18n option `enforce_available_locales` to `true`. This means that it will make sure that all locales passed to it must be declared in the `available_locales` list.
It didn't have an effect on anything for a long time now, was introduced in 3248380 when some assets were generated for extensions.
These paths are tightly coupled with routes defined in frontend extensions and we shouldn't assume anything about them in here.
There was a lingering single quote at the end of the string.
- Clearly describe available options - Align questions and answers - Give clear feedback when using defaults or for errors - Fix deprecation on --with-authentication (`options` can't be updated) - Ask for interactive choices upfront, having all the selected values at hand is helpful for checks
We already have :frontend and, :authentication, but we're also about to bring back :payment_method, and possibly others.
Not doing this results in stale Gemfile.lock information being provided by `Bundler.locked_gems`.
Makes it easier to understand and explain what they mean, in addition to being easier to type out.
bc54f59
to
f52a746
Compare
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.
Thanks, Elia! I left some non-blocking comments. I haven't tested it, though, but I'm sure you have 🙂
|
||
# Silence verbose output (e.g. Rails migrations will rely on this environment variable) | ||
ENV['VERBOSE'] = 'false' | ||
|
||
# No reason to check for their presence if we're about to install them | ||
ENV['SOLIDUS_SKIP_MIGRATIONS_CHECK'] = 'true' | ||
|
||
if options[:with_authentication] != nil | ||
warn \ |
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.
If we're removing the warning, can't we remove the option altogether now?
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.
The warning is still there, just moved it to detect_authentication_to_install
.
LEGACY_FRONTEND = 'solidus_frontend' | ||
DEFAULT_FRONTEND = 'solidus_starter_frontend' |
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.
Up to you, but do you think it is ok to remove the constants (same for DEFAULT_AUTHENTICATION
below)? It helps to check for string values that can be repeated multiple times (e.g., avoiding a typo that would create a mysterious bug).
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.
That's a good point, I'll try with a local variable first and fall back to a constant if that doesn't work
Context:
Those were removed because the role was a bit confusing, and with checks on the gemfile the default is actually dynamic (e.g. if you have the legacy one in the gemfile and auto_accept
it will "default" to it, etc.).
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.
Cool. That's non-blocking, though 🙂
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.
@waiting-for-dev added answers to all your comments, even if optional I'd like to have your take in an additional review if you have time 🙏
LEGACY_FRONTEND = 'solidus_frontend' | ||
DEFAULT_FRONTEND = 'solidus_starter_frontend' |
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.
That's a good point, I'll try with a local variable first and fall back to a constant if that doesn't work
Context:
Those were removed because the role was a bit confusing, and with checks on the gemfile the default is actually dynamic (e.g. if you have the legacy one in the gemfile and auto_accept
it will "default" to it, etc.).
|
||
# Silence verbose output (e.g. Rails migrations will rely on this environment variable) | ||
ENV['VERBOSE'] = 'false' | ||
|
||
# No reason to check for their presence if we're about to install them | ||
ENV['SOLIDUS_SKIP_MIGRATIONS_CHECK'] = 'true' | ||
|
||
if options[:with_authentication] != nil | ||
warn \ |
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.
The warning is still there, just moved it to detect_authentication_to_install
.
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.
Thanks Eli, the installer looks way better now!
Summary
solidus_starter_frontend
→starter
)Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed (
cross them outif they are not):