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

Lock checkoutComplete, create order from adyen notification #6048

Merged
merged 24 commits into from Sep 3, 2020

Conversation

korycins
Copy link
Member

@korycins korycins commented Aug 24, 2020

  • refactor checkoutComplete mutation
  • extract whole checkoutComplete logic to separate file
  • use checkout_complete logic to create order from Adyen notification
  • apply lock for handling the adyen notifciation and mutation checkoutComplete

@korycins korycins self-assigned this Aug 24, 2020
@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 24, 2020 10:21 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Aug 24, 2020

This pull request fixes 2 alerts when merging 5bbe330 into 628e980 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 26, 2020 10:54 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2020

This pull request fixes 2 alerts when merging 7ca37db into 527c92b - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #6048 into master will increase coverage by 0.08%.
The diff coverage is 86.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6048      +/-   ##
==========================================
+ Coverage   91.73%   91.82%   +0.08%     
==========================================
  Files         387      389       +2     
  Lines       25338    25699     +361     
  Branches     2382     2451      +69     
==========================================
+ Hits        23243    23597     +354     
- Misses       1509     1514       +5     
- Partials      586      588       +2     
Impacted Files Coverage Δ
saleor/payment/utils.py 87.71% <0.00%> (ø)
saleor/payment/gateways/adyen/plugin.py 77.30% <33.33%> (-0.27%) ⬇️
saleor/payment/gateways/adyen/utils.py 93.75% <71.42%> (-0.52%) ⬇️
saleor/core/transactions.py 85.71% <85.71%> (ø)
saleor/graphql/checkout/mutations.py 95.01% <85.71%> (+1.34%) ⬆️
saleor/payment/gateways/adyen/webhooks.py 81.11% <86.31%> (+1.04%) ⬆️
saleor/checkout/complete_checkout.py 88.00% <88.00%> (ø)
saleor/checkout/checkout_cleaner.py 100.00% <100.00%> (ø)
saleor/checkout/models.py 95.45% <100.00%> (+0.08%) ⬆️
saleor/checkout/utils.py 86.87% <100.00%> (-0.48%) ⬇️
... and 15 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 c451e87...4aace2a. Read the comment docs.

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.

For now it great.

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 27, 2020 10:37 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Aug 27, 2020

This pull request fixes 2 alerts when merging 58c872f into 527c92b - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 27, 2020 12:09 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Aug 27, 2020

This pull request fixes 2 alerts when merging a8d4ba0 into 527c92b - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 27, 2020 15:29 Inactive
@korycins korycins marked this pull request as ready for review August 27, 2020 15:32
@patrys
Copy link
Member

patrys commented Aug 27, 2020

Are the schema changes intentional?

@lgtm-com
Copy link

lgtm-com bot commented Aug 27, 2020

This pull request fixes 2 alerts when merging 225a61f into bf87e63 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 27, 2020 22:16 Inactive
@korycins
Copy link
Member Author

korycins commented Aug 28, 2020

Are the schema changes intentional?

@patrys , I didn't add any changes for schema. Not sure why it raises the error. I assume that I need to update my branch with master

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete August 28, 2020 07:01 Inactive
@patrys
Copy link
Member

patrys commented Sep 1, 2020

@korycins Was this branch rebased after the test change that increased the number of queries on master? Trying to make sure we're not comparing apples to oranges here.

@korycins
Copy link
Member Author

korycins commented Sep 1, 2020

@patrys Yes. I did that to get the current number of queries. - commit 3b9cafa

):
if checkout.is_shipping_required():
if not checkout.shipping_method:
raise ValidationError(
{
"shipping_method": ValidationError(
"Shipping method is not set",
code=error_code.SHIPPING_METHOD_NOT_SET,
code=error_code.SHIPPING_METHOD_NOT_SET.value,
Copy link
Member

Choose a reason for hiding this comment

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

Why are those changes needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am getting:

Unexpected type(s): (str, Union[CheckoutErrorCode, PaymentErrorCode]) Possible types: (Any, Optional[str]) (Any, Optional[str]) 

And then it raises the exception on mypy:

saleor/checkout/checkout_cleaner.py:43: error: Argument "code" to "ValidationError" has incompatible type "Union[CheckoutErrorCode, PaymentErrorCode]"; expected "Optional[str]"  [arg-type]
Found 1 error in 1 file (checked 1 source file)

saleor/core/transactions.py Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete September 1, 2020 16:20 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Sep 1, 2020

This pull request fixes 2 alerts when merging ca38344 into c1d39ce - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete September 2, 2020 11:15 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Sep 2, 2020

This pull request fixes 2 alerts when merging 9e5c8a7 into 344dffc - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete September 3, 2020 09:02 Inactive
@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete September 3, 2020 09:20 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request fixes 2 alerts when merging 76935d2 into 344dffc - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@github-actions github-actions bot temporarily deployed to adyen-lock-checkout-complete September 3, 2020 10:05 Inactive
@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request fixes 2 alerts when merging 4aace2a into 344dffc - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@maarcingebala maarcingebala merged commit a242fb6 into master Sep 3, 2020
@maarcingebala maarcingebala deleted the adyen_lock_checkout_complete branch September 3, 2020 10:52
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

7 participants