Skip to content

ENG-3015: Add event listener warning on ConnectionConfig.secrets#7736

Merged
JadeCara merged 1 commit intomainfrom
ENG-3015-secrets-event-listener-comment
Mar 24, 2026
Merged

ENG-3015: Add event listener warning on ConnectionConfig.secrets#7736
JadeCara merged 1 commit intomainfrom
ENG-3015-secrets-event-listener-comment

Conversation

@JadeCara
Copy link
Copy Markdown
Contributor

Summary

  • Adds a comment on ConnectionConfig.secrets warning that fidesplus registers SQLAlchemy attribute events on this column for Jira credential auto-sync
  • Future developers should use ORM instance-level updates (not bulk/raw SQL) to ensure events fire

Context

Companion to fidesplus#3252 which adds cross-connection credential sync via SQLAlchemy attribute events. This comment is the cheapest, highest-leverage mitigation against silent sync breakage if someone later adds bulk or raw SQL updates to the secrets column.

Test plan

  • Comment-only change — no functional impact, no tests needed

🤖 Generated with Claude Code

fidesplus registers SQLAlchemy attribute events on this column for
Jira credential auto-sync. This comment warns future developers to
use ORM instance-level updates (not bulk/raw SQL) so events fire.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JadeCara JadeCara requested a review from a team as a code owner March 23, 2026 22:39
@JadeCara JadeCara requested review from adamsachs and removed request for a team March 23, 2026 22:39
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 23, 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 Mar 23, 2026 10:39pm
fides-privacy-center Ignored Ignored Mar 23, 2026 10:39pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR adds a 4-line developer-facing warning comment above the ConnectionConfig.secrets column definition, explaining that fidesplus registers SQLAlchemy attribute events on that column for cross-connection Jira credential sync and that future code should use ORM instance-level updates rather than bulk/raw SQL to ensure those events fire. There are no functional changes.

  • The comment is accurate, concise, and well-placed directly above the relevant column definition.
  • The cross-repo file reference (fidesplus/jira/jira_credential_sync.py) is useful but could become a stale pointer if the file is later moved or renamed in the fidesplus repo — a minor maintenance concern.
  • No test changes are needed as this is a documentation-only change.

Confidence Score: 5/5

  • Safe to merge — comment-only change with no functional impact.
  • No logic, behavior, or schema is modified. The change solely adds a helpful developer warning comment and carries zero risk of regression.
  • No files require special attention.

Important Files Changed

Filename Overview
src/fides/api/models/connectionconfig.py Adds a 4-line developer warning comment above the secrets column noting that fidesplus registers SQLAlchemy attribute events for Jira credential sync and that bulk/raw SQL updates should be avoided. No functional changes.

Reviews (1): Last reviewed commit: "Add event listener warning comment on Co..." | Re-trigger Greptile

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Code Review — ENG-3015

This is a comment-only change (4 lines added, 0 deleted) so no functional or security concerns. The note is well-placed, accurate, and will help prevent a subtle cross-repo breakage.

Overall

The comment is clear and covers the essential points: what is listening, why bulk/raw SQL breaks it, and where to find the fidesplus implementation. Good defensive documentation.

Suggestions

Scope of the warning: The comment mentions Jira SaaS → jira_ticket as the current consumer, but if this event-listener pattern is (or becomes) used for other connection types in fidesplus, that parenthetical could become misleading. Worth considering whether "cross-connection credential sync" alone is sufficient without naming the specific integration — or phrasing it as "currently used for…" to signal it may grow.

MutableDict vs. raw SQL distinction: MutableDict.as_mutable(...) already handles in-place dict mutation tracking at the ORM layer, so the real risk this comment is guarding against is bypassing the ORM entirely (e.g., session.execute(update(...)) or Alembic data migrations). The comment correctly says "bulk/raw SQL updates", but calling out "Alembic data migrations" explicitly might make it even clearer for the developer most likely to trip over this.

Nice to Have

The fidesplus path (fidesplus/jira/jira_credential_sync.py) won't be navigable from this repo. Adding a one-line note that the referenced file lives in the fidesplus repo (not this one) would save a future developer a few minutes of searching.

Summary

No issues that block merge. The comment is the right mitigation for protecting a non-obvious cross-repo invariant. The suggestions above are optional polish.

Copy link
Copy Markdown
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.

thank you for this!

@JadeCara JadeCara added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit dd4a903 Mar 24, 2026
57 of 58 checks passed
@JadeCara JadeCara deleted the ENG-3015-secrets-event-listener-comment branch March 24, 2026 00:12
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.

2 participants