-
Notifications
You must be signed in to change notification settings - Fork 84
[ENG-1404] Endpoint updates #6894
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
[ENG-1404] Endpoint updates #6894
Conversation
…-duplicate-dsr-records-model
…-duplicate-dsr-records-model
…-duplicate-dsr-records-model
…-duplicate-dsr-records-model
…-duplicate-dsr-records-model
…-duplicate-dsr-runner-integration
…dsr-runner-integration' into update-endpoints-duplicate_group-ENG-1404-be-implement-ability-to-sort-filter-duplicate-dsr-records
…ability-to-sort-filter-duplicate-dsr-records' of github.com:ethyca/fides into update-endpoints-duplicate_group-ENG-1404-be-implement-ability-to-sort-filter-duplicate-dsr-records
|
@greptile please review this pr |
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 refactors duplicate detection to use a centralized check_for_duplicates function that consolidates duplicate checking logic across multiple scenarios (request creation, identity verification, and auto-approval flows).
Key changes:
- Added
check_for_duplicateshelper function induplication_detection.pythat encapsulates duplicate detection service instantiation and checking - Integrated duplicate checking into
handle_approvalfunction to catch duplicates when requests are manually approved - Updated
PrivacyRequestFilter.action_typeto accept list of action types for better API flexibility - Added
IdentityValueschema for improved OpenAPI documentation - Added frontend support for displaying duplicate status across admin UI and privacy center
- Comprehensive test coverage including runner service integration tests
Review findings:
- Clean refactoring that improves code reusability and maintainability
- Proper separation of concerns with duplicate checking happening at appropriate lifecycle points
- Good test coverage for various duplicate detection scenarios
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The changes are well-structured refactoring that improves code organization without introducing new logic. The duplicate detection logic itself was already implemented and tested in the base branch - this PR simply consolidates it into a reusable function and adds integration points. Comprehensive test coverage validates the refactoring.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| src/fides/api/service/privacy_request/duplication_detection.py | 5/5 | Added check_for_duplicates function to consolidate duplicate detection logic across different scenarios (creation, identity validation, auto-approval). Clean refactoring that extracts reusable logic. |
| src/fides/service/privacy_request/privacy_request_service.py | 5/5 | Refactored to use new check_for_duplicates function instead of directly instantiating DuplicateDetectionService. Simplified logic and added duplicate check to handle_approval function. |
| src/fides/api/service/privacy_request/request_runner_service.py | 5/5 | Updated to use check_for_duplicates function, simplified duplicate detection logic in the runner service. Consistent with other service changes. |
| src/fides/api/schemas/privacy_request.py | 5/5 | Added IdentityValue schema for better OpenAPI documentation. Updated PrivacyRequestFilter.action_type to accept list of action types, improving API flexibility. |
| tests/ops/service/privacy_request/test_duplication_detection.py | 5/5 | Comprehensive test coverage for duplicate detection scenarios including verified identities, time windows, actioned requests, and runner service integration. |
15 files reviewed, no comments
lucanovera
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.
Tested the feature with real requests from the privacy center and can confirm it works as expected. 💯
…-implement-ability-to-sort-filter-duplicate-dsr-records
…-implement-ability-to-sort-filter-duplicate-dsr-records
Ticket ENG-1404
Description Of Changes
🎯 Fides must provide a way for privacy admins to quickly identify and surface in the request manager UI privacy requests which are likely duplicates submitted by the same user over a period of time.
This PR adds the
check_for_duplicatesfunction toduplicate_detection.py. This function allows us to check for duplicates in a number of scenarios, inluding creation, receiving identity validation and the cases where everything is auto approved and a request goes straight to the runner.Code Changes
check_for_duplicatesfunctionPrivacyRequestFilterto accept a list (request from @lucanovera )IdentityValueschema for better openapi functionality (request from @lucanovera )Steps to Confirm
duplicate_privacy_request_detectionby hittingPATCH /api/v1/configwith the followingPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works