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

Fix operation execution #3628

Closed
wants to merge 1 commit into from
Closed

Fix operation execution #3628

wants to merge 1 commit into from

Conversation

patrick91
Copy link
Member

@patrick91 patrick91 commented Sep 12, 2024

Closes #3625

Summary by Sourcery

Fix the async operation execution to ensure extensions receive the result from the execution context and add a corresponding test to verify error masking. Document the patch release in a new RELEASE.md file.

Bug Fixes:

  • Fix an issue in the async operation execution that prevented extensions from receiving the result from the execution context.

Documentation:

  • Add a RELEASE.md file to document the patch release that addresses the async operation execution issue.

Tests:

  • Add a new asynchronous test to verify that all errors are masked correctly during execution.

Copy link
Contributor

sourcery-ai bot commented Sep 12, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue with operation execution in async mode, ensuring that extensions receive the correct result from the execution context. It also adds a new async test for the MaskErrors extension.

File-Level Changes

Change Details Files
Fix async operation execution to properly handle results from execution context
  • Move result handling outside of the try-except block
  • Rename 'res' variable to 'result' for clarity
  • Ensure _handle_execution_result is called after all operations are completed
strawberry/schema/execute.py
Add async test for MaskErrors extension
  • Create new async test function test_mask_all_errors_async
  • Test MaskErrors extension behavior in async context
tests/schema/extensions/test_mask_errors.py
Add release notes for the patch
  • Create RELEASE.md file
  • Specify release type as patch
  • Describe the fix for async execution and extensions
RELEASE.md

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@patrick91 patrick91 requested a review from nrbnlulu September 12, 2024 17:20
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @patrick91 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 1 issue found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Release type: patch

This release fixes an issue that prevented extensions to receive the result from
the execution context when executing operations in async.
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (documentation): Consider rewording for clarity

The current wording is a bit ambiguous. Consider rephrasing to something like: 'This release fixes an issue that prevented extensions from receiving the result of asynchronous operations executed in the execution context.'

@botberry
Copy link
Member

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release fixes an issue that prevented extensions to receive the result from
the execution context when executing operations in async.

Here's the tweet text:

🆕 Release (next) is out! Thanks to @patrick91 for the PR 👏

Get it here 👉 https://strawberry.rocks/release/(next)

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.77%. Comparing base (eb4f558) to head (d338b6d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3628      +/-   ##
==========================================
- Coverage   96.75%   94.77%   -1.99%     
==========================================
  Files         521      517       -4     
  Lines       33715    32573    -1142     
  Branches     5622     3768    -1854     
==========================================
- Hits        32622    30871    -1751     
- Misses        861     1408     +547     
- Partials      232      294      +62     

Copy link

codspeed-hq bot commented Sep 12, 2024

CodSpeed Performance Report

Merging #3628 will not alter performance

Comparing fix/mask-error (d338b6d) with main (eb4f558)

Summary

✅ 15 untouched benchmarks

@patrick91
Copy link
Member Author

Closed in favour of #3629

@patrick91 patrick91 closed this Sep 12, 2024
@patrick91 patrick91 deleted the fix/mask-error branch September 12, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaskErrors does not work since version 0.240.0
2 participants