Skip to content
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

Add quantityAvailable field to ProductVariant type #5628

Merged
merged 5 commits into from
May 13, 2020

Conversation

fowczarek
Copy link
Member

@fowczarek fowczarek commented May 12, 2020

I want to merge this change because:

  1. adding quantityAvailable field to ProductVariant type
  2. add permissions to stocks field on ProductVariant type
  3. drop stock_quantity from Stock type

Impact

  • New migrations
  • New/Updated API fields or mutations
  • Deprecated API fields or mutations
  • Removed API types, fields, or mutations

Pull Request Checklist

  • Privileged queries and mutations are guarded by proper permission checks
  • Database queries are optimized and the number of queries is constant
  • Database migration files are up to date
  • The changes are tested
  • GraphQL schema and type definitions are up to date
  • Changes are mentioned in the changelog

@fowczarek fowczarek self-assigned this May 12, 2020
@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #5628 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5628   +/-   ##
=======================================
  Coverage   91.81%   91.82%           
=======================================
  Files         305      305           
  Lines       19540    19544    +4     
  Branches     1796     1799    +3     
=======================================
+ Hits        17941    17946    +5     
+ Misses       1172     1171    -1     
  Partials      427      427           
Impacted Files Coverage Δ
saleor/graphql/warehouse/types.py 100.00% <ø> (ø)
saleor/warehouse/models.py 89.55% <ø> (+1.14%) ⬆️
saleor/graphql/product/types/products.py 86.91% <100.00%> (+0.14%) ⬆️
saleor/warehouse/availability.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5682d0c...67161ff. Read the comment docs.

@db-queries
Copy link

db-queries bot commented May 12, 2020

Here is the report for 67161ff (mirumee/saleor @ 1401/Add-quantity-availavle-to-product-varaiant)
Base comparison is 5682d0c.

**Found 10 differences!** (click me)

# api.benchmark account
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  delete staff members                                       	         32	         32	              0
  query staff user                                           	         21	         21	              4
  staff create                                               	         24	         24	              5
  staff update groups and permissions                        	         36	         36	              6

# api.benchmark category
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  category view                                              	         18	         18	              1

# api.benchmark checkout mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
+ add billing address to checkout                            	         52	         51	             26
+ add shipping to checkout                                   	         40	         39	             12
+ checkout email update                                      	         29	         28	             13
  checkout payment charge                                    	         28	         28	              6
+ checkout shipping address update                           	         35	         34	              8
+ checkout voucher code                                      	         59	         58	             31
  complete checkout                                          	         74	         74	             19
+ create checkout                                            	        140	        135	             65
+ update checkout lines                                      	        101	         96	             40

# api.benchmark collection
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  collection view                                            	         17	         17	              0

# api.benchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  featured products list                                     	         14	         14	              0
  retrieve main menu                                         	          8	          8	              0
  retrieve product list                                      	          5	          5	              0
  retrieve secondary menu                                    	          8	          8	              0
  retrieve shop                                              	          2	          2	              0
+ user checkout details                                      	         52	         51	             26

# api.benchmark order
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  user order details                                         	         17	         17	              2

# api.benchmark permission group
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  permission group create                                    	         21	         21	              3
  permission group delete                                    	         22	         22	              4
  permission group query                                     	          8	          8	              0
  permission group update                                    	         36	         36	              2
  permission group update remove users with manage staff     	         31	         31	              4

# api.benchmark product
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
+ product details                                            	         19	         17	              1
  retrieve product attributes                                	          7	          7	              0

# api.benchmark variant
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variant bulk create                                	         48	         48	              2
- retrieve variant list                                      	         23	         30	              6

# api.benchmark variant stocks
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variants stocks create                             	         23	         23	              5
  product variants stocks delete                             	         20	         20	              5
  product variants stocks update                             	         28	         28	              5

# api product sorting attributes
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  sort product not having attribute data                     	         20	         20	              0

@fowczarek fowczarek force-pushed the 1401/Add-quantity-availavle-to-product-varaiant branch from d3e0ff9 to 59798cd Compare May 12, 2020 09:19
@fowczarek fowczarek requested a review from a team May 12, 2020 09:36
@NyanKiyoshi NyanKiyoshi requested review from a team and removed request for a team May 12, 2020 09:50
Copy link
Member

@NyanKiyoshi NyanKiyoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retrieve variant list 42 queries

saleor/warehouse/availability.py Outdated Show resolved Hide resolved
saleor/graphql/product/types/products.py Outdated Show resolved Hide resolved
@fowczarek
Copy link
Member Author

@NyanKiyoshi I add the new field to benchmark. We have tasks to optimize all stocks related queries by implementing data loaders for stocks. This change is out of scope of this PR.

@maarcingebala maarcingebala dismissed NyanKiyoshi’s stale review May 12, 2020 09:58

We already have a task to fix this issue with dataloaders.

@maarcingebala maarcingebala requested a review from IKarbowiak May 13, 2020 09:59
@fowczarek fowczarek force-pushed the 1401/Add-quantity-availavle-to-product-varaiant branch from 59ca128 to 67161ff Compare May 13, 2020 10:11
@maarcingebala maarcingebala merged commit 39e37e6 into master May 13, 2020
@maarcingebala maarcingebala deleted the 1401/Add-quantity-availavle-to-product-varaiant branch May 13, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants