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

Enable extension manager for taxes #4497

Merged
merged 24 commits into from
Jul 30, 2019
Merged

Enable extension manager for taxes #4497

merged 24 commits into from
Jul 30, 2019

Conversation

korycins
Copy link
Member

@korycins korycins commented Jul 19, 2019

Convert all taxes logic into a plugin architecture

  • Convert vatlayer into Plugin
  • Convert avatax into Plugin
  • Enable extensions manager

It closes #3992

@korycins korycins self-assigned this Jul 19, 2019
@korycins korycins marked this pull request as ready for review July 23, 2019 11:00
@korycins
Copy link
Member Author

korycins commented Jul 23, 2019

@salwator @maarcingebala @NyanKiyoshi All logic from saleor.core.extensions.plugins.avatax, saleor.core.extensions.plugins.vatlayer directories has been moved from the taxes.interface module.

Copy link

django-queries commented Jul 23, 2019

Here is the report for e875d72 (korycins/saleor @ enable_extension_manager_for_taxes)
Base comparison is 0a28e71.

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                     	         41	         41	             20

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

@codecov
Copy link

codecov bot commented Jul 23, 2019

Codecov Report

Merging #4497 into master will increase coverage by 0.19%.
The diff coverage is 66.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4497      +/-   ##
==========================================
+ Coverage   90.62%   90.82%   +0.19%     
==========================================
  Files         297      297              
  Lines       17434    17469      +35     
  Branches     1746     1745       -1     
==========================================
+ Hits        15800    15866      +66     
+ Misses       1122     1092      -30     
+ Partials      512      511       -1
Impacted Files Coverage Δ
saleor/core/views.py 92.85% <ø> (ø) ⬆️
saleor/product/utils/__init__.py 95.29% <ø> (ø) ⬆️
saleor/graphql/payment/mutations.py 97.7% <ø> (-0.03%) ⬇️
saleor/core/templatetags/taxed_prices.py 88.88% <0%> (+7.93%) ⬆️
...aleor/core/extensions/plugins/vatlayer/__init__.py 95.52% <100%> (ø)
saleor/dashboard/order/forms.py 87.43% <100%> (+0.06%) ⬆️
saleor/product/utils/availability.py 97.33% <100%> (+0.15%) ⬆️
saleor/checkout/forms.py 94.47% <100%> (+0.09%) ⬆️
saleor/dashboard/product/views.py 93.36% <100%> (-0.02%) ⬇️
saleor/checkout/views/__init__.py 86.13% <100%> (+0.31%) ⬆️
... and 32 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 0a28e71...e875d72. Read the comment docs.

@korycins korycins requested a review from patrys July 24, 2019 05:54
saleor/celeryconf.py Outdated Show resolved Hide resolved
Copy link
Member

@patrys patrys left a comment

Choose a reason for hiding this comment

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

Looks great but seems there are no documentation changes?

@korycins
Copy link
Member Author

@maarcingebala @patrys Documentation has been added.

calling some actions when an order has been created.


ExtensionsManager
Copy link
Member

Choose a reason for hiding this comment

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

I think we should start with "how to use it" before we dive into the details of implementing a custom plugin and eventually a custom manager (not sure if we should event document that part).

Copy link
Member

Choose a reason for hiding this comment

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

I think https://docs.djangoproject.com/en/2.2/topics/http/middleware/ is a good reference for what type of information we would need to provide (but I would still document installing plugins before writing custom ones).

Copy link
Member Author

Choose a reason for hiding this comment

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

@patrys I've changed the structure as you said. Can you take a look one more time?

docs/customization/extensions.rst Outdated Show resolved Hide resolved
docs/customization/extensions.rst Outdated Show resolved Hide resolved
docs/customization/extensions.rst Outdated Show resolved Hide resolved
@korycins korycins merged commit cbfafe9 into saleor:master Jul 30, 2019
@korycins korycins deleted the enable_extension_manager_for_taxes branch July 30, 2019 08:24
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.

Plugin architecture
6 participants