fix(ci): harden Cloudflare sweep API errors
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 10s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
security-review / approved (pull_request) Failing after 17s
qa-review / approved (pull_request) Failing after 17s
CI / Detect changes (pull_request) Successful in 35s
sop-checklist-gate / gate (pull_request) Successful in 15s
gate-check-v3 / gate-check (pull_request) Successful in 24s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 40s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 42s
E2E API Smoke Test / detect-changes (pull_request) Successful in 43s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 38s
sop-tier-check / tier-check (pull_request) Successful in 14s
CI / Canvas (Next.js) (pull_request) Successful in 9s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Platform (Go) (pull_request) Successful in 13s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 6s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 15s
CI / all-required (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 27s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m11s
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 10s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
security-review / approved (pull_request) Failing after 17s
qa-review / approved (pull_request) Failing after 17s
CI / Detect changes (pull_request) Successful in 35s
sop-checklist-gate / gate (pull_request) Successful in 15s
gate-check-v3 / gate-check (pull_request) Successful in 24s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 40s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 42s
E2E API Smoke Test / detect-changes (pull_request) Successful in 43s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 38s
sop-tier-check / tier-check (pull_request) Successful in 14s
CI / Canvas (Next.js) (pull_request) Successful in 9s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Platform (Go) (pull_request) Successful in 13s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 6s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 15s
CI / all-required (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 27s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m11s
This commit is contained in:
parent
3df44d9fb1
commit
1e80a33cc8
@ -97,6 +97,30 @@ log " live EC2s: $(echo "$EC2_NAMES" | wc -w | tr -d ' ')"
|
||||
log "Fetching Cloudflare DNS records..."
|
||||
CF_JSON=$(curl -sS -m 15 -H "Authorization: Bearer $CF_API_TOKEN" \
|
||||
"https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/dns_records?per_page=500")
|
||||
if ! echo "$CF_JSON" | python3 -c '
|
||||
import json, sys
|
||||
|
||||
try:
|
||||
payload = json.load(sys.stdin)
|
||||
except Exception as exc:
|
||||
print(f"ERROR: Cloudflare returned non-JSON response: {exc}", file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
|
||||
if not payload.get("success", False) or not isinstance(payload.get("result"), list):
|
||||
errors = payload.get("errors") or []
|
||||
if errors:
|
||||
detail = "; ".join(
|
||||
f"{err.get(\"code\", \"unknown\")}: {err.get(\"message\", \"unknown error\")}"
|
||||
for err in errors
|
||||
)
|
||||
else:
|
||||
detail = f"unexpected result type {type(payload.get(\"result\")).__name__}"
|
||||
print(f"ERROR: Cloudflare DNS list failed: {detail}", file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
'; then
|
||||
log "Cloudflare DNS list failed; verify CF_API_TOKEN has Zone:DNS:Edit and CF_ZONE_ID is the moleculesai.app zone."
|
||||
exit 1
|
||||
fi
|
||||
TOTAL_CF=$(echo "$CF_JSON" | python3 -c "import json,sys; print(len(json.load(sys.stdin)['result']))")
|
||||
log " CF records: $TOTAL_CF"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user