-
-
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
[v3.2] Fix the dummy app usage of the generator #4732
Conversation
We already shell-out for setting the environment and running migrations, this way we can avoid requiring the generator and we run it in a standard app environment instead of from within a library. Before this change it was failing to set Rails.root as the app_path for the generator.
# within ruby is changed to that of the dummy app. | ||
sh({ | ||
'SKIP_SOLIDUS_BOLT' => '1', | ||
'FRONTEND' => 'solidus_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.
The master version sets FRONTEND
to ENV['FRONTEND']
if that is available. Shouldn't we do that here also? The SSF 3.2 patch accepts the FRONTEND
environment variable.
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.
Good point! Although it's probably kinda optional as we confirmed that is not actually feasible to build this kind of dummy app with SSF (it breaks due to modifications to the Gemfile and other changes).
So we might even revert that change on master (maybe eventually deprecate the whole spec/dummy approach or externalize it.
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.
Okay. Thanks for the explanation @elia !
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.
Feels a bit like self-approving but it's a 👍 anyways 😅
# within ruby is changed to that of the dummy app. | ||
sh({ | ||
'SKIP_SOLIDUS_BOLT' => '1', | ||
'FRONTEND' => 'solidus_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.
Good point! Although it's probably kinda optional as we confirmed that is not actually feasible to build this kind of dummy app with SSF (it breaks due to modifications to the Gemfile and other changes).
So we might even revert that change on master (maybe eventually deprecate the whole spec/dummy approach or externalize it.
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
Summary
Backports part of #4646
We already shell-out for setting the environment and running migrations, this way we can avoid requiring the generator and we run it in a standard app environment instead of from within a library.
Before this change it was failing to set Rails.root as the app_path for the generator.
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):[ ] 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.