#1887
feat(projects): delete Openship-managed DNS records on project delete
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_recordsstep. It reads the project's domain hostnames before the row drops. After the row is deleted, it callsreleaseRecordsfor 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
deleteDnsRecordsflag onDELETE /projects/:id, accepted in the query or the body. It defaults totrue. InternalteardownProjectcallers (PR previews, transfer) default tofalse. - 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.