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

[v3.2] Fix the dummy app usage of the generator #4732

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

waiting-for-dev
Copy link
Contributor

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:

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

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.
@waiting-for-dev waiting-for-dev changed the title Call the solidus generator by shelling-out for the dummy app [v3.2] Call the solidus generator by shelling-out for the dummy app Nov 22, 2022
@waiting-for-dev waiting-for-dev changed the title [v3.2] Call the solidus generator by shelling-out for the dummy app [v3.2] Fix the dummy app usage of the generator Nov 22, 2022
# within ruby is changed to that of the dummy app.
sh({
'SKIP_SOLIDUS_BOLT' => '1',
'FRONTEND' => 'solidus_frontend',
Copy link
Contributor

@gsmendoza gsmendoza Nov 22, 2022

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.

Copy link
Member

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.

Copy link
Contributor

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 !

Copy link
Member

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

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',
Copy link
Member

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.

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

@kennyadsl kennyadsl merged commit cc766d1 into solidusio:v3.2 Nov 22, 2022
@kennyadsl kennyadsl deleted the waiting-for-dev/fix_dummy branch November 22, 2022 12:13
@waiting-for-dev waiting-for-dev added the changelog:solidus_core Changes to the solidus_core gem label Dec 23, 2022
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.

5 participants