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

Add Active Storage in Dummy App for extensions #3969

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Mar 2, 2021

Description

This PR makes sure Active Storage is properly configured when we are generating dummy apps for extensions. This is done in the extension root with:

bin/rake extension:test_app

Ref #3967

I tested this PR with solidus_starter_frontend that uses Active Storage in some system specs. See solidusio/solidus_starter_frontend#145

No need to backport this one, it will only affect extensions testing against Solidus 3.0, which will default to using Active Storage.

Needs #3970 to be merged first.

@kennyadsl kennyadsl added type:bug Error, flaw or fault changelog:solidus_core Changes to the solidus_core gem labels Mar 2, 2021
@kennyadsl kennyadsl added this to the 3.0.0 milestone Mar 2, 2021
@kennyadsl kennyadsl self-assigned this Mar 2, 2021
@kennyadsl kennyadsl force-pushed the kennyadsl/add-activestorage-dummy-extensions branch from bdb8ae9 to 3a2d11c Compare March 2, 2021 10:37
@kennyadsl kennyadsl changed the title Add Active Storage in dummy application for extensions Add Active Storage in Dummy App for extensions Mar 2, 2021
@kennyadsl kennyadsl force-pushed the kennyadsl/add-activestorage-dummy-extensions branch from 3a2d11c to 0541c65 Compare March 2, 2021 13:47
Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

This is important because extensions that are testing against Solidus
3.0 does not have the default adapter set to Active Storage; extensions'
dummy app is not executing the solidus:install command and won't have
the intializer copied over to configure the app.
Copying the .yml configuration file into config/storage/test.yml
will automatically configure Active Storage in that env [1].

The configuration key needs to be the same of the service
set into config/environments/test.rb.

When testing extensions against old versions of Solidus, it
will not use Active Storage so, it should not be harmful to
have it configured anyway.

[1]: https://github.com/rails/rails/blob/66b861f24cd8ca34b726f77b46f6b25b21f0b972/activestorage/lib/active_storage/engine.rb#L115-L132
@kennyadsl kennyadsl force-pushed the kennyadsl/add-activestorage-dummy-extensions branch from 0541c65 to db7ff8d Compare March 8, 2021 11:41
@kennyadsl kennyadsl merged commit 26d6596 into solidusio:master Mar 8, 2021
@kennyadsl kennyadsl deleted the kennyadsl/add-activestorage-dummy-extensions branch March 8, 2021 14:38
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 type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants