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

Update draft order validation #7253

Merged
merged 6 commits into from
Jun 21, 2021

Conversation

IKarbowiak
Copy link
Member

@IKarbowiak IKarbowiak commented Apr 28, 2021

  • Extend Order type with errors: [OrderError!]! field. When queried, this field will run draft order validation.
  • Update draft order validation - run all checks and return a list of errors
  • Create tasks for deleting order lines by deleting products or variants

Impact

  • New migrations
  • New/Updated API fields or mutations
  • Deprecated API fields or mutations
  • Removed API types, fields, or mutations
  • Documentation needs to be updated

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

@patrys
Copy link
Member

patrys commented Apr 28, 2021

@IKarbowiak IKarbowiak self-assigned this Apr 28, 2021
@db-queries
Copy link

db-queries bot commented Apr 28, 2021

Here is the report for 664bda7 (mirumee:SALEOR-2294-update-draft-order-validation)
Base comparison is 142bbfb.

Found 1 differences! (click me)

# saleor.graphql.accountbenchmark account
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  delete staff members                                       	         32	         32	              0
  query staff user                                           	         18	         18	              3
  staff create                                               	         23	         23	              3
  staff update groups and permissions                        	         32	         32	              4

# saleor.graphql.accountbenchmark permission group
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  permission group create                                    	         19	         19	              2
  permission group delete                                    	         20	         20	              3
  permission group query                                     	          7	          7	              0
  permission group update                                    	         33	         33	              1
  permission group update remove users with manage staff     	         27	         27	              3

# saleor.graphql.attributebenchmark attribute
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  query attribute                                            	          6	          6	              0
  query attributes                                           	          8	          8	              0

# saleor.graphql.checkoutbenchmark checkout mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  add billing address to checkout                            	         51	         51	              5
  add shipping to checkout                                   	         64	         64	              9
  checkout email update                                      	         25	         25	              0
  checkout payment charge                                    	         42	         42	             16
  checkout shipping address update                           	         69	         69	             13
  checkout voucher code                                      	         70	         70	             12
  complete checkout                                          	        109	        109	             13
  complete checkout with single line                         	        111	        111	             13
  create checkout                                            	         72	         72	             11
  customer complete checkout                                 	        155	        155	             42
  update checkout lines                                      	         83	         83	             14

# saleor.graphql.checkoutbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  user checkout details                                      	         41	         41	              2

# saleor.graphql.discountbenchmark sales
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  sales query with channel slug                              	         16	         16	              0
  sales query withot channel slug                            	         15	         15	              0

# saleor.graphql.discountbenchmark vouchers
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  vouchers query with channel slug                           	         16	         16	              0
  vouchers query withot channel slug                         	         15	         15	              0

# saleor.graphql.orderbenchmark fulfillment refund and return products
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  fulfillment refund products order lines                    	         53	         53	              2
  fulfillment return products order lines                    	        101	        101	             14

# saleor.graphql.orderbenchmark order
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
- staff multiple draft orders                                	        252	        432	            337
  staff multiple orders                                      	        152	        152	             76
  staff order details                                        	         46	         46	              7
  user order details                                         	         42	         42	              7

# saleor.graphql.pagebenchmark page type
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  query page type                                            	         19	         19	              7
  query page types                                           	         25	         25	             12

# saleor.graphql.productbenchmark category
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  categories children                                        	          3	          3	              0
  category delete                                            	        108	        108	             27
  category view                                              	         27	         27	              1

# saleor.graphql.productbenchmark collection
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  collection add products                                    	         44	         44	             10
  collection bulk delete                                     	         51	         51	             10
  collection view                                            	          6	          6	              0
  create collection                                          	         47	         47	             12
  delete collection                                          	         46	         46	             11
  remove products from collection                            	         41	         41	             10
  retrieve collection channel listings                       	          4	          4	              0

# saleor.graphql.productbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  report product sales                                       	         10	         10	              3
  retrieve product list                                      	          4	          4	              0

# saleor.graphql.productbenchmark product
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  filter products by attributes                              	          9	          9	              0
  filter products by numeric attributes                      	         18	         18	              0
  product create                                             	         70	         70	              3
  product details                                            	         31	         31	              0
  retrieve channel listings                                  	         19	         19	              0
  retrieve product attributes                                	          9	          9	              0
  retrieve product images                                    	          4	          4	              0
  retrieve product media                                     	          4	          4	              0
  retrive products with product types and attributes         	          7	          7	              0
  update product                                             	         46	         46	              4

# saleor.graphql.productbenchmark product variant channel listing update
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  variant channel listing update                             	         50	         50	              5

# saleor.graphql.productbenchmark variant
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variant bulk create                                	         63	         63	              2
  product variant create                                     	         75	         75	              6
  retrieve variant list                                      	         25	         25	              0
  update product variant                                     	         79	         79	             12

# saleor.graphql.productbenchmark variant stocks
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variants stocks create                             	         22	         22	              5
  product variants stocks delete                             	         19	         19	              5
  product variants stocks update                             	         27	         27	              5
  query product variants stocks                              	         14	         14	              4

# saleor.graphql.producttest product sorting attributes
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  sort product not having attribute data                     	         23	         23	              0

# saleor.graphql.shippingbenchmark shipping methods
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  vouchers query with channel slug                           	         10	         10	              0
  vouchers query without channel slug                        	          9	          9	              0

# saleor.graphql.shopbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  retrieve shop                                              	          6	          6	              0

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #7253 (664bda7) into master (142bbfb) will increase coverage by 0.00%.
The diff coverage is 99.32%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7253   +/-   ##
=======================================
  Coverage   93.32%   93.33%           
=======================================
  Files         460      460           
  Lines       34525    34588   +63     
  Branches     3527     3532    +5     
=======================================
+ Hits        32219    32281   +62     
  Misses       1604     1604           
- Partials      702      703    +1     
Impacted Files Coverage Δ
saleor/graphql/order/mutations/fulfillments.py 96.38% <ø> (ø)
saleor/graphql/order/types.py 92.28% <91.66%> (-0.03%) ⬇️
saleor/graphql/account/mutations/base.py 96.65% <100.00%> (ø)
saleor/graphql/core/mutations.py 93.81% <100.00%> (+0.03%) ⬆️
saleor/graphql/core/types/common.py 98.79% <100.00%> (ø)
saleor/graphql/order/utils.py 97.93% <100.00%> (+0.40%) ⬆️
saleor/graphql/product/bulk_mutations/products.py 98.43% <100.00%> (+0.02%) ⬆️
saleor/graphql/product/mutations/products.py 97.11% <100.00%> (+0.02%) ⬆️
saleor/graphql/product/utils.py 100.00% <100.00%> (ø)
saleor/order/__init__.py 100.00% <100.00%> (ø)
... and 1 more

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 142bbfb...664bda7. Read the comment docs.

@IKarbowiak IKarbowiak requested a review from a team April 28, 2021 11:54
@IKarbowiak IKarbowiak force-pushed the SALEOR-2294-update-draft-order-validation branch 2 times, most recently from 60ec356 to d8d6ade Compare April 28, 2021 12:42
@d-wysocki d-wysocki requested a review from a team April 29, 2021 07:58
saleor/graphql/core/types/common.py Outdated Show resolved Hide resolved
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
@IKarbowiak IKarbowiak requested a review from fowczarek May 14, 2021 09:27
@maarcingebala maarcingebala added blocked approved-breaking-change PRs with this label have approved breaking changes in the GraphQL schema labels May 17, 2021
@IKarbowiak IKarbowiak force-pushed the SALEOR-2294-update-draft-order-validation branch from af44488 to 035a6c2 Compare June 16, 2021 06:08
@IKarbowiak IKarbowiak force-pushed the SALEOR-2294-update-draft-order-validation branch from 035a6c2 to 664bda7 Compare June 18, 2021 07:10
@IKarbowiak IKarbowiak added the test deployment Deploy test environment for pull request label Jun 18, 2021
@github-actions github-actions bot temporarily deployed to saleor-2294-update-draft-order-validation June 18, 2021 12:39 Inactive
@maarcingebala maarcingebala merged commit e626a1b into master Jun 21, 2021
@maarcingebala maarcingebala deleted the SALEOR-2294-update-draft-order-validation branch June 21, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-breaking-change PRs with this label have approved breaking changes in the GraphQL schema test deployment Deploy test environment for pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants