-
Notifications
You must be signed in to change notification settings - Fork 84
Ints 334 adding ignore error support #6924
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR adds ignore_errors parameter support to initial async DSR requests (both access and erasure operations) by passing it to client.send() calls. However, the implementation has critical logic errors.
Key Changes:
- Line 313: Added
read_request.ignore_errorsparameter toclient.send()for access requests - Line 366: Added
request.ignore_errorsparameter toclient.send()for erasure requests - Lines 368-371: Added error checking for erasure requests
Critical Issue:
The code passes ignore_errors to client.send() but then immediately raises an exception if response.ok is false. This defeats the purpose of ignore_errors - when errors are configured to be ignored, client.send() already handles them by returning the response without raising. The subsequent unconditional checks will raise exceptions even when errors should be ignored.
Impact:
This will cause requests to fail even when ignore_errors is configured, preventing the intended behavior described in the PR description.
Confidence Score: 1/5
- This PR contains critical logic errors that prevent it from working as intended
- The implementation contradicts itself by passing
ignore_errorstoclient.send()then unconditionally raising exceptions on non-OK responses. This will cause requests to fail even when errors should be ignored, breaking the core functionality the PR aims to add. - src/fides/api/service/async_dsr/strategies/async_dsr_strategy_polling.py requires immediate attention - both error handling blocks need to be fixed
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| src/fides/api/service/async_dsr/strategies/async_dsr_strategy_polling.py | 3/5 | Added ignore_errors support to initial requests, but error handling logic conflicts with the intended behavior of ignore_errors |
Additional Comments (1)
-
src/fides/api/service/async_dsr/strategies/async_dsr_strategy_polling.py, line 313-318 (link)logic: Contradictory logic: passing
ignore_errorstoclient.send()then immediately raising exception if!response.okdefeats the purpose ofignore_errors. Whenignore_errors=Trueor specific status codes are ignored,client.send()returns the response without raising, making the subsequent check incorrect.If
ignore_errorsis configured, the error should be logged/handled differently rather than always raisingFidesopsException.
2 files reviewed, 2 comments
| response = client.send(prepared_request, request.ignore_errors) | ||
|
|
||
| if not response.ok: | ||
| raise FidesopsException( | ||
| f"Initial erasure request failed with status code {response.status_code}: {response.text}" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Same contradictory logic as line 313: passing request.ignore_errors to client.send() then raising exception if !response.ok defeats the purpose. The ignore_errors flag should determine whether to raise here.
Consider:
if not response.ok and not request.ignore_errors:
raise FidesopsException(...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future documentation: I Agree, however, directly ignoring the error like we do for other requests would just keep the polling going on. More work is required to gracefully handle errors here
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (33.33%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6924 +/- ##
=======================================
Coverage 87.30% 87.31%
=======================================
Files 524 524
Lines 34382 34384 +2
Branches 3957 3958 +1
=======================================
+ Hits 30017 30022 +5
+ Misses 3505 3500 -5
- Partials 860 862 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Linker44
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Ticket INTS-334
Description Of Changes
Adding missing ignore_error support on send.
The task still would still be failing, but the error thrown is more detailed that the classic
Before

After

Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works