Skip to content

feat(projects): delete Openship-managed DNS records on project delete - #1887

Open
Raphael-Penning wants to merge 1 commit into
oblien:mainfrom
Raphael-Penning:feat/project-delete-dns-records-1886
Open

Raphael-Penning wants to merge 1 commit into
oblien:mainfrom
Raphael-Penning:feat/project-delete-dns-records-1886

Conversation

@Raphael-Penning

@Raphael-Penning Raphael-Penning commented Nov 26, 2026 •

Copy link
Copy Markdown

Closes #1886

Problem

Deleting a project removed its domain rows (FK cascade) but left the DNS records Openship auto-created through a connected DNS provider (Cloudflare / DigitalOcean) in the zone.

Change

  • Teardown: a new best-effort dns_records step. It reads the project's domain hostnames before the row drops. After the row is deleted, it calls releaseRecords for each hostname, covering <host> and _openship-challenge.<host>. This is the same path single-domain removal uses, so it deletes only records that carry the "Managed by Openship" marker. The operator's own MX, SPF and CAA records at the apex are never touched.
    • It runs only after a successful row delete, so a kept project never loses DNS that still routes to it.
    • It is skipped for record-only deletes, because the workload keeps serving.
    • A provider failure is reported as a failed step (207) but does not block the delete.
  • API / contracts: new optional deleteDnsRecords flag on DELETE /projects/:id, accepted in the query or the body. It defaults to true. Internal teardownProject callers (PR previews, transfer) default to false.
  • Deletion preview: now returns customDomains.
  • Dashboard: the delete modal lists the project's custom domains with an "Also delete DNS records" checkbox (default on, hidden for record-only). New strings are added in all 10 locales.

Tests

  • project-delete-options.test.ts: covers the default (true) and opting out via the body and the query.
  • project-teardown.record-only.test.ts: new DNS cases:
    • releases records after the row drops
    • opt-out
    • record-only skip
    • row kept means nothing is released
    • provider failure is reported
    • no domains
  • project-delete.controller.test.ts: expectation updated.

Deleting a project dropped its domain rows via FK cascade but left the
DNS records Openship auto-created (Cloudflare / DigitalOcean) in the
zone. Project teardown now releases them, reusing the same
`releaseRecords` path as single-domain removal, so only records carrying
the Openship ownership marker are deleted.

- New `deleteDnsRecords` delete option (API default true), skipped for
  record-only deletes; records are released only after the row drops,
  and a provider failure is reported as a `dns_records` step without
  blocking the delete.
- Deletion preview lists the project's custom domains; the dashboard
  delete modal shows them with a default-on checkbox.

Closes oblien#1886
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.

[Feature]: Deleting a project with a custom domain should also delete the domain

1 participant