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

Fix: Ensure that SSF 3.2 doesn't add solidus_auth_devise to the gemfile twice #4766

Closed
chrean opened this issue Dec 5, 2022 · 1 comment
Closed
Assignees
Labels
type:bug Error, flaw or fault

Comments

@chrean
Copy link
Contributor

chrean commented Dec 5, 2022

Goal

Given I have a Rails app

When I add Solidus 3.2.4 to the Gemfile

And I install the default installation of Solidus

Then I should see only one solidus_auth_devise line in the Gemfile.

Current behavior

The Gemfile has two line for solidus_auth_devise :

# FIXME: Please remove this line if `solidus_auth_devise` appears anywhere else in the gemfile
#        or replace it with a simple `gem 'solidus_auth_devise'` otherwise.
gem 'solidus_auth_devise' unless File.read(__FILE__).lines[__LINE__..-1].grep(/solidus_auth_devise/).any?

gem "solidus_auth_devise"

Cause

This is a known workaround. From solidusio/solidus_starter_frontend@b9e8a7f:

Adding solidus_auth_devise to the Gemfile was conflicting with it
being added by the solidus installer again unless
`--with-authentication=false` was provided. But the auth extension
is also required by SSF. This forced a workaround in which we skip
the `gem` entry in the Gemfile if another entry for the same gem is
present in any of the following lines. It's ugly but puts a bandaid
that will at least allow the installation to succeed.

Possible solutions

  • Revert 3b7ec0a. Leave SSF v3.2 without the responsibility to install solidus_auth_devise so we can remove the check on the Gemfile.

  • Alternatively, update the installer on v3.2 to try to install solidus_auth_devise after the frontend.

    • Done on master.
  • Check if auth devise is already installed.

    • Done on master.

Once fixed, we can update the template as follows:

gem 'solidus_auth_devise' unless Bundler.locked_gems.dependencies['solidus_auth_devise']
bundle_command["install"]
generate 'solidus:auth:install'
@elia
Copy link
Member

elia commented Dec 13, 2022

Fixed by #4748

@elia elia closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

3 participants