Skip to content

ENG-2347: Add privacy assessment configuration model and Admin UI#7470

Merged
thabofletcher merged 37 commits intomainfrom
ENG-2347-assessment-config-ui
Feb 26, 2026
Merged

ENG-2347: Add privacy assessment configuration model and Admin UI#7470
thabofletcher merged 37 commits intomainfrom
ENG-2347-assessment-config-ui

Conversation

@thabofletcher
Copy link
Contributor

@thabofletcher thabofletcher commented Feb 24, 2026

Ticket ENG-2347

Description Of Changes

Add backend model and Admin UI for configuring privacy assessment settings. This allows administrators to:

  • Configure LLM model overrides for assessments and chat
  • Set up automatic re-assessment scheduling (with preset or custom cron expressions)
  • Select Slack channel for questionnaire notifications

Backend:

  • New PrivacyAssessmentConfig SQLAlchemy model (single-row table per tenant)
  • Alembic migration to create the table
  • Helper methods get_assessment_model() and get_chat_model() with fallback to defaults

Frontend:

  • New AssessmentSettingsModal component accessible via settings button on Privacy Assessments page
  • LLM model override inputs with placeholder showing defaults
  • Schedule picker with preset options (Daily/Weekly/Monthly/Yearly) and custom cron support
  • Slack channel selector with test functionality

Note: This PR provides the model and UI. The API endpoints are in the corresponding fidesplus PR.

Code Changes

  • src/fides/api/models/privacy_assessment_config.py - New SQLAlchemy model with helper methods for getting effective models
  • src/fides/api/alembic/migrations/versions/xx_2026_02_23_1400_074796d61d8a_add_privacy_assessment_config.py - Migration to create table
  • src/fides/api/db/base.py - Register new model
  • clients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx - Settings modal component
  • clients/admin-ui/src/features/privacy-assessments/privacy-assessments.slice.ts - RTK Query endpoints for config API
  • clients/admin-ui/src/features/privacy-assessments/types.ts - TypeScript types for config
  • clients/admin-ui/src/features/chat-provider/chatProvider.slice.ts - Add getChatChannels query
  • clients/admin-ui/src/pages/privacy-assessments/index.tsx - Add settings button to page header

Steps to Confirm

  1. Run the migration:

    alembic upgrade head
  2. Verify table created:

    SELECT * FROM privacy_assessment_config;
  3. In Admin UI, navigate to Privacy Assessments page and click the settings (gear) icon

  4. Verify the modal opens with:

    • LLM Model Configuration section with assessment and chat model inputs
    • Automatic Re-assessment section with enable toggle and schedule picker
    • Slack Notifications section with channel selector

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
    • 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

thabofletcher and others added 10 commits February 23, 2026 14:20
Add a settings modal for privacy assessments with:
- Two LLM model override fields (assessment and chat models)
- Re-assessment scheduling with preset and custom cron options
- Slack channel selection for questionnaire notifications
- Test connection button for Slack channel verification

Backend changes:
- New PrivacyAssessmentConfig model and migration
- Register model in db/base.py for Alembic

Frontend changes:
- AssessmentSettingsModal component with Ant Design components
- API slice endpoints for config CRUD and Slack testing
- Settings gear icon in PageHeader on privacy-assessments page
- Chat channels endpoint for Slack channel dropdown

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update path from "Settings > Chat Providers" to "Settings > Notifications > Chat providers"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the gear icon button after the "Evaluate assessments" button

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add "Yearly (Jan 1st)" option with cron expression "0 9 1 1 *"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use Form.useWatch for slack_channel_id so the button's disabled state
updates reactively when a channel is selected from the dropdown.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add onDropdownVisibleChange handler to refetch channels from Slack
each time the dropdown is opened, ensuring the list stays current.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add refetch of config when modal opens to get latest data
- Reset form fields when modal opens to clear stale state
- Change default assessment model from claude-sonnet-4 to claude-opus-4
- Update fallback placeholder to match new default

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove form.resetFields() call that was clearing the form before
config data could be loaded. Use formInitialized state to track
whether the form has been populated for this modal session.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ensures form is properly destroyed when modal closes, preventing
any stale state from persisting between opens.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Re-add refetchConfig() call when modal opens to ensure we get
the latest data from the server instead of stale cached data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Feb 24, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Feb 26, 2026 5:35pm
fides-privacy-center Ignored Ignored Feb 26, 2026 5:35pm

Request Review

thabofletcher and others added 3 commits February 23, 2026 18:50
- Add cron expression validation to AssessmentSettingsModal using
  existing parseCronExpression utility from cronHelpers.ts
- Add component tests for cron validation and frequency preset handling
- Add model tests for get_assessment_model and get_chat_model methods
  to cover branching logic (None config, empty override, custom override)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove complex form validation tests that rely on antd's async
validation behavior. Keep frequency preset handling tests and
parseCronExpression validation tests which test the core logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thabofletcher thabofletcher marked this pull request as ready for review February 24, 2026 06:38
@thabofletcher thabofletcher requested review from a team as code owners February 24, 2026 06:38
@thabofletcher thabofletcher requested review from erosselli, galvana, jpople and lucanovera and removed request for a team, erosselli and jpople February 24, 2026 06:38
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Adds a new PrivacyAssessmentConfig model and Admin UI settings modal for configuring privacy assessment settings. The implementation includes backend SQLAlchemy model, Alembic migration, comprehensive tests, and a frontend modal with LLM model overrides, automatic re-assessment scheduling (with preset and custom cron support), and Slack channel selection.

Key changes:

  • Backend model with helper methods get_assessment_model() and get_chat_model() that fallback to defaults
  • Migration creates single-row configuration table per tenant
  • Frontend modal with form validation including cron expression validation
  • RTK Query endpoints with proper tag invalidation for cache management
  • Test coverage for model methods including edge cases (None config, empty strings)

Issues found:

  • Boolean server_default format inconsistency: uses "false" instead of project standard "f" in both model and migration
  • Frontend component uses div elements instead of semantic HTML or Flex components in three sections

Confidence Score: 4/5

  • Safe to merge with minor style/convention fixes needed
  • Implementation is solid with good test coverage and follows architectural patterns. The issues are minor formatting/convention violations that don't affect functionality but should be corrected for consistency.
  • Migration file and model need server_default format correction before deployment to maintain database consistency

Important Files Changed

Filename Overview
src/fides/api/models/privacy_assessment_config.py New model for privacy assessment configuration with LLM settings, re-assessment scheduling, and Slack integration. Has minor issue with server_default format.
src/fides/api/alembic/migrations/versions/xx_2026_02_23_1400_074796d61d8a_add_privacy_assessment_config.py Migration creating privacy_assessment_config table. Uses incorrect boolean server_default format ("false" instead of "f").
tests/api/models/test_privacy_assessment_config.py Comprehensive tests for model helper methods covering None config, empty overrides, and custom model scenarios.
clients/admin-ui/src/features/privacy-assessments/AssessmentSettingsModal.tsx Settings modal with LLM config, scheduling, and Slack channel selection. Uses div elements instead of semantic components.
clients/admin-ui/src/features/privacy-assessments/privacy-assessments.slice.ts RTK Query endpoints for assessment config CRUD operations with proper tag invalidation.

Last reviewed commit: 0fe2e91

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.

14 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

thabofletcher and others added 2 commits February 25, 2026 08:32
Update down_revision from d3f08ca31314 to c69ef1fecb20 to fix
migration chain after c69ef1fecb20 (jira_ticket_task) was added.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

The new settings modal works well and the code looks good. I will just make some styling updates to make the modal content fit without scrolling.

lucanovera and others added 3 commits February 26, 2026 12:49
Resolved conflict in .fides/db_dataset.yml to include both:
- privacy_assessment_config table from this branch
- privacy_assessment_task_id field and privacy_assessment_task table from main

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
thabofletcher and others added 4 commits February 26, 2026 08:40
Update downrev from c69ef1fecb20 to 12c3de065e27 (add_assessment_task)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Nice work! The modal works great. Adding an endpoint to fetch the default modals was a nice touch. The frequency picker with common options + custom cron looks great.
I've taken the liberty of styling the modal to shorter, adjusted the warning, added error handling and refactored the initialization of the form.

@thabofletcher
Copy link
Contributor Author

Nice work! The modal works great. Adding an endpoint to fetch the default modals was a nice touch. The frequency picker with common options + custom cron looks great. I've taken the liberty of styling the modal to shorter, adjusted the warning, added error handling and refactored the initialization of the form.

Thank you so much for the extra help!

Update downrev from 12c3de065e27 to d83a1f2b7e4c
(migrate_system_id_fk_to_link_table - the actual head of main)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thabofletcher thabofletcher added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 10be505 Feb 26, 2026
59 of 60 checks passed
@thabofletcher thabofletcher deleted the ENG-2347-assessment-config-ui branch February 26, 2026 19:51
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.

3 participants