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

Deprecate Paperclip Adapter #5100

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented May 29, 2023

Summary

Closes #5033

Add solidus:paperclip_adapter:install generator, which allows incorporating the paperclip adapter into the host application, in order to remove support for it from the core.

This generator does two things:

  1. Copy the Image and Taxon Paperclip adapters into the host application;
  2. Set the right configurations in the spree.rb (path configurable) initializer in order to use the newly created files.

This PR also deprecates the Paperclip adapters, so that we can remove it in the next major version.

TODOs

  • install gem on the host app's Gemfile because we will remove it from dependencies.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label May 29, 2023
@kennyadsl kennyadsl self-assigned this May 29, 2023
@kennyadsl kennyadsl requested a review from a team as a code owner May 29, 2023 10:40
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label May 29, 2023
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.

I think we need to change CI for the paperclip adapter so the generator is run, right? 🤔


class_option :app_name,
type: :string,
default: 'MyStore',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can automate that with Rails.application.class.module_parent.name

Copy link
Member Author

Choose a reason for hiding this comment

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

It was on my metal TODO list, and of course, I forgot about it. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

metal TODO list

🤘

Copy link
Member Author

Choose a reason for hiding this comment

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

lol 🤘

@kennyadsl
Copy link
Member Author

I think we need to change CI for the paperclip adapter so the generator is run, right? 🤔

At the moment, the paperclip CI jobs should use the old adapter, which I don't think it's working because tests are failing and I don't understand why. Your proposed approach seems interesting, this way we'll stop using the deprecated adapter and just rely on the generated files. I'll give it a try.

@kennyadsl kennyadsl force-pushed the kennyadsl/paperclip-adapter-deprecation branch 2 times, most recently from a27f81a to 995172c Compare May 30, 2023 14:34
@kennyadsl kennyadsl marked this pull request as draft May 30, 2023 15:29
@kennyadsl kennyadsl force-pushed the kennyadsl/paperclip-adapter-deprecation branch 2 times, most recently from 3f18496 to 87bc6c3 Compare June 1, 2023 15:28
kennyadsl added 4 commits June 5, 2023 11:28
This generator allows incorporating the paperclip adapter into
the host application, in order to remove support for it from core.

This generator does two things:

1. Copy the Image and Taxon Paperclip adapters into the host
   application;
2. Set the right configurations in the spree.rb (path configurable)
   initializer in order to use the newly created files.
We are also providing a message with instructions for who wants
to keep using Paperclip.

We are silencing deprecation warnings when setting the deprecated
configuration in the CI. This will allow us to keep testing if our
code still works with the deprecated adapter.
When `--active_storage=false` is used in for the main installer
we can use the new generator to copy the adapter in the host
application.
Only when we are testing against Paperclip in the build matrix.
@kennyadsl kennyadsl force-pushed the kennyadsl/paperclip-adapter-deprecation branch from 87bc6c3 to 7442e93 Compare June 5, 2023 09:28
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:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider removing Paperclip adapter
2 participants