ENG-2764: Add context_snapshot and last_evaluated_at to privacy_assessment#7530
Merged
ENG-2764: Add context_snapshot and last_evaluated_at to privacy_assessment#7530
Conversation
…sment Add data model foundation for scheduled re-evaluation of privacy assessments. New JSONB column stores a snapshot of the privacy context and template state at generation time, enabling material change detection on subsequent re-evaluations. New EventAuditType values support auditing re-evaluation outcomes. Made-with: Cursor
Contributor
|
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>
Contributor
Greptile SummaryThis PR adds data model foundations for scheduled re-evaluation of privacy assessments: a
Confidence Score: 2/5
Important Files Changed
Last reviewed commit: 2e7223d |
...ic/migrations/versions/xx_2026_02_28_1200_190e4603ad38_add_context_snapshot_to_assessment.py
Outdated
Show resolved
Hide resolved
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thabofletcher
approved these changes
Mar 20, 2026
Contributor
thabofletcher
left a comment
There was a problem hiding this comment.
Approved - will send over a review doc with some minor recommendations and the tests that were run. There is probably a new downrev needed as well
… changelog Fix migration down_revision from ea20059aee77 to 38071fffda39 (current main head). Remove server_default and make high_risk_only nullable so callers must explicitly pass the value. Add high_risk_only to changelog description for completeness. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use a clear boolean with server_default="false" instead of nullable. Default false means all assessments are evaluated unless the caller explicitly opts into high-risk-only filtering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-2764
Description Of Changes
Add data model foundation for scheduled re-evaluation of privacy assessments. This is PR 1 of 3 for ENG-2764.
context_snapshot(JSONB) column onprivacy_assessmentto store a snapshot of the privacy context and template question state at generation time, enabling material change detection during re-evaluationlast_evaluated_at(DateTime) column to track when the assessment was last evaluatedEventAuditTypeenum values:privacy_assessment_re_evaluatedandprivacy_assessment_re_evaluated_unchangedfor auditing re-evaluation outcomesCode Changes
src/fides/api/alembic/migrations/versions/xx_2026_02_28_1200_190e4603ad38_add_context_snapshot_to_assessment.py- New Alembic migration addingcontext_snapshotandlast_evaluated_atcolumnssrc/fides/api/models/privacy_assessment.py- Add new columns toPrivacyAssessmentmodelsrc/fides/api/models/event_audit.py- Addprivacy_assessment_re_evaluatedandprivacy_assessment_re_evaluated_unchangedenum valuesSteps to Confirm
alembic upgrade headprivacy_assessmenttable has the newcontext_snapshot(JSONB, nullable) andlast_evaluated_at(DateTime, nullable) columnsPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and worksMade with Cursor