Skip to content

Do not merge- random change to test coderabbit CR#7561

Open
eastandwestwind wants to merge 1 commit intomainfrom
test-coderabbit
Open

Do not merge- random change to test coderabbit CR#7561
eastandwestwind wants to merge 1 commit intomainfrom
test-coderabbit

Conversation

@eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented Mar 4, 2026

Ticket []

Description Of Changes

Code Changes

Steps to Confirm

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new timing option for manual task execution configuration.
  • UI Updates

    • Custom fields interface now displays an additional action button.
  • Other Changes

    • Updated consent migration logic for legacy system handling.

@eastandwestwind eastandwestwind requested review from a team as code owners March 4, 2026 14:11
@eastandwestwind eastandwestwind requested review from adamsachs and lucanovera and removed request for a team March 4, 2026 14:11
@vercel
Copy link
Contributor

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Error Error Mar 4, 2026 2:14pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Mar 4, 2026 2:14pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

This pull request introduces three independent modifications: an additional UI button in the custom fields table, a return value change in consent migration logic from undefined to an empty object, and a new test enum member in manual task execution timing configuration.

Changes

Cohort / File(s) Summary
Custom Fields UI
clients/admin-ui/src/features/custom-fields/CustomFieldsTable.tsx
Added a second primary Button alongside the existing "Add custom field" button, both sharing the same onAddClick handler and data-testid, creating a duplicate interactive element and potential test-id conflict.
Consent Migration Logic
clients/fides-js/src/lib/consent-migration/onetrust.ts
Modified convertToFidesConsent to return an empty object ({}) instead of undefined when otFidesMapping is absent, altering early exit behavior and control flow.
Manual Task Enum
src/fides/api/models/manual_task/manual_task.py
Added test_new_enum member to ManualTaskExecutionTiming enum, expanding available enum values without modifying existing members.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Three little changes hopped on by,
A button, return, and enum do fly,
Though scattered like clover across the code,
Each one brings its own little load!
Review with care, dear developer friend,

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is entirely a template scaffold with all placeholder text and no actual content filled in; critical sections like ticket number, changes description, code changes list, and confirmation steps remain empty. Complete the description by filling in the ticket number, describing the changes made, listing specific code changes, providing confirmation steps, and indicating which pre-merge checklist items apply.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates this is a test pull request not intended for merge, but provides minimal information about the actual changes in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-coderabbit

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR contains three intentional test changes (as indicated by the "Do not merge" title) that introduce real, critical bugs across unrelated parts of the codebase:

  • onetrust.ts: A return {} statement on line 30, inserted before the try/catch block, makes all OneTrust cookie parsing logic completely unreachable. The method will always return an empty consent object, breaking the entire OneTrust-to-Fides consent migration feature.
  • CustomFieldsTable.tsx: A duplicate <Button> element with the same data-testid="add-custom-field-btn" as the existing button was added on lines 28-34. This breaks any tests that query this selector and includes non-production placeholder text.
  • manual_task.py: A test-only enum value test_new_enum was added to the ManualTaskExecutionTiming enum on line 41. Since this enum persists to the database, it pollutes the production enum space with an unhandled timing type that lacks DAG execution logic.

Confidence Score: 0/5

  • This PR must not be merged — it contains three critical bugs that break core functionality.
  • All three changes are concrete bugs with high severity. The onetrust.ts change breaks the entire consent migration feature by making the main logic unreachable. The CustomFieldsTable change breaks test selectors. The manual_task.py change pollutes the production enum with test values. These are not speculative issues — they are verifiable, reproducible bugs that will cause runtime failures if merged.
  • All three files require attention: clients/fides-js/src/lib/consent-migration/onetrust.ts, clients/admin-ui/src/features/custom-fields/CustomFieldsTable.tsx, and src/fides/api/models/manual_task/manual_task.py.

Last reviewed commit: 408dd35

if (!options.otFidesMapping) {
return undefined;
}
return {}
Copy link
Contributor

Choose a reason for hiding this comment

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

The return {} statement on line 30 makes the entire try/catch block unreachable. This causes convertToFidesConsent to always return an empty object, breaking OneTrust cookie parsing and consent migration completely.

Suggested change
return {}
// Remove this line to allow the try/catch block to execute

Comment on lines +28 to +34
<Button
onClick={onAddClick}
type="primary"
data-testid="add-custom-field-btn"
>
Hi I'm a new button
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

A duplicate <Button> element was added with the same data-testid="add-custom-field-btn" as the existing button above it. This breaks any tests that query this selector, as they will now find two elements instead of one. The placeholder text "Hi I'm a new button" also indicates this is incomplete.

Suggested change
<Button
onClick={onAddClick}
type="primary"
data-testid="add-custom-field-btn"
>
Hi I'm a new button
</Button>

class ManualTaskExecutionTiming(StrEnum):
"""Enum for when a manual task should be executed in the privacy request DAG."""

test_new_enum = "test_new_enum"
Copy link
Contributor

Choose a reason for hiding this comment

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

The test-only enum value test_new_enum was added to the ManualTaskExecutionTiming enum. Since this enum is persisted to the database via EnumColumn, this pollutes the production enum space with an unhandled timing type that has no corresponding DAG logic.

Suggested change
test_new_enum = "test_new_enum"

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@clients/fides-js/src/lib/consent-migration/onetrust.ts`:
- Line 30: Remove the unconditional return {} so the decoding and parsing logic
runs: let the code call decodeURIComponent, JSON.parse and parseCookieValue (the
parseCookieValue helper) to compute the migrated consent value and return that
result; if you need a safe fallback, wrap the decode/parse steps in a try/catch
and only return {} inside the catch (or when parsing yields no data) so parsing
errors fall back gracefully instead of short-circuiting the function.

In `@src/fides/api/models/manual_task/manual_task.py`:
- Line 41: Remove the unused test artifact by deleting the test_new_enum member
from the ManualTaskExecutionTiming enum (symbol: ManualTaskExecutionTiming) in
manual_task.py, search the repo to ensure no references to test_new_enum remain,
run the test suite, and if your project persists enum values in the DB schema
update the related enum migration or schema migration to remove that value so
runtime/DB enums stay in sync.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8e9902c-670e-47e8-b5cc-66abc396f5d4

📥 Commits

Reviewing files that changed from the base of the PR and between 789ec53 and 408dd35.

📒 Files selected for processing (3)
  • clients/admin-ui/src/features/custom-fields/CustomFieldsTable.tsx
  • clients/fides-js/src/lib/consent-migration/onetrust.ts
  • src/fides/api/models/manual_task/manual_task.py

if (!options.otFidesMapping) {
return undefined;
}
return {}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Line 30 makes the parser unreachable and breaks consent migration.

The unconditional return {} exits before decodeURIComponent, JSON.parse, and parseCookieValue run, so migrated consent is never computed.

Suggested fix
   if (!options.otFidesMapping) {
-      return undefined;
+      return {};
   }
-  return {}
 
   try {

Also applies to: 32-49

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@clients/fides-js/src/lib/consent-migration/onetrust.ts` at line 30, Remove
the unconditional return {} so the decoding and parsing logic runs: let the code
call decodeURIComponent, JSON.parse and parseCookieValue (the parseCookieValue
helper) to compute the migrated consent value and return that result; if you
need a safe fallback, wrap the decode/parse steps in a try/catch and only return
{} inside the catch (or when parsing yields no data) so parsing errors fall back
gracefully instead of short-circuiting the function.

class ManualTaskExecutionTiming(StrEnum):
"""Enum for when a manual task should be executed in the privacy request DAG."""

test_new_enum = "test_new_enum"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) First, check if the file exists and examine the enum definition
echo "=== Checking enum definition ==="
if [ -f "src/fides/api/models/manual_task/manual_task.py" ]; then
  head -50 "src/fides/api/models/manual_task/manual_task.py"
else
  echo "File not found"
  find . -name "manual_task.py" -type f 2>/dev/null | head -5
fi

Repository: ethyca/fides

Length of output: 1643


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 2) Search for all usages of test_new_enum in the codebase
echo "=== Searching for test_new_enum usage ==="
rg -n "test_new_enum" --type-list | head -5 2>/dev/null || true
rg -n "test_new_enum" . 2>/dev/null || echo "No results found"

Repository: ethyca/fides

Length of output: 593


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 3) Search for ManualTaskExecutionTiming usage
echo "=== Searching for ManualTaskExecutionTiming usage ==="
rg -n "ManualTaskExecutionTiming" . 2>/dev/null | head -30

Repository: ethyca/fides

Length of output: 779


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 4) Check for migrations related to execution_timing or manual_task
echo "=== Checking for migrations ==="
find . -path "*/migrations*" -name "*.py" -type f 2>/dev/null | head -20
rg -n "execution_timing|manual_task.*enum" . --type=py 2>/dev/null | head -30

Repository: ethyca/fides

Length of output: 1645


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search specifically for migrations related to execution_timing
echo "=== Searching migrations for execution_timing ==="
rg -n "execution_timing" ./src/fides/api/alembic/migrations/versions/ 2>/dev/null || echo "Not found in migrations"

# Also check for manual_task column definitions in migrations
rg -n "manual_task" ./src/fides/api/alembic/migrations/versions/ -A 2 -B 2 2>/dev/null | head -50

Repository: ethyca/fides

Length of output: 6696


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for any test files using test_new_enum
echo "=== Searching test files for test_new_enum ==="
find . -path "*/test*" -name "*.py" -type f 2>/dev/null | xargs rg -l "test_new_enum" 2>/dev/null || echo "No test files using test_new_enum"

# Search for any references in test files
rg -n "test_new_enum" . --type=py 2>/dev/null || echo "No additional occurrences"

Repository: ethyca/fides

Length of output: 225


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check schema definitions for execution_timing
echo "=== Checking schema definitions ==="
find . -path "*/schemas*" -name "*.py" -type f 2>/dev/null | xargs rg -l "execution_timing" 2>/dev/null || echo "Not found"
rg -n "execution_timing" . --type=py -B 3 -A 3 2>/dev/null | head -50

Repository: ethyca/fides

Length of output: 4455


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check the actual manual_task model more closely around the enum column definitions
echo "=== Checking manual_task model columns ==="
sed -n '495,510p' src/fides/api/models/manual_task/manual_task.py
echo "---"
sed -n '605,615p' src/fides/api/models/manual_task/manual_task.py

Repository: ethyca/fides

Length of output: 1118


Remove the unused test_new_enum test artifact from the production enum.

This value is defined but never used anywhere in the codebase (no production code, tests, or QA scenarios reference it), making it a test artifact that should not be in the persisted ManualTaskExecutionTiming enum. While migrations support the execution_timing column, introducing unused enum values creates maintenance debt and potential confusion about valid runtime values.

Suggested fix
 class ManualTaskExecutionTiming(StrEnum):
     """Enum for when a manual task should be executed in the privacy request DAG."""
 
-    test_new_enum = "test_new_enum"
     pre_execution = "pre_execution"  # Execute before the main DAG
     post_execution = "post_execution"  # Execute after the main DAG
     parallel = "parallel"  # Execute in parallel with the main DAG
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test_new_enum = "test_new_enum"
class ManualTaskExecutionTiming(StrEnum):
"""Enum for when a manual task should be executed in the privacy request DAG."""
pre_execution = "pre_execution" # Execute before the main DAG
post_execution = "post_execution" # Execute after the main DAG
parallel = "parallel" # Execute in parallel with the main DAG
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/fides/api/models/manual_task/manual_task.py` at line 41, Remove the
unused test artifact by deleting the test_new_enum member from the
ManualTaskExecutionTiming enum (symbol: ManualTaskExecutionTiming) in
manual_task.py, search the repo to ensure no references to test_new_enum remain,
run the test suite, and if your project persists enum values in the DB schema
update the related enum migration or schema migration to remove that value so
runtime/DB enums stay in sync.

@lucanovera lucanovera removed their request for review March 5, 2026 20:05
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.

1 participant