-
Notifications
You must be signed in to change notification settings - Fork 72
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
add System.vendor_deleted_date
db model field; switch DB engines to use custom JSON serialization to handle non-standard data types
#4818
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
fb0d8b5
to
710063a
Compare
Passing run #7629 ↗︎
Details:
Review all test suite changes for PR #4818 ↗︎ |
This reverts commit 9247189.
…ization edge cases
091c69d
to
ac6474e
Compare
ok @pattisdr i think the update to use the custom encoder at the DB engine level is looking good, per our discussion yesterday! (tests seem to be passing). would like to get your eyes/thoughts on this before moving on further though! |
Looking @adamsachs! |
lots of failing DSR 3.0 tests 😬 |
whoops, the tests i ran locally were far too narrow :( i'll take a closer look, sorry for asking prematurely! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4818 +/- ##
=======================================
Coverage 86.78% 86.79%
=======================================
Files 346 347 +1
Lines 20919 20932 +13
Branches 2734 2734
=======================================
+ Hits 18154 18167 +13
Misses 2289 2289
Partials 476 476 ☔ View full report in Codecov by Sentry. |
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.
good work @adamsachs 👍 thanks for going the extra mile and getting this custom json serialization and deserialization working more broadly. I'd add this more recent change to the PR description too. I also forgot we were overriding JSON de/serialization in our JSONTypeOverride. nice tracking this down.
src/fides/api/alembic/migrations/versions/93af4df40cc0_adds_webhook_id_column_to_auditlog.py
Show resolved
Hide resolved
System.vendor_deleted_date
db model fieldSystem.vendor_deleted_date
db model field; switch DB engines to use custom JSON serialization to handle non-standard data types
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.
some self-review on my minor FE updates that i'm very unsure about!
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.
The Admin UI types/code changes are pretty solid. I didn't UAT the UI though so you should just grab a quick screenshot and get some eyes from @Kelsey-Ethyca or otherwise to see, since that System form is already pretty monstrous
name="vendor_deleted_date" | ||
id="vendor_deleted_date" | ||
// disable this field for editing: | ||
// deleted date is populated by the GVL and should not be editable by users |
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.
// deleted date is populated by the GVL and should not be editable by users | |
// deleted date is populated by Compass and should not be editable by users |
super nitpicky but this isn't GVL specific
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.
hmm, but isn't it GVL specific? that date is coming from the GVL, through compass...
i don't mind making the change here if you think it's more appropriate but my word choice here was somewhat deliberate!
/** | ||
* The deleted date of the vendor that's associated with this system. | ||
*/ | ||
vendor_deleted_date?: string; |
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.
side q: the vendor_deleted_date
will always be in the response, right? It'll just be null
by default?
(this aspect of the autogenerated types bugs me)
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.
ah yeah that's correct. idk the best way to handle that in typescript, let me know if this is something you think is necessary to adjust
for UAT purposes, here are some screenshots of the new field on my local:
|
merging, discussed with @Kelsey-Ethyca that she will UAT once it's on |
Closes PROD-1979
Description Of Changes
Adds in DB model support for a new
vendor_deleted_date
field on theSystem
model, added in corresponding fideslang model as a potential means of supporting the GVL vendor deleted date field.As a side effect of this change, a new date field is now needs to be stored in a
JSONB
field (in theSystemHistory
table), we needed to ensure that those fields were being properly encoded (serialized) as JSON to store in the DB. Instead of special-casing this particular field, we decided to update our SQLAlchemy DB engines more broadly to use json (de)serializer functions that leverage ourCustomJSONEncoder
that handlesdatetime
s and a few other data types that cannot be serialized to JSON viajson.dumps()
.Corresponding upstream PRs (should be merged first):
System.vendor_deleted_date
property fideslang#10Corresponding downstream PR:
Code Changes
CustomJSONEncoder
for JSON (de)serializationCustomJSONEncoder
for DB fields to leverage the now generic/automatic handling via the DB engineStill TODO:
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md