Skip to content

add linked systems to connection config get#7458

Merged
adamsachs merged 60 commits intomainfrom
asachs/add-systems-connection-endpoint
Feb 26, 2026
Merged

add linked systems to connection config get#7458
adamsachs merged 60 commits intomainfrom
asachs/add-systems-connection-endpoint

Conversation

@adamsachs
Copy link
Copy Markdown
Contributor

@adamsachs adamsachs commented Feb 23, 2026

Ticket ENG-2590

Based off #7432

Description Of Changes

Adds a linked_systems field to the connection config GET endpoints (both list and detail), exposing which system(s) are linked to each connection config. This is part of the broader system-integration link effort.

Code Changes

Schema (connection_config.py):

  • Added LinkedSystemInfo schema with fides_key and name
  • Added linked_systems: List[LinkedSystemInfo] field to ConnectionConfigurationResponse
  • Uses an excluded system field + @model_validator(mode="after") to populate linked_systems from the ORM .system relationship during serialization -- no changes to the core ConnectionConfig model
  • Changed ConnectionConfigurationResponseWithSystemKey to inherit from ConnectionConfigurationResponse (instead of ResponseBase), so the detail endpoint also returns linked_systems

Route (connection_endpoints.py):

  • Added selectinload(ConnectionConfig.system) to the list endpoint query to avoid N+1 queries. Scoped to this endpoint only -- the detail endpoint uses standard lazy loading (single object)

Design docs: Updated section 2.4 of the technical design doc with implementation details and response example

Tests: Updated key assertions in existing tests and added new tests verifying linked_systems is empty for unlinked configs and correctly populated for linked configs (both list and detail endpoints)

Steps to Confirm

  1. GET /api/v1/connection -- each item should include linked_systems: [] or linked_systems: [{fides_key: "...", name: "..."}]
  2. GET /api/v1/connection/{key} -- should include linked_systems alongside the existing system_key
  3. Endpoints that embed ConnectionConfigurationResponse (e.g. webhook responses) also include linked_systems

Confirmed this is populating in our new UI column (Linked system) as expected:
image

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Updates unreleased work already in Changelog, no new entry necessary
  • Confirmed working in UI with updated FE
  • Followup issues:
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

@adamsachs adamsachs marked this pull request as ready for review February 25, 2026 22:08
@adamsachs adamsachs requested a review from a team as a code owner February 25, 2026 22:08
@adamsachs adamsachs requested review from galvana and removed request for a team February 25, 2026 22:08
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR adds a linked_systems field to connection config GET endpoints, exposing which system(s) are linked to each connection config. The implementation properly uses eager loading (selectinload) for list endpoints to avoid N+1 queries, while the detail endpoint appropriately uses lazy loading for the single-object case.

Key changes:

  • Added LinkedSystemInfo schema with fides_key and name fields
  • Extended ConnectionConfigurationResponse with linked_systems: List[LinkedSystemInfo]
  • Implemented _enrich_linked_systems helper to populate the field from ORM relationships
  • Added proper eager loading with selectinload(ConnectionConfig.system) in list endpoints
  • Updated tests to verify both empty and populated linked_systems scenarios
  • Updated documentation with implementation details and response examples

Minor issue:

  • Code duplication between connection_endpoints.py and system.py in the _with_linked_systems transformer function (see inline comment)

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The implementation is solid with proper eager loading to prevent N+1 queries, comprehensive test coverage for both empty and populated scenarios, and good documentation. The only issue is minor code duplication in the transformer function that could be refactored for better maintainability, but this doesn't affect functionality or safety.
  • Pay attention to src/fides/api/api/v1/endpoints/system.py which has duplicated enrichment logic

Important Files Changed

Filename Overview
src/fides/api/schemas/connection_configuration/connection_config.py Added LinkedSystemInfo schema and linked_systems field to response schemas. Clean implementation following existing patterns.
src/fides/api/api/v1/endpoints/connection_endpoints.py Added _enrich_linked_systems helper and transformer for list endpoint with proper eager loading. Detail endpoint uses lazy loading appropriately.
src/fides/api/api/v1/endpoints/system.py Added linked systems support to system connections endpoint. Duplicates enrichment logic instead of reusing helper function.

Last reviewed commit: 990f8c0

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

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Base automatically changed from asachs/ENG-2590 to main February 25, 2026 22:29
@github-actions github-actions bot requested review from a team as code owners February 25, 2026 22:29
@github-actions github-actions bot requested review from jpople and removed request for a team February 25, 2026 22:29
@adamsachs adamsachs enabled auto-merge February 26, 2026 04:52
@adamsachs adamsachs added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 186845f Feb 26, 2026
54 of 55 checks passed
@adamsachs adamsachs deleted the asachs/add-systems-connection-endpoint branch February 26, 2026 05:22
adamsachs added a commit that referenced this pull request Feb 27, 2026
- Time DB query separately from serialization in the transformer
- Add GET /connection_legacy that replicates pre-#7458 behavior
  (no selectinload, no transformer, no from_connection_config)
  for direct A/B perf comparison on deployed environments

Made-with: Cursor
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