Skip to content

Make SimpleCoordinator inventory_units keyword arg#6483

Open
sofiabesenski4 wants to merge 1 commit into
solidusio:mainfrom
SuperGoodSoft:deprecate-simple-coordinator-inventory-unit-positional-arg
Open

Make SimpleCoordinator inventory_units keyword arg#6483
sofiabesenski4 wants to merge 1 commit into
solidusio:mainfrom
SuperGoodSoft:deprecate-simple-coordinator-inventory-unit-positional-arg

Conversation

@sofiabesenski4
Copy link
Copy Markdown
Contributor

@sofiabesenski4 sofiabesenski4 commented May 14, 2026

Summary

For future improvements, we need to support additional keyword arguments to this class. The current inventory_units positional argument interferes with this.

In this commit we preserve the existing positional argument behaviour, while allowing keyword arguments to be passed in instead. This makes upgrades easier for existing projects since it does not break the existing behaviour.

Next Steps

We are working to provide a configurable replacement for the Spree::Stock::SimpleCoordinator, utilizing the middleware design pattern for increased configurability and extensibility.

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.

We want to support additional keyword arguments to this class and a
positional argument interferes with this.

Co-authored-by: Jared Norman <jared@super.gd>
Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Noah Silvera <noah@super.gd>
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (a0746e6) to head (b67737d).

Files with missing lines Patch % Lines
core/app/models/spree/stock/simple_coordinator.rb 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6483      +/-   ##
==========================================
- Coverage   89.68%   89.67%   -0.01%     
==========================================
  Files         991      991              
  Lines       20832    20835       +3     
==========================================
+ Hits        18683    18684       +1     
- Misses       2149     2151       +2     

☔ 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.

@sofiabesenski4 sofiabesenski4 force-pushed the deprecate-simple-coordinator-inventory-unit-positional-arg branch from 6b44d32 to b67737d Compare May 14, 2026 18:52
@sofiabesenski4 sofiabesenski4 marked this pull request as ready for review May 14, 2026 19:07
@sofiabesenski4 sofiabesenski4 requested a review from a team as a code owner May 14, 2026 19:07
@jarednorman
Copy link
Copy Markdown
Member

Just to call this out for anyone else on core reviewing it: we realized that the unit tests for the coordinator don't actually ever use this argument, which is not ideal.

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.

2 participants