-
Notifications
You must be signed in to change notification settings - Fork 5.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
Feature/minimal variant price sorting #4416
Conversation
Did you notice that pytest is printing 100 time:
I believe it's a warning, but I don't see any message. I checked, the travis build on master doesn't do that. Could you take a look? |
saleor/product/migrations/0096_product_minimal_variant_price.py
Outdated
Show resolved
Hide resolved
5928c76
to
f2d0ec2
Compare
Here is the report for d7eded6 (mirumee/saleor @ feature/minimal_variant_price_sorting) No differences were found. (click me)
# api.benchmark checkout
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
add billing address to checkout 34 34 20
add shipping to checkout 7 7 0
checkout payment charge 14 14 0
complete checkout 6 6 0
create checkout 48 48 24
# api.benchmark homepage
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
retrieve main menu 5 5 0
retrieve product list 4 4 0
retrieve secondary menu 5 5 0
retrieve shop 2 2 0
# api.benchmark product
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
product details 13 13 3
# api.benchmark variant
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
retrieve variant list 15 15 8 |
f2d0ec2
to
e694777
Compare
Codecov Report
@@ Coverage Diff @@
## master #4416 +/- ##
=========================================
+ Coverage 91.39% 91.4% +<.01%
=========================================
Files 308 308
Lines 18261 18326 +65
Branches 1814 1835 +21
=========================================
+ Hits 16690 16751 +61
Misses 1058 1058
- Partials 513 517 +4
Continue to review full report at Codecov.
|
@derenio please rebase this PR to master |
6c5c018
to
03171cb
Compare
@derenio please fix CI |
343de14
to
273734a
Compare
@derenio Please rebase this branch with |
8a8fdf1
to
566c0dc
Compare
@maarcingebala just rebased the |
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.
In API we also have bulk mutations that would affect minimal prices, such as:
saleBulkDelete
categoryBulkDelete
collectionBulkDelete
collectionBulkPublish
productVariantBulkDelete
But I guess we could add support for calculating minimal prices in bulk actions in a separate PR as well.
saleor/product/migrations/0104_product_minimal_variant_price.py
Outdated
Show resolved
Hide resolved
How do we handle published vs. unpublished collections in terms of minimal prices? E.g., if there is a sale for a particular collection, but the collection isn't published yet. Can we even create a sale for unpublished collections? I'm not sure how it works now but I'm writing that down for us not to forget to check it. |
Publish/unpublish and calculating of minimal price are for me two separate things. |
@koradon I think it is related, but the problem is more general. Consider this case:
Maybe the simplest solution is to have a periodic task that recalculates all prices based on what is currently published in the store. |
@maarcingebala yes, we ware talking about designing periodic task for recalculating prices. That was the main save behavior that will fix any mistakes in our logic. |
saleor/product/migrations/0104_product_minimal_variant_price.py
Outdated
Show resolved
Hide resolved
saleor/product/migrations/0104_product_minimal_variant_price.py
Outdated
Show resolved
Hide resolved
25f51a9
to
9259837
Compare
of: - Product, - ProductVariant, - Sale, and - Collection, Categories don't require updating as they cascade delete products on their removal. Also, products are already updated after they are assigned a category on their creation.
categorie(s)_ids -> category_ids
it probably worked till now because: ```sale.pk == collection.pk``` in the fixtures.
as its content was copy-pasted from the ProductCreate test without the necessary changes
They are handled in the "ProductFilterInput"
6acdd04
to
521934c
Compare
@maarcingebala I've rebased (twice x|) onto the latest master to resolve conflicts on the |
This
PR
:minimal_variant_price
to theProduct
model,minimal_variant_price
on: