-
Notifications
You must be signed in to change notification settings - Fork 84
feat: initial support for staged resource error state [ENG-1686, ENG-1802] #6867
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
d709a20 to
1b43675
Compare
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 adds initial support for tracking and displaying error states on staged resources in the data discovery and detection system.
Key Changes:
- Added
errorsJSONB column tostagedresourcetable to store error history - Introduced three new error-related
DiffStatusvalues:classification_error,promotion_error, andremoval_promotion_error - Created TypeScript types (
ErrorType,ResourceError) to model error information with message, timestamp, phase, and task_id - Refactored action availability logic to use
DiffStatusdirectly instead ofResourceStatusLabelfor 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
ResourceDetailsDrawercomponent, improving code organization - Replaced string-based status mapping with direct
DiffStatus-based mapping inDIFF_STATUS_TO_AVAILABLE_ACTIONSfor clearer logic - Created
MonitorResourceunion 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
| tabBarStyle={{ | ||
| position: "sticky", | ||
| top: "calc(0px - var(--ant-padding-lg)", | ||
| backgroundColor: palette.FIDESUI_FULL_WHITE, | ||
| zIndex: 2, | ||
| }} |
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.
syntax: Inline style used for positioning and styling
| 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, | |
| }} |
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.
@speaker-ender this is a legit concern
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.
addressed
...-ui/src/features/data-discovery-and-detection/action-center/fields/ResourceDetailsDrawer.tsx
Show resolved
Hide resolved
| "errors", | ||
| postgresql.ARRAY(postgresql.JSONB(astext_type=sa.Text())), | ||
| nullable=False, | ||
| server_default="{}", |
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.
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?
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.
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
...-ui/src/features/data-discovery-and-detection/action-center/fields/ResourceDetailsDrawer.tsx
Show resolved
Hide resolved
gilluminate
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.
Just the one CSS formatting concern that Greptile found. Otherwise this LGTM
Ticket [ENG-1686, ENG-1802]
Done alongside https://github.com/ethyca/fidesplus/pull/2699
Description Of Changes
Backend
errorsin aStagedResourceErrortable, associated withStagedResourcesFrontend
Activitytab in the details tray for a field that includes error information about a particular fieldCode Changes
StagedResourceErrortable 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

Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works