Skip to content

Custom template deletion endpoint#7320

Merged
Linker44 merged 9 commits intomainfrom
ENG-565-custom-template-deletion-endpoint
Feb 7, 2026
Merged

Custom template deletion endpoint#7320
Linker44 merged 9 commits intomainfrom
ENG-565-custom-template-deletion-endpoint

Conversation

@Linker44
Copy link
Copy Markdown
Contributor

@Linker44 Linker44 commented Feb 5, 2026

Ticket Ticket ENG-565

Description Of Changes

Added endpoint for deleting custom templates if they have a fides provided template to fall back to.
Added fallback logic.

Code Changes

  • new delete custom template endpoint

Steps to Confirm

  1. upload a custom integration
  2. set up a connection using it.
  3. use the delete custom template endpoint.
  4. verify the config and dataset reverted back to the original template.

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 (i.e. potential for performance impact or unexpected regression) that should be flagged
    • 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

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 5, 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 6, 2026 10:04pm
fides-privacy-center Ignored Ignored Feb 6, 2026 10:04pm

Request Review

@Linker44 Linker44 changed the base branch from ENG-565-update-custom-templates-without-restart to ENG-565-remove-replaceable-flag February 5, 2026 18:26
@Linker44 Linker44 changed the title Eng 565 custom template deletion endpoint Custom template deletion endpoint Feb 5, 2026
@Linker44 Linker44 self-assigned this Feb 5, 2026
@Linker44 Linker44 marked this pull request as ready for review February 5, 2026 19:31
@Linker44 Linker44 requested a review from a team as a code owner February 5, 2026 19:31
@Linker44 Linker44 requested review from erosselli and removed request for a team February 5, 2026 19:31
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

Added a new DELETE endpoint for removing custom connector templates with automatic fallback to Fides-provided templates. The endpoint validates that a custom template exists and has a default fallback before deletion, then updates all existing connection configs to use the Fides-provided template.

Key changes:

  • New DELETE /connector-templates/{connector_template_type} endpoint with proper validation and authorization
  • Service layer methods delete_datasets_for_connector_type() and update_existing_connection_configs_for_connector_type() to handle the migration
  • Refactored monitored endpoints preservation logic to run earlier in the dataset upsert flow, fixing a bug where monitored collections weren't preserved when no customer dataset existed
  • Comprehensive test coverage including integration tests

Issues found:

  • Broad exception handler at connector_template_endpoints.py:300-307 catches HTTPExceptions from service methods and converts them to 500 errors
  • Helper function _delete_custom_template() contains significant business logic that should be in the service layer per architectural guidelines
  • Manual test cleanup code that's unnecessary since the database auto-clears between tests

Confidence Score: 4/5

  • This PR is safe to merge with minor architectural improvements needed
  • The implementation is functionally sound with good test coverage and proper validation. One critical issue exists with the broad exception handler that could mask errors. The code would benefit from better separation of concerns (moving business logic to service layer), but these are non-blocking improvements.
  • connector_template_endpoints.py needs the exception handling fix at line 300

Important Files Changed

Filename Overview
src/fides/api/api/v1/endpoints/connector_template_endpoints.py Added delete endpoint for custom templates with validation and fallback logic to Fides-provided templates
src/fides/service/connection/connection_service.py Added methods to delete datasets and update connection configs; moved monitored endpoints logic earlier in upsert flow
tests/ops/api/v1/endpoints/test_connector_template_endpoints.py Added comprehensive test suite for delete custom connector template endpoint with integration test

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.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

This one looks good, just make the changes in the base branch and we should be good to go

Base automatically changed from ENG-565-remove-replaceable-flag to main February 6, 2026 21:40
@Linker44 Linker44 force-pushed the ENG-565-custom-template-deletion-endpoint branch from 27ac41c to 7f6443b Compare February 6, 2026 22:01
@Linker44 Linker44 added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 5190a9d Feb 7, 2026
54 of 55 checks passed
@Linker44 Linker44 deleted the ENG-565-custom-template-deletion-endpoint branch February 7, 2026 00:47
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