ENG-3118: Add user_assigned_description column to StagedResource#7847
ENG-3118: Add user_assigned_description column to StagedResource#7847dsill-ethyca merged 8 commits intomainfrom
Conversation
Adds a nullable `user_assigned_description` column to the `stagedresource` table. This enables the frontend to distinguish system-generated descriptions (show sparkle) from user-edited descriptions (no sparkle) for IDP monitor resources, following the same pattern as `user_assigned_data_uses`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes fides_db_scan CI failure — new column must be registered in the dataset file for the DB scan to pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…label - Remove redundant `default=None` from column definition to match `user_assigned_system_id` pattern - Add `db-migration` label to changelog entry Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
Clean, minimal PR that does exactly what it says. The migration chain is valid, the column definition is consistent with how other user_assigned_* fields are modelled, and the changelog entry correctly carries the db-migration label.
One suggestion worth considering:
The user_assigned_data_uses column has a prose comment explaining its nullable semantics (see lines 581–584 of core.py). This user_assigned_description column carries the same kind of meaningful nullable contract (NULL = system-generated, non-null = user override), so a matching comment would improve long-term maintainability. See the inline note on core.py.
Everything else looks good:
down_revisioncorrectly targetsd4e5f6a7b8c9(the password-reset-flow migration, the current head onmain)downgrade()is correct — mirrors theupgrade()exactlydb_dataset.ymlupdated to include the new column- No schema/API layer changes are expected in this PR per the description; those follow in the dependent fidesplus PR
No blockers — happy to approve once the comment thread is addressed (or acknowledged as intentionally omitted).
| default=None, | ||
| ) | ||
| user_assigned_system_id = Column(String, nullable=True, index=True) | ||
| user_assigned_description = Column(String, nullable=True) |
There was a problem hiding this comment.
Consider adding an explanatory comment matching the pattern established by user_assigned_data_uses above. Since the nullable semantics here carry meaningful business logic (NULL = system-generated description, non-null = user override), a comment would help future readers:
# This field is intentionally nullable to distinguish system-generated descriptions
# (value is None) from user-edited descriptions (non-null value). This enables the
# frontend to show a sparkle icon only for system-generated descriptions.
user_assigned_description = Column(String, nullable=True)Also a minor nit: the sibling columns user_assigned_data_uses uses default=None explicitly. If you want consistency, you could add default=None here too — though it's not a correctness issue since SQLAlchemy implicitly treats nullable columns as None.
There was a problem hiding this comment.
Added the explanatory comment. Intentionally omitted default=None as it's redundant for nullable String columns — user_assigned_data_uses includes it because of ARRAY-specific empty-vs-null semantics that don't apply here.
| from alembic import op | ||
|
|
||
| revision = "6a42f48c23dd" | ||
| down_revision = "d4e5f6a7b8c9" |
There was a problem hiding this comment.
Confirmed: d4e5f6a7b8c9 is the revision ID of xx_2026_04_03_1000_d4e5f6a7b8c9_add_password_reset_flow.py, so the migration chain is correct. The checklist item ✅ holds.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7847 +/- ##
=======================================
Coverage 85.06% 85.07%
=======================================
Files 627 627
Lines 40765 40766 +1
Branches 4740 4740
=======================================
+ Hits 34678 34680 +2
+ Misses 5018 5017 -1
Partials 1069 1069 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Addresses PR review feedback — documents the NULL vs non-null contract matching the pattern established by user_assigned_data_uses. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update down_revision from d4e5f6a7b8c9 to 22cf8ccaec40 (cloud_infra migration merged to main), resolving the multiple-heads conflict. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ticket ENG-3118
Description Of Changes
Adds a nullable
user_assigned_descriptioncolumn to thestagedresourcetable. This enables the frontend to distinguish system-generated descriptions (show sparkle icon) from user-edited descriptions (no sparkle) for IDP monitor resources.Follows the same pattern as
user_assigned_data_uses— nullable column whereNULLmeans system-generated and non-null means user override.Code Changes
user_assigned_descriptioncolumn toStagedResourceDB model (core.py)6a42f48c23ddto create the columnSteps to Confirm
alembic upgrade head— verifyuser_assigned_descriptioncolumn exists onstagedresourcetablealembic downgrade -1— verify column is dropped cleanlyalembic headsreturns a single headPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works