Skip to content

Improve Stock Coordinator Extensibility - #6527

Draft
sofiabesenski4 wants to merge 10 commits into
solidusio:mainfrom
SuperGoodSoft:sofia/oss-3-make-the-coordinator-easily-extensible
Draft

Improve Stock Coordinator Extensibility#6527
sofiabesenski4 wants to merge 10 commits into
solidusio:mainfrom
SuperGoodSoft:sofia/oss-3-make-the-coordinator-easily-extensible

Conversation

@sofiabesenski4

@sofiabesenski4 sofiabesenski4 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #5855.

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.

@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Jul 30, 2026
sofiabesenski4 and others added 7 commits July 30, 2026 12:03
Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
The initializer doesn't need to handle this.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
This was obfuscating a method call order dependency.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
Stock location filtering is not needed anywhere else in this class.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
These are separate processes that can be reorganized into separate
classes in the future.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
Inventory units are not relevant to any other processes.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Senem Soy <senem@super.gd>
@sofiabesenski4
sofiabesenski4 force-pushed the sofia/oss-3-make-the-coordinator-easily-extensible branch from 214a20c to 5930fbb Compare July 30, 2026 19:04
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.10145% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (72f9fcd) to head (6eb2f8e).
⚠️ Report is 1429 commits behind head on main.

Files with missing lines Patch % Lines
core/app/models/spree/stock/coordinator.rb 94.28% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6527      +/-   ##
==========================================
- Coverage   95.07%   92.27%   -2.81%     
==========================================
  Files         460      997     +537     
  Lines        7924    20517   +12593     
==========================================
+ Hits         7534    18932   +11398     
- Misses        390     1585    +1195     

☔ View full report in Codecov by Harness.
📢 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.

@jarednorman jarednorman changed the title Sofia/oss 3 make the coordinator easily extensible Improve Stock Coordinator Extensibility Aug 11, 2026
@sofiabesenski4
sofiabesenski4 force-pushed the sofia/oss-3-make-the-coordinator-easily-extensible branch from 5930fbb to 5c181c6 Compare August 19, 2026 21:59
Choosing which stock locations to allocate inventory from is a shipping
concern rather than a coordination one. The coordinator now receives the
stock locations it should use, which frees it from the location filter
and sorter configuration.

SimpleCoordinator accepts the new keyword argument too, since it is
still the configured coordinator_class. It keeps filtering and sorting
on its own when no stock locations are given, so its behaviour is
unchanged.

This also fixes a NameError in Coordinator#build_packages, which
reached for the inventory unit builder class through a reader that
does not exist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sofiabesenski4
sofiabesenski4 force-pushed the sofia/oss-3-make-the-coordinator-easily-extensible branch from 5c181c6 to f5792ed Compare September 2, 2026 17:17
sofiabesenski4 and others added 2 commits September 2, 2026 10:26
This will help with under the hood optimizations using Object Shapes.
There was a lot of package specific logic included in the coordinator,
which is supposed to be a higher level orchestration class.

By moving this into a dedicated object, we can add an extension point,
as well as clean up the responsibilities of the new Coordinator.

Co-authored-by: Jared Norman <jared@super.gd>
Co-authored-by: Alistair Norman <alistair@super.gd>
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.

Pass caller options through Spree::Stock::SimpleCoordinator

1 participant