-
-
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
Fix the install generator #3777
Conversation
Currently, it's impossible to run extension installers Ideally, with the overall Solidus installer, the user would be able to just run it and have a working solidus store, while installing the default extensions. Currently that's not possible. The two solutions I can think of are:
Here's an example of an extension installer - https://github.com/solidusio/solidus_auth_devise/blob/8b65779f02a4fe46d81bbf0c78347b39f8f93205/lib/generators/solidus/auth/install/install_generator.rb#L23 If you pass in However that requires making changes to a lot of extensions, and to solidus_dev_support, which is a lot of work. We'd also have to create new releases for some of these extensions after doing that. (though solidus_auth_devise needs a new release anyways). What do you think? @kennyadsl @elia |
What if you run:
instead of:
Will the message be prompted anyway? |
Also, I think the generate syntax is wrong. Should be something like:
|
Unfortunately the migration question gets asked regardless of syntax - I tried both ways. Thanks for pointing out the generate syntax! The problem is this line: run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) if you set auto_run_migrations to false, then the question will always be asked. |
Maybe it's not that big of a deal though, since there are several other prompts during installation. It is a bit weird to ask to migrate 3 times during the initial installation, but probably easier to keep it that way than change every extension that uses that line. :P |
@seand7565 I think it's worth fixing it, not for the seasoned Solidus dev, but for everyone trying to install it for the first time, who I suspect would be rather confused by that. I also hope to come back to #3743 and finish it to further improve the usability of the installer. |
@seand7565 got it. If we don't want to auto-run migrations the message will be prompted. I'd start modifying these two extensions for now, adding another parameter that force not asking and not migrating. Maybe we can move this shared logic into a |
Yeah, let's do that! I have a PR on SPCP that handles this change, take a look if you get a chance. If it looks good, I'll also port it into solidus_devise - at which point this PR should be mergeable (though we'll need a re-release of both SPCP and solidus_devise) solidusio/solidus_paypal_commerce_platform#94 Then we can add it into solidus_dev_support so any new extensions are built with this change. I opted for a |
Here's the change in solidus_auth_devise: solidusio/solidus_auth_devise#194 |
2952f54
to
6f6bd2e
Compare
The devise PR needs to be merged, then a new release cut. But other than that, this PR is good to go, so I'll un-draft it. Once a new release is cut for both extensions, this should fix the installers issues. |
@seand7565 I just released |
@kennyadsl It's been released! 🎉 This PR should be good to go. I'll give it a quick rebase first though. |
ref solidusio#3775 Fixes the issues with the install generator by bundling after adding the extensions to the gemfile, stopping spring, and then running the install generators for each of the installed extensions. Currently this works a bit wonky as the extensions will ask if you want to run migrations, and that's not desirable as migrations are already run after these extensions are installed. Will fix and update shortly, just wanted to get this into a PR!
6f6bd2e
to
165321d
Compare
ref #3775
Fixes the issues with the install generator by bundling after adding the
extensions to the gemfile, stopping spring, and then running the install
generators for each of the installed extensions.
Currently this works a bit wonky as the extensions will ask if you want
to run migrations, and that's not desirable as migrations are already run
after these extensions are installed. Will fix and update shortly, just
wanted to get this into a PR!
Checklist: