-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce SolidusPromotions #5805
Introduce SolidusPromotions #5805
Conversation
f35fce1
to
7b1c00e
Compare
d1ba821
to
96ef390
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5805 +/- ##
==========================================
+ Coverage 89.32% 89.57% +0.24%
==========================================
Files 759 782 +23
Lines 17682 17965 +283
==========================================
+ Hits 15795 16092 +297
+ Misses 1887 1873 -14 ☔ View full report in Codecov by Sentry. |
ec3837a
to
7979816
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed this with @mamhoff live and we left some comments together for things that might be worth improving. Looking forward to merge this!
promotions/app/decorators/models/solidus_promotions/order_recalculator_decorator.rb
Show resolved
Hide resolved
...ns/app/models/concerns/solidus_promotions/conditions/line_item_applicable_order_condition.rb
Outdated
Show resolved
Hide resolved
promotions/lib/controllers/backend/solidus_promotions/admin/base_controller.rb
Show resolved
Hide resolved
promotions/lib/generators/solidus_promotions/install/install_generator.rb
Show resolved
Hide resolved
promotions/lib/generators/solidus_promotions/install/templates/initializer.rb
Outdated
Show resolved
Hide resolved
Some things we'd need help with at this stage:
|
promotions/app/models/solidus_promotions/promotion_code/batch_builder.rb
Show resolved
Hide resolved
4ed9c4c
to
49e99be
Compare
64f18c1
to
a2afec0
Compare
I keep coming back and looking at this PR... and I'm still both excited and intimidated by it. |
Is there anything I can do to augment the excitement and reduce the anxiety? |
I probably should just take it for a spin on a store. |
@jarednorman my anxiety level dropped after a very useful 1-hour session live with @mamhoff. 😄 BTW, testing this on a real/demo store could be a good way for getting the approve button pressed, which I'm going to do now. |
@kennyadsl @jarednorman @mamhoff would it be helpful to record a session? So that the community also has a chance to get some insights on the design decision made here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this in a real live store with lots of volume and personally have been attending countless pairings and reviews with @mamhoff during the last couple of months.
I am hitting the precious approve button now as well.
Amazing work Martin. I cannot add enough emojis to show my gratitude.
That would be amazing. |
@jarednorman What about we find a time and record it together? I have a hard time talking to the computer alone. :) |
Do I sense a Dead Code episode? |
@mamhoff Sorry for being very busy... how about a morning the week of November 21st? I don't mind getting up a little early, so the time zones work. Hit me up using the email on my profile. I'd love to finally see this merged. |
This reflects better what it does.
This looked a bit garbled without these extra w-100s.
Solidus Core now ships with a Null promotion handler.
We'll just be using Spree.solidus_version instead, like all the other gems.
This is to indicate clearly that this JS is used for the backend UI.
…tion This rename is for consistency only.
This allows developers to more clearly see what they need to do in order to implement custom promotion benefits.
This should give developers better hints as to how to use this gem.
As pointed out in https://github.com/solidusio/solidus/pull/5383/files#r1391519251, the new promotion code batch builder had worse performance characteristics than the one in the legacy promotion system. This gets the characteristics back to those of the legacy promotion system. Time spent and memory usage still go up significantly and linearly with the number of batches. I ran some specs with the following code: ```rb context "with a very large number of promotion codes" do let(:number_of_codes) { 10000 } it "creates the correct number of codes" do puts Benchmark.measure { subject.build_promotion_codes } expect(promotion.codes.size).to eq(number_of_codes) end end ``` With a 1000 codes, I measured: ``` Randomized with seed 49097 1.036322 0.028977 1.065299 ( 1.074396) ``` With 10000 codes, I measured: ``` Randomized with seed 33250 9.606364 0.278920 9.885284 ( 9.978242) ``` Memory usage went up linearly as well.
Much of this code has been lifted from some tax abstraction in core, and some of the comments had not been updated.
21b59e8
to
fa25fd3
Compare
With the removal of our own .rubocop.yml, a few new linting problems appeared.
fa25fd3
to
bf743d2
Compare
I've managed to clean up the git history. We've gotten rid of the merge commits from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exciting!
Thanks again @mamhoff for the time to upstream this incredible work. |
Let's go!!! 👏🏻 🎉 |
Summary
This imports the
solidus_friendly_promotions
into the mainsolidusio/solidus
repository, including all history.This has been done using
git filter-branch
.This is a big pull request, because it keeps the entire git history of the solidus_friendly_promotions repository. I encourage reviewers to review the last few commits, but better yet: Try it out on your stores.
See the README file as well as the MIGRATING.md file for instructions how to move from the legacy promotion system to
solidus_promotions
.This gem supports
And many more things. It should be well-linted, and has an extensive test suite.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs: