-
Notifications
You must be signed in to change notification settings - Fork 84
Adding headless value to RequestOrigin enum #6902
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
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/two-factor-authentication |
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
Added the missing headless value to the RequestOrigin enum to maintain parity with the ComponentType enum. This change prevents runtime errors when saving privacy preferences from headless experiences.
The PR also includes a comprehensive test that enforces the constraint that RequestOrigin must be a superset of ComponentType. This test will catch any future misalignment between these two enums, which is critical since request_origin is derived from component_type when saving privacy preferences.
Key Changes:
- Added
headless = "headless"toRequestOriginenum inprivacy_preference.py:47 - Added
TestRequestOriginComponentTypeRelationshiptest class with validation logic - Test includes clear documentation explaining why this constraint is necessary
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The change is straightforward and well-tested. It adds a missing enum value that already exists in ComponentType, preventing a potential runtime error. The new test ensures this type of drift won't happen in the future. No breaking changes or complex logic involved.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| src/fides/api/models/privacy_preference.py | 5/5 | Added headless value to RequestOrigin enum to maintain parity with ComponentType |
| tests/ops/models/test_privacy_preference.py | 5/5 | Added test to enforce RequestOrigin must be superset of ComponentType to prevent runtime errors |
2 files reviewed, no comments
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6902 +/- ##
=======================================
Coverage 87.29% 87.29%
=======================================
Files 523 523
Lines 34171 34172 +1
Branches 3932 3932
=======================================
+ Hits 29828 29829 +1
Misses 3487 3487
Partials 856 856 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ticket ENG-1826
Description Of Changes
Updates the
RequestOriginenum with the missingheadlessvalue. Includes a test to make sure theRequestOriginandComponentTypeenums don't driftSteps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works