| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Exposes index / show / delete for functions at /api/functions. Fills a gap that forced operators into either the LiveView UI or direct DB access to clean up orphaned transforms/enrichments — config apply is upsert-only and never removes them. - Extends Consumers.find_function/2 with :id_or_name lookup, matching how other resources accept either a UUID or a human name. - Controller mirrors HttpEndpointController conventions; JSON view reuses Sequin.Transforms.to_external/1. - Delete preserves the existing foreign-key guards on sink_consumers.function_id and sink_consumers.routing_id, so sinks still pin their functions. Create/update are deliberately out of scope — those remain owned by sequin config apply / the web UI, where validation is centralized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Summary
Adds REST management API endpoints for functions:
Why
Today sequin config apply upserts functions but never removes them (see the comment at upsert_functions/2 — omitting a function from YAML does not delete it). The only way to delete a function is the LiveView UI. That makes automated lifecycle management (e.g. cleaning up orphaned functions after rename/recolor deploys, or from orchestrator tools) impossible via the management API.
This PR fills that gap with the read + delete half of the CRUD surface. Create/update are intentionally not included — they remain owned by config apply and the LiveView UI, where validation and complex function-type handling already live. Opening that up later is a separate conversation; the read + delete endpoints are the minimum useful surface and composed cleanly on top of existing Consumers functions.
Implementation notes
Tests
Controller tests cover:
Related context
Our team runs a red-black orchestrator on top of Sequin (sequin-red-black) that creates colored variants of functions (<pipeline>_<color>-transform) per deploy. After activating a new color and dropping the old, the old functions become orphans that only the UI can delete. This endpoint is the primary piece we need for end-to-end cleanup automation.
Happy to adjust scope / naming / placement per maintainer preference.