Skip to content

Conversation

@adamsachs
Copy link
Contributor

@adamsachs adamsachs commented Oct 29, 2025

Ticket [ENG-1686, ENG-1802]

Done alongside https://github.com/ethyca/fidesplus/pull/2699

Description Of Changes

Backend

  • Support storing errors in a StagedResourceError table, associated with StagedResources

Frontend

  • support errored states for resources in action center
  • support Activity tab in the details tray for a field that includes error information about a particular field

Code Changes

  • BE: new StagedResourceError table to store errors associated with staged resources (one -> many relationship between staged resource -> errors)

Steps to Confirm

More details on the fidesplus PR, but here's a screenshot showing an errored staged resource exposed in the UI
image

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

@vercel
Copy link

vercel bot commented Oct 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Nov 5, 2025 5:56pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Nov 5, 2025 5:56pm

@speaker-ender speaker-ender changed the title [draft] ENG-1686: initial support for staged resource error state feat: initial support for staged resource error state [ENG-1686, ENG-1802] Oct 29, 2025
@speaker-ender speaker-ender marked this pull request as ready for review October 29, 2025 19:55
@speaker-ender speaker-ender requested review from a team as code owners October 29, 2025 19:55
@speaker-ender speaker-ender requested review from eastandwestwind and gilluminate and removed request for a team and eastandwestwind October 29, 2025 19:55
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

This PR adds initial support for tracking and displaying error states on staged resources in the data discovery and detection system.

Key Changes:

  • Added errors JSONB column to stagedresource table to store error history
  • Introduced three new error-related DiffStatus values: classification_error, promotion_error, and removal_promotion_error
  • Created TypeScript types (ErrorType, ResourceError) to model error information with message, timestamp, phase, and task_id
  • Refactored action availability logic to use DiffStatus directly instead of ResourceStatusLabel for better type safety
  • Added new "Activity" tab in ResourceDetailsDrawer to display error history with expandable/copyable error messages
  • Defined available actions for error states (classify, promote, promote_removals, mute, assign_categories depending on error type)

Architecture Improvements:

  • Extracted resource details rendering into dedicated ResourceDetailsDrawer component, improving code organization
  • Replaced string-based status mapping with direct DiffStatus-based mapping in DIFF_STATUS_TO_AVAILABLE_ACTIONS for clearer logic
  • Created MonitorResource union type for better type management across components

Confidence Score: 4/5

  • This PR is safe to merge with minor style issues that should be addressed
  • The implementation is architecturally sound with proper database migration, type definitions, and UI components. The changes follow good patterns like extracting the ResourceDetailsDrawer component and improving type safety. However, there are a couple of style-related issues: inline styles are used instead of Tailwind classes in the new component, and there's a typo in a CSS calc expression (missing closing parenthesis). The core logic and error tracking implementation is solid.
  • Pay attention to ResourceDetailsDrawer.tsx which has inline style usage that should be converted to Tailwind classes per project conventions

Important Files Changed

File Analysis

Filename Score Overview
src/fides/api/alembic/migrations/versions/xx_2025_10_29_1640_e4a7f3b9c1d2_add_errors_column_to_staged_resource.py 5/5 Adds nullable JSONB errors column to stagedresource table with empty object default. Migration is straightforward and safe.
src/fides/api/models/detection_discovery/core.py 5/5 Adds errors JSONB column to StagedResource model with nullable=True for backwards compatibility. Minor formatting change to cron_trigger_dict assignment.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/FieldActions.const.tsx 4/5 Refactors to use DiffStatus-based action mapping instead of ResourceStatusLabel. Adds DIFF_STATUS_TO_AVAILABLE_ACTIONS with specific actions for error states. Better type safety achieved.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/ResourceDetailsDrawer.tsx 3/5 New component that extracts resource details rendering into tabbed interface with Details and Activity tabs. Activity tab displays error history with expandable/copyable messages.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx 4/5 Refactors to use ResourceDetailsDrawer component and DIFF_STATUS_TO_AVAILABLE_ACTIONS mapping. Removes large inline drawer content, improving maintainability. Uses DiffStatus directly instead of converting to ResourceStatusLabel.

15 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 39 to 44
tabBarStyle={{
position: "sticky",
top: "calc(0px - var(--ant-padding-lg)",
backgroundColor: palette.FIDESUI_FULL_WHITE,
zIndex: 2,
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Inline style used for positioning and styling

Suggested change
tabBarStyle={{
position: "sticky",
top: "calc(0px - var(--ant-padding-lg)",
backgroundColor: palette.FIDESUI_FULL_WHITE,
zIndex: 2,
}}
tabBarStyle={{
position: "sticky",
top: "calc(0px - var(--ant-padding-lg))",
backgroundColor: palette.FIDESUI_FULL_WHITE,
zIndex: 2,
}}

Copy link
Contributor

Choose a reason for hiding this comment

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

@speaker-ender this is a legit concern

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed

"errors",
postgresql.ARRAY(postgresql.JSONB(astext_type=sa.Text())),
nullable=False,
server_default="{}",
Copy link
Contributor

@thabofletcher thabofletcher Nov 4, 2025

Choose a reason for hiding this comment

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

I am running into an issue but I think it stems from this server_default="{}" is just JSONB not an ARRAY(JSONB) so I was getting a cast exception and the AI wanted to write a whole new migration.

I think the array of errors makes the most sense even for a single field there could be multiple errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for calling this out. this may have technically been fine and just a casting quirk from sqlalchemy, but in any case i think it pointed to a more fundamental problem - these error records likely belong in their own table for proper management. that feels like a far more sustainable design pattern to support over time.

i've updated the db model here accordingly: 50ec391

@adamsachs adamsachs mentioned this pull request Nov 5, 2025
18 tasks
Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

Just the one CSS formatting concern that Greptile found. Otherwise this LGTM

@speaker-ender speaker-ender added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main with commit 02fef2b Nov 5, 2025
74 of 75 checks passed
@speaker-ender speaker-ender deleted the asachs/ENG-1686 branch November 5, 2025 19:02
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.

9 participants