fix(scripts/ops): #3140 follow-up — tighten e2e DNS prune regex + near-miss tests #3143
Reference in New Issue
Block a user
Delete Branch "feat/prune-cf-e2e-dns"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix(scripts/ops): #3140 follow-up — tighten e2e DNS prune regex + near-miss tests
Follow-up to #3140 / CR2 RC 13129. Tightens the name filter in
scripts/ops/prune_cf_e2e_dns.shand adds regression coverage proving near-miss names are never deleted.bash tests/ops/test_prune_cf_e2e_dns_fail_closed.sh→ 13/13 pass; workflow YAML lint and no-coe-on-required lint pass.e2e-staging-saas.ymlis unchanged.sweep-aws-secrets.sh(#3134) andsweep-cf-orphans.sh(#3139); this tool remains complementary to #3139.comprehensive-testing
tests/ops/test_prune_cf_e2e_dns_fail_closed.shnow covers:api.moleculesai.app) older than min-age → kept.e2e-smokeprod,e2e-tmplprod,e2e-smoketest-keep,e2e-tmplate-keep,e2e-smokeno hyphen,prod-e2e-smoke-x) → kept.e2e-smoke-*record → reaches delete (happy-path sentinel).e2e-smoke-*record understaging.moleculesai.appwhenPRUNE_ZONE_DOMAINis set → reaches delete.bash tests/ops/test_prune_cf_e2e_dns_fail_closed.sh→ 13/13 pass.local-postgres-e2e
Not applicable. This script operates against the Cloudflare DNS API only; it does not touch Postgres, workspace-server handlers, or local e2e fixtures.
staging-smoke
The existing post-run prune job in
.gitea/workflows/e2e-staging-saas.ymlis unchanged by this PR; it continues to use--apply --min-age-hours 2with staging secrets. The narrower regex is exercised by the same workflow context.five-axis-review
e2e-smoke-ore2e-tmpl-followed by at least one suffix character and the configured zone domain; near-miss names are explicitly rejected.curl -f, JSON/array validation, pagination cap,MAX_DELETE_PCTgate, and dry-run default remain in place.--applystill requires explicit opt-in.memory-consulted
Same as #3140: reviewed fail-closed patterns from
sweep-aws-secrets.sh(#3134) andsweep-cf-orphans.sh(#3139). This change keeps the tool complementary to #3139.🤖 Generated with Claude Code
5-axis current-head review: approved. The regex now requires exact disposable prefixes (
e2e-smoke-/e2e-tmpl-) plus a non-empty suffix and anchors to the configured zone domain, so near-miss names like e2e-smoketest-, e2e-tmplate-, bare e2e-smoke, and prod-prefixed names do not match. The regression test uses the existing delete sentinel boundary: bad CF responses abort before delete, keep cases assert no delete sentinel with exit 0, and happy paths prove true ephemeral records still reach delete, including the staging.moleculesai.app domain. No correctness, security, performance, or readability concerns found.APPROVED on current head
cab044be. Genuine review: this is the #3140 DNS-pruner regex/test follow-up. The regex now requires exact e2e-smoke- or e2e-tmpl- prefixes with at least one suffix char, anchored to PRUNE_ZONE_DOMAIN, so near-miss tenant-like names are excluded while real e2e records still match. Local test run passed: bash tests/ops/test_prune_cf_e2e_dns_fail_closed.sh -> 13/13. Security/blast radius improves by narrowing the auto-apply DNS deletion matcher; robustness coverage includes non-2xx/malformed/non-array fail-closed cases, near misses, staging-domain match, and happy-path delete sentinel. No performance/readability concerns.cab044be6cto8202ccee5eFresh current-head review for
8202ccee: approved. The diff remains the narrow #3140 follow-up: tighten EPHEMERAL_RE to exact disposable prefixes with a non-empty suffix, and add near-miss regression cases plus staging-domain coverage. The sentinel-backed test harness still proves keep/abort cases do not reach delete and happy paths do. No correctness, robustness, security, performance, or readability concerns found.APPROVED on refreshed head
8202ccee5e.Re-reviewed current-head diff: still the same narrow #3140 follow-up, touching only
scripts/ops/prune_cf_e2e_dns.shandtests/ops/test_prune_cf_e2e_dns_fail_closed.sh. The regex now requires exacte2e-smoke-/e2e-tmpl-prefixes plus at least one suffix char, anchored toPRUNE_ZONE_DOMAIN; the added near-miss cases prove tenant-like/non-prefix names are kept.Local verification on
8202ccee:bash tests/ops/test_prune_cf_e2e_dns_fail_closed.shpassed 13/13. No new correctness, robustness, security, performance, or readability concerns.agent-dev-a referenced this pull request2026-06-22 04:05:52 +00:00