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

Installer UI improvements #4675

Merged
merged 12 commits into from
Oct 17, 2022

Conversation

elia
Copy link
Member

@elia elia commented Oct 14, 2022

Summary

  • A few installer cleanups and removals of legacy options
  • Created some helpers for handling interactive options
  • Shortened the names of options to be provided to flags (e.g. solidus_starter_frontendstarter)
  • Improved the layout of interactive questions (see screenshots)

Screen Shot 2022-10-04 at 12 44 36

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • I have updated the readme to account for my changes.

@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Oct 14, 2022
elia added 12 commits October 14, 2022 16:17
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.
@elia elia force-pushed the elia/installer-ui-improvements branch from bc54f59 to f52a746 Compare October 14, 2022 14:17
@elia elia marked this pull request as ready for review October 14, 2022 15:08
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a 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 🙂

sample/db/samples/assets.rb Show resolved Hide resolved

# 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 \
Copy link
Contributor

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?

Copy link
Member Author

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.

Comment on lines -14 to -15
LEGACY_FRONTEND = 'solidus_frontend'
DEFAULT_FRONTEND = 'solidus_starter_frontend'
Copy link
Contributor

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).

Copy link
Member Author

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.).

Copy link
Contributor

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 🙂

Copy link
Member Author

@elia elia left a 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 🙏

Comment on lines -14 to -15
LEGACY_FRONTEND = 'solidus_frontend'
DEFAULT_FRONTEND = 'solidus_starter_frontend'
Copy link
Member Author

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 \
Copy link
Member Author

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.

@elia elia requested a review from waiting-for-dev October 17, 2022 11:14
Copy link
Member

@kennyadsl kennyadsl left a 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!

@kennyadsl kennyadsl merged commit bb53603 into solidusio:master Oct 17, 2022
@kennyadsl kennyadsl deleted the elia/installer-ui-improvements branch October 17, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants