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

Error handling #659

Merged
merged 21 commits into from
Feb 6, 2024
Merged

Error handling #659

merged 21 commits into from
Feb 6, 2024

Conversation

elena-kolevska
Copy link
Contributor

@elena-kolevska elena-kolevska commented Jan 14, 2024

Description

Improves developer experience on error handling for the new Rich gRPC Errors from Dapr

Issue reference

#648

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@elena-kolevska
Copy link
Contributor Author

@berndverst pls let me know if the DaprGrpcError design and naming look ok to you. I would also like to get your opinion on the integration testing approach I took. I think it can be helpful for other cases too.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (ef73209) 86.21% compared to head (682f645) 86.37%.

Files Patch % Lines
dapr/clients/exceptions.py 92.75% 5 Missing ⚠️
dapr/clients/grpc/client.py 95.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
+ Coverage   86.21%   86.37%   +0.15%     
==========================================
  Files          79       79              
  Lines        3998     4094      +96     
==========================================
+ Hits         3447     3536      +89     
- Misses        551      558       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@berndverst
Copy link
Member

LGTM. Can you resolve the conflict now that I merged the ruff stuff :)

@elena-kolevska elena-kolevska marked this pull request as ready for review January 22, 2024 10:09
@elena-kolevska elena-kolevska requested review from a team as code owners January 22, 2024 10:09
@elena-kolevska
Copy link
Contributor Author

Marking this ready so the code can be reviewed while I'm working on examples and docs.

@elena-kolevska
Copy link
Contributor Author

Ok, examples and docs are ready :)

tox.ini Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
examples/error_handling/error_handling.py Outdated Show resolved Hide resolved
examples/error_handling/error_handling.py Show resolved Hide resolved
dapr/clients/exceptions.py Outdated Show resolved Hide resolved
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
elena-kolevska and others added 3 commits January 24, 2024 22:36
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
@elena-kolevska
Copy link
Contributor Author

I addressed the review comments and I simplified the DaprGrpcError structure. 🙏

tox.ini Show resolved Hide resolved
examples/error_handling/error_handling.py Outdated Show resolved Hide resolved
examples/error_handling/error_handling.py Show resolved Hide resolved
examples/error_handling/README.md Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@berndverst
Copy link
Member

I now updated the tox configuration to include your error handling test app. I am expected it to fail (it fails for me locally). You'll have to debug that one some more.

@berndverst
Copy link
Member

If this PR requires Dapr 1.13, please let me know. In that case we will not be able to successfully run the CI tests until we have Dapr 1.13.0rc1 tagged

Signed-off-by: Elena Kolevska <[email protected]>
@elena-kolevska
Copy link
Contributor Author

If this PR requires Dapr 1.13, please let me know. In that case we will not be able to successfully run the CI tests until we have Dapr 1.13.0rc1 tagged

Yes, that's exactly it! I could only test it with my local dapr build and had to make the following modifications to the README to make it pass:

  • Removed the == APP == string added by dapr cli
  • Changed the command dapr run -- python3 error_handling.py to use my custom dapr build
  • Removed the link for errors in docs, because it's still not deployed (PR is getting merged this week)

Unfortunately, I had also commented out all the other examples in the tox.ini so it only ran my test while I was working on it, to keep it faster, but when I was committing, I also reverted the line that added my errors test by mistake. Sorry about that!
That explains why the CI test succeeded when I was expecting it to fail. I thought you were doing some voodoo by making dapr cli build from a custom commit. If that is possible, btw, please let me know how it's done :)

@berndverst berndverst added do-not-merge waiting-for-runtime-release waiting for runtime RC release before this PR can be tested in CI/CD and merged labels Jan 25, 2024
@berndverst
Copy link
Member

I will rerun tests and merge this when 1.13.0rc1 has been tagged. At that point this should all pass :) (I tried it locally with a Dapr build from master)

Copy link

@cicoyle cicoyle left a comment

Choose a reason for hiding this comment

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

Great job with the error handling docs 🎉

@berndverst berndverst removed waiting-for-runtime-release waiting for runtime RC release before this PR can be tested in CI/CD and merged do-not-merge labels Feb 6, 2024
@berndverst berndverst added this pull request to the merge queue Feb 6, 2024
@berndverst berndverst removed this pull request from the merge queue due to a manual request Feb 6, 2024
@berndverst berndverst merged commit fc0e9d1 into dapr:main Feb 6, 2024
16 checks passed
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.

3 participants