Skip to content

Add Solidus 4 support#39

Merged
adammathys merged 9 commits into
solidusio-contrib:mainfrom
kjriga:solidus-4-support
Nov 5, 2025
Merged

Add Solidus 4 support#39
adammathys merged 9 commits into
solidusio-contrib:mainfrom
kjriga:solidus-4-support

Conversation

@kjriga
Copy link
Copy Markdown

@kjriga kjriga commented Sep 2, 2025

This adds Solidus 4 support while maintaining backwards compatibility.

  • Updating the solidus core dependency
  • Fixing email subscriber for Solidus 4s refactored mailer system (ensuring compatibility with non-solidus-4)

Specs are passing locally.

All examples were filtered out; ignoring {focus: true}

Randomized with seed 26676
Finished in 1.61 seconds (files took 2.3 seconds to load)
99 examples, 0 failures

Randomized with seed 26676

Coverage report generated for RSpec to /Users/kendrariga/Documents/work-projects/solidus_tracking/coverage.
Line Coverage: 87.58% (402 / 459)

@kjriga kjriga force-pushed the solidus-4-support branch 17 times, most recently from 1057d24 to 62461dd Compare September 5, 2025 18:15
@kjriga
Copy link
Copy Markdown
Author

kjriga commented Sep 5, 2025

Aware I still have a failure here spec/models/spree/order_spec.rb:81 but any initial feedback would be nice. Thanks

@kjriga kjriga marked this pull request as ready for review September 5, 2025 18:15
@kjriga kjriga marked this pull request as draft September 5, 2025 18:15
Comment thread spec/models/spree/user_spec.rb Outdated
@kjriga kjriga force-pushed the solidus-4-support branch 3 times, most recently from 147be7e to ecfc13a Compare September 19, 2025 19:17
@kjriga kjriga force-pushed the solidus-4-support branch 5 times, most recently from 4787dab to b833477 Compare September 23, 2025 18:40
@kjriga kjriga force-pushed the solidus-4-support branch 3 times, most recently from 046fd7c to 45f59d6 Compare October 10, 2025 17:49
@kjriga kjriga marked this pull request as ready for review October 10, 2025 17:49
@kjriga kjriga force-pushed the solidus-4-support branch from 45f59d6 to 3213c0f Compare October 10, 2025 17:51
@kjriga kjriga requested a review from forkata October 10, 2025 17:51
@kjriga kjriga force-pushed the solidus-4-support branch from 3213c0f to 55f994a Compare October 10, 2025 17:54
Comment thread solidus_tracking.gemspec
spec.require_paths = ["lib"]

spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 4']
spec.add_dependency 'solidus_core', ['>= 4.0.0', '< 4.6']
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you add something in this commit about why we don't support 4.6/main?

Comment thread Gemfile Outdated
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

gem 'state_machines', '0.6.0'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you reference the issue so we have some more context on what this is fixing?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI this is the issue I mean solidusio/solidus#6326

@AlistairNorman
Copy link
Copy Markdown

A little more context needed in a couple places but this looks good as long as tests are passing locally.

@kjriga kjriga force-pushed the solidus-4-support branch from 55f994a to 24aa010 Compare October 15, 2025 14:25
@kjriga kjriga requested a review from jarednorman October 15, 2025 14:26
@kjriga
Copy link
Copy Markdown
Author

kjriga commented Oct 15, 2025

I am happy to pull out the final commit for moving Ci -> github actions and PR it separately if it is preferred. @jarednorman I think I'll need you to update the repo to work with github actions. I took the test workflow from here but I won't know if it's working until the repo attempts to run it.

@jarednorman
Copy link
Copy Markdown
Member

@kjriga If you pull the GitHub Action commit out into its own PR, I'll merge that and it'll get the CI to start running. You'll have to fix any issues with it in a separate PR.

@kjriga
Copy link
Copy Markdown
Author

kjriga commented Oct 15, 2025

@kjriga If you pull the GitHub Action commit out into its own PR, I'll merge that and it'll get the CI to start running. You'll have to fix any issues with it in a separate PR.

PR

@kjriga kjriga force-pushed the solidus-4-support branch 2 times, most recently from 149a0dd to 0b06fbd Compare October 17, 2025 18:49
@jarednorman
Copy link
Copy Markdown
Member

jarednorman commented Oct 20, 2025

I've just disabled the CircleCI builds, but it looks like the GitHub builds are busted.

Edit: I see you are working on that in #42.

Kendra Riga added 5 commits November 3, 2025 09:43
We want to support Solidus 4 to 4.5.

I stopped at 4.5 because there are changes in 4.6+ with some
'disable_builtin_emails' configuration that required more work, so I
think a plan to move forward is to make the current gemspec only allow
'>= 4.0.0', '< 4.6', and add some deprecation warnings about that
feature becoming obsolete. Then have a new version that's '>= 4.6.0',
'<5.0' that removes it all.

I am doing this work specifically to bump another app that uses it to
Solidus 4, and that is my priority at the moment.
- Update method name from order_finalized to send_confirmation_email
- Change target class from Spree::MailerSubscriber to Spree::OrderMailerSubscriber
- Remove version conditional since gem now only supports Solidus 4+
No longer required with Solidus 4+. The method it is overriding doesn't
exist anymore.
- Add the requirement of open struct now that it isn't automatically
  included
- Change expectations to account for changes with how state changes are
  handled in background jobs. solidusio/solidus@2a2df71
- Replace build_stubbed with just build, some objects were missing
  fields
- Since we removed the requirement for solidus_frontend from this gem,
  we don't care about the reset password email sending so we can just
  stub it out
Similar to the confirm email, we need this to respect the
'disable_builtin_emails' value.
@adammathys adammathys force-pushed the solidus-4-support branch 2 times, most recently from b44a1d6 to c80f7aa Compare November 3, 2025 22:00
Now that we're only supporting Solidus v4.0-4.5 with these changes, we
need to tweak our testing matrix.

Also, we were missing some configuration in order for our Github action
environment variables to be able to pull the correct versions of Rails
and Solidus.
At some point in Rails 7.1+, the dummy app generation changed such that
it no longer would fully setup the database for us. All of our other
extensions seem to have avoided this issue because they all contain some
migrations and run them as part of their install steps.

So, even though we don't currently add any migrations from this
extension, we're adding the step so that our CI can correctly setup the
test database.
We're cutting off support for older versions of Solidus so we should do
a major version bump. (Even if it appears we have never changed the
version of this extension since inception.)
We're no longer using CircleCI for tests, so we should switch the badge
to something more useful.
Copy link
Copy Markdown

@forkata forkata left a comment

Choose a reason for hiding this comment

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

Great work on these changes @kjriga and @adammathys 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants