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 product variants events #6963

Merged
merged 9 commits into from
Mar 16, 2021

Conversation

piotrgrundas
Copy link
Contributor

@piotrgrundas piotrgrundas commented Mar 4, 2021

I want to merge this change because I need events for product variant:

  • variant create
  • product variant update
  • product variant delete

Dashboard PR

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

@db-queries
Copy link

db-queries bot commented Mar 4, 2021

Here is the report for 9578783 (piotrgrundas:product_variant_events)
Base comparison is 43a08f7.

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                                           	         19	         19	              4
  staff create                                               	         22	         22	              4
  staff update groups and permissions                        	         33	         33	              5

# 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                                            	          7	          7	              2
  query attributes                                           	         11	         11	              3

# saleor.graphql.checkoutbenchmark checkout mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  add billing address to checkout                            	         49	         49	              5
  add shipping to checkout                                   	         64	         64	             10
  checkout email update                                      	         23	         23	              0
  checkout payment charge                                    	         41	         41	             16
  checkout shipping address update                           	         69	         69	             14
  checkout voucher code                                      	         68	         68	             11
  complete checkout                                          	         96	         96	             21
  create checkout                                            	         76	         76	             12
  customer complete checkout                                 	        133	        133	             35
  update checkout lines                                      	         87	         87	             16

# saleor.graphql.checkoutbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  user checkout details                                      	         39	         39	              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.menubenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  retrieve main menu                                         	          5	          5	              0
  retrieve secondary menu                                    	          5	          5	              0

# saleor.graphql.orderbenchmark fulfillment refund and return products
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  fulfillment refund products order lines                    	         46	         46	              2
  fulfillment return products order lines                    	         99	         99	             11

# saleor.graphql.orderbenchmark order
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  staff order details                                        	         69	         69	             41
  user order details                                         	         23	         23	              1

# saleor.graphql.pagebenchmark page type
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  query page type                                            	         17	         17	              5
  query page types                                           	         19	         19	              5

# saleor.graphql.productbenchmark category
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  category view                                              	         24	         24	              1

# saleor.graphql.productbenchmark collection
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  collection view                                            	          6	          6	              0
  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
  -----------------------------------------------------------	-----------	-----------	---------------
  product details                                            	         26	         26	              0
  retrieve channel listings                                  	         18	         18	              0
  retrieve product attributes                                	          8	          8	              0
  retrive products with product types and attributes         	          6	          6	              0

# saleor.graphql.productbenchmark variant
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
- product variant bulk create                                	         59	         62	              2
  retrieve variant list                                      	         24	         24	              0

# 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

# 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                                              	          2	          2	              0

@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #6963 (9578783) into master (bf0a137) will decrease coverage by 0.00%.
The diff coverage is 89.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6963      +/-   ##
==========================================
- Coverage   93.01%   93.00%   -0.01%     
==========================================
  Files         423      423              
  Lines       31146    31227      +81     
  Branches     3165     3178      +13     
==========================================
+ Hits        28969    29044      +75     
- Misses       1532     1534       +2     
- Partials      645      649       +4     
Impacted Files Coverage Δ
saleor/plugins/webhook/plugin.py 60.62% <60.00%> (-0.09%) ⬇️
saleor/webhook/serializers.py 92.00% <84.61%> (-8.00%) ⬇️
saleor/graphql/product/bulk_mutations/products.py 98.22% <100.00%> (+0.01%) ⬆️
saleor/graphql/product/mutations/channels.py 98.63% <100.00%> (ø)
saleor/graphql/product/mutations/products.py 96.86% <100.00%> (+0.03%) ⬆️
saleor/graphql/translations/mutations.py 97.30% <100.00%> (+0.03%) ⬆️
saleor/plugins/base_plugin.py 97.25% <100.00%> (+0.04%) ⬆️
saleor/plugins/manager.py 93.84% <100.00%> (+0.17%) ⬆️
saleor/webhook/event_types.py 100.00% <100.00%> (ø)
saleor/webhook/payloads.py 94.61% <100.00%> (+0.30%) ⬆️
... and 7 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 bf0a137...9578783. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Mar 5, 2021

This pull request introduces 1 alert when merging 30a1c3aa3dfe402f5362bf2caa85d63ed815e834 into 326a5b8 - view on LGTM.com

new alerts:

  • 1 for Unused import

@piotrgrundas piotrgrundas marked this pull request as ready for review March 9, 2021 21:16
@piotrgrundas piotrgrundas force-pushed the product_variant_events branch 4 times, most recently from 654b444 to 000c870 Compare March 10, 2021 06:30
@piotrgrundas piotrgrundas self-assigned this Mar 10, 2021
@piotrgrundas piotrgrundas force-pushed the product_variant_events branch 2 times, most recently from 297d962 to ccc2b4d Compare March 10, 2021 09:09
@piotrgrundas piotrgrundas requested review from a team and d-wysocki March 10, 2021 09:09
@@ -219,7 +224,6 @@ def generate_customer_payload(customer: "User"):
"name",
"description",
"currency",
"attributes",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did not work 🤫

@fowczarek fowczarek requested a review from korycins March 11, 2021 07:59
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@fowczarek fowczarek left a comment

Choose a reason for hiding this comment

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

We have a few more mutations to update ProductVariant:

  • ProductVariantStocksCreate
  • ProductVariantStocksDelete
  • ProductVariantStocksUpdate
  • ProductVariantTranslate
  • ProductVariantChannelListingUpdate
  • ProductVariantReorderAttributeValues
  • VariantImageAssign
  • VariantImageUnassign

I'm not sure that we should trigger webhook in all the above mutations but for sure we should trigger webhook in ProductVariantChannelListingUpdate

saleor/graphql/product/bulk_mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/bulk_mutations/products.py Outdated Show resolved Hide resolved
saleor/webhook/tests/test_webhook_payloads.py Outdated Show resolved Hide resolved
saleor/webhook/tests/test_webhook_payloads.py Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Mar 11, 2021

This pull request introduces 2 alerts when merging db57dfd into 3f6f224 - view on LGTM.com

new alerts:

  • 2 for Unused import

@piotrgrundas piotrgrundas force-pushed the product_variant_events branch 2 times, most recently from 5436f1f to b07075c Compare March 12, 2021 08:09
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
@piotrgrundas piotrgrundas force-pushed the product_variant_events branch 5 times, most recently from 3ae9bbe to 0e8c05e Compare March 12, 2021 11:14
saleor/graphql/product/bulk_mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
saleor/graphql/product/mutations/products.py Outdated Show resolved Hide resolved
saleor/webhook/tests/test_webhook_payloads.py Show resolved Hide resolved
@maarcingebala maarcingebala merged commit b01a0ac into saleor:master Mar 16, 2021
@piotrgrundas piotrgrundas deleted the product_variant_events branch March 16, 2021 11:27
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.

None yet

5 participants