Skip to content

Conversation

@vcruces
Copy link
Contributor

@vcruces vcruces commented Dec 18, 2025

Ticket ENG-2239

⚠️ Depends on https://github.com/ethyca/fidesplus/pull/2940

Description Of Changes

This PR renames the staged resource diff status from 'approved' to 'reviewed' in the database. The change includes a data migration that updates all existing records in the stagedresource table.

Code Changes

  • Added database migration xx_2025_12_18_2048_dffb9da00fb1_rename_staged_resource_diff_status_from_.py
  • Migration updates all diff_status values from 'approved' to 'reviewed' in the stagedresource table
  • Includes logging to show how many records were updated during migration
  • Reversible migration with proper downgrade function

Steps to Confirm

  1. Run the migration: alembic upgrade head
  2. Verify migration logs show the count of updated records
  3. Check that any existing staged resources with diff_status = 'approved' are now diff_status = 'reviewed'
  4. Test downgrade migration: alembic downgrade -1
  5. Verify records are reverted back to 'approved' status

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 Dec 18, 2025

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

Project Deployment Review Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Dec 19, 2025 4:46pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
fides-privacy-center Ignored Ignored Dec 19, 2025 4:46pm

@vcruces vcruces changed the title ENG-2239 - Rename StagedResource diff status from approved to reviewed ENG-2239 - Migration to rename StagedResource diff status from approved to reviewed Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.17%. Comparing base (902f86b) to head (586b624).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7159   +/-   ##
=======================================
  Coverage   87.17%   87.17%           
=======================================
  Files         534      534           
  Lines       35312    35312           
  Branches     4113     4113           
=======================================
  Hits        30783    30783           
  Misses       3638     3638           
  Partials      891      891           

☔ 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.

@vcruces vcruces added the do not merge Please don't merge yet, bad things will happen if you do label Dec 18, 2025
@vcruces
Copy link
Contributor Author

vcruces commented Dec 18, 2025

@greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 18, 2025

Greptile Summary

This PR systematically renames the staged resource diff status from 'approved' to 'reviewed' across the entire codebase, including database schema, backend types, frontend types, UI components, and API endpoints.

Key Changes:

  • Database migration updates all existing stagedresource records from 'approved' to 'reviewed' status with proper logging
  • Frontend DiffStatus enum updated from APPROVED = "approved" to REVIEWED = "reviewed"
  • API endpoint renamed from /approve to /review with corresponding mutation name change
  • All UI labels, constants, action mappings, and filter logic updated consistently
  • Type definitions updated in DatastoreMonitorUpdates and FieldActionType
  • Mock data and test fixtures updated to reflect new terminology

Implementation Quality:

  • Migration is fully reversible with proper downgrade function
  • Uses loguru.logger for migration logging (addressing previous feedback)
  • Comprehensive changes across 20 files ensure consistency
  • No remnants of 'approved' terminology found in changed files
  • CHANGELOG properly documented with db-migration label

Note: PR description indicates this depends on fidesplus#2940 and should NOT be merged until that dependency is resolved.

Confidence Score: 5/5

  • This PR is safe to merge once the fidesplus dependency is resolved - it's a clean, comprehensive rename with no logical issues
  • The refactoring is thorough and consistent across all layers (database, backend, frontend). The migration is properly implemented with reversibility, all references are updated systematically, and the changes are purely renaming without introducing new logic or behavioral changes
  • No files require special attention - all changes are consistent and well-executed

Important Files Changed

Filename Overview
src/fides/api/alembic/migrations/versions/xx_2025_12_18_2048_dffb9da00fb1_rename_staged_resource_diff_status_from_.py Database migration properly renames 'approved' to 'reviewed' status with correct logging and reversible downgrade
clients/admin-ui/src/types/api/models/DiffStatus.ts Enum updated from APPROVED to REVIEWED, properly synchronized with backend
clients/admin-ui/src/features/data-catalog/utils.ts CatalogResourceStatus enum and logic updated to use REVIEWED status
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/FieldActions.const.tsx All action constants and mappings updated from 'approved' to 'reviewed' including labels, drawer actions, and allowed statuses
clients/admin-ui/src/features/data-discovery-and-detection/discovery-detection.slice.ts API mutation renamed from approveStagedResources to reviewStagedResources with updated endpoint URL
clients/admin-ui/src/types/api/models/DatastoreMonitorUpdates.ts Type definition updated from 'approved' to 'reviewed' field

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.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@vcruces
Copy link
Contributor Author

vcruces commented Dec 19, 2025

@greptile

@vcruces vcruces marked this pull request as ready for review December 19, 2025 13:31
@vcruces vcruces requested a review from a team as a code owner December 19, 2025 13:31
@vcruces vcruces requested review from adamsachs and removed request for a team December 19, 2025 13:31
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.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@vcruces vcruces marked this pull request as draft December 19, 2025 13:37
@vcruces vcruces marked this pull request as ready for review December 19, 2025 13:40
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.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@vcruces
Copy link
Contributor Author

vcruces commented Dec 19, 2025

@greptile

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

BE migration looks solid 👍

@vcruces vcruces removed the do not merge Please don't merge yet, bad things will happen if you do label Dec 19, 2025
@vcruces vcruces added this pull request to the merge queue Dec 19, 2025
Merged via the queue into main with commit 71648eb Dec 19, 2025
76 of 77 checks passed
@vcruces vcruces deleted the ENG-2239 branch December 19, 2025 21:31
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.

4 participants