Skip to content

Deprecate price soft delete#6428

Draft
mamhoff wants to merge 6 commits intosolidusio:mainfrom
mamhoff:deprecate-price-soft-delete
Draft

Deprecate price soft delete#6428
mamhoff wants to merge 6 commits intosolidusio:mainfrom
mamhoff:deprecate-price-soft-delete

Conversation

@mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Mar 17, 2026

Summary

Soft-deleteable prices are an absolute nuisance to think about, so this creates a strategy for removing that concept. WIP still!

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.

mamhoff added 6 commits March 17, 2026 08:35
We want to deprecate the soft-deleteability of prices. This adds a rake
task to fully delete any prices that are soft-deletable.
This module is intended to allow us to drop soft-deletion from
Spree::Price. The deprecation logic is quite a lot, so I've moved it
into a module. I've had to decouple the default scope in
Spree::SoftDeletable from Discard's API, because otherwise any
invocation of the class this is included in spits out deprecation
warnings. We don't want that for prices.
We don't want to be using Discard's API for prices internally.
For Solidus 4.7, we still want to allow soft-deleted prices to give
developers a time window to actually delete those soft-deleted prices.
From Solidus 5, this option will be removed, and support for
soft-deleted prices will be gone.

This changes the spec for the app configuration to use a pristine app
configuration every time, ensuring that the configuration of the test
app is not necessarily the same as the default configuration for new
apps.
Products and variants both have scopes that query prices. For these
scopes, ignore the `kept` default scopes if
`Spree::Config.soft_deleted_prices` is false.
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Mar 17, 2026
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.30%. Comparing base (a339926) to head (266074e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../lib/tasks/solidus/delete_soft_deleted_prices.rake 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6428      +/-   ##
==========================================
- Coverage   89.51%   89.30%   -0.22%     
==========================================
  Files         981      912      -69     
  Lines       20502    18733    -1769     
==========================================
- Hits        18353    16730    -1623     
+ Misses       2149     2003     -146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant