Skip to content

Conversation

@galvana
Copy link
Contributor

@galvana galvana commented Oct 31, 2025

Ticket ENG-1826

Description Of Changes

Updates the RequestOrigin enum with the missing headless value. Includes a test to make sure the RequestOrigin and ComponentType enums don't drift

Steps to Confirm

  1. Tested in Fidesplus https://github.com/ethyca/fidesplus/pull/2725

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@galvana galvana requested a review from a team as a code owner October 31, 2025 21:42
@galvana galvana requested review from thabofletcher and removed request for a team October 31, 2025 21:42
@vercel
Copy link

vercel bot commented Oct 31, 2025

Deployment failed with the following error:

You must set up Two-Factor Authentication before accessing this team.

View Documentation: https://vercel.com/docs/two-factor-authentication

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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" to RequestOrigin enum in privacy_preference.py:47
  • Added TestRequestOriginComponentTypeRelationship test 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

Edit Code Review Agent Settings | Greptile

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.29%. Comparing base (4cb7648) to head (fc1cbd5).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@galvana galvana enabled auto-merge November 3, 2025 19:24
@galvana galvana added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit eb3f579 Nov 3, 2025
66 of 68 checks passed
@galvana galvana deleted the ENG-1826-fix-headless-experiences branch November 3, 2025 20:34
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