Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6357 +/- ##
==========================================
- Coverage 89.35% 89.35% -0.01%
==========================================
Files 961 961
Lines 20173 20182 +9
==========================================
+ Hits 18026 18034 +8
- Misses 2147 2148 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4189a32 to
9a10920
Compare
5 tasks
tvdeyen
approved these changes
Nov 1, 2025
Member
tvdeyen
left a comment
There was a problem hiding this comment.
Thanks. Can you adjust the commit message of the removal commit?
promotions/app/models/solidus_promotions/order_adjuster/discount_order.rb
Show resolved
Hide resolved
9a10920 to
1528db6
Compare
mamhoff
added a commit
to mamhoff/solidus
that referenced
this pull request
Nov 2, 2025
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
mamhoff
added a commit
to mamhoff/solidus
that referenced
this pull request
Nov 2, 2025
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
5 tasks
mamhoff
added a commit
to mamhoff/solidus
that referenced
this pull request
Nov 3, 2025
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
mamhoff
added a commit
to mamhoff/solidus
that referenced
this pull request
Nov 4, 2025
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
This method is part of the interface, but not actually used anywhere. Let's remove it before it starts getting used.
We can find out if a benefit can `:perform` itself by asking exactly that. The adjusting benefits - `AdjustLineItem` and `AdjustShipment` - respond to `:discount`. The only benefit that can `:perform` is the `CreateLineItem` benefit.
This just adds to the complexity of the benefit interface, and does not provide anything to the codebase. Let's remove before it starts being used.
1528db6 to
b304ce1
Compare
adammathys
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The concept of a promotion condition "level" is useful as a concept, but it's not useful in code (as evidenced by the ability to just remove it with one minor change in the codebase).
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: