From 6bd674e41283bf0808d6a8109fce7526dffe4333 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Tue, 21 Apr 2026 04:50:28 -0700 Subject: [PATCH] fix(e2e): CP DELETE /cp/admin/tenants body uses 'confirm', not 'confirm_token' Verified against live staging: the admin endpoint returns 400 'confirm field must equal the URL slug' when the body key is 'confirm_token'. Every workflow's safety-net teardown step + the main harness + the Playwright teardown all had the wrong key. Fixed all six call sites. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/canary-staging.yml | 2 +- .github/workflows/e2e-staging-canvas.yml | 2 +- .github/workflows/e2e-staging-saas.yml | 2 +- .github/workflows/e2e-staging-sanity.yml | 2 +- canvas/e2e/staging-teardown.ts | 2 +- tests/e2e/test_staging_full_saas.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/canary-staging.yml b/.github/workflows/canary-staging.yml index c5374df2..32cba939 100644 --- a/.github/workflows/canary-staging.yml +++ b/.github/workflows/canary-staging.yml @@ -148,6 +148,6 @@ jobs: curl -sS -X DELETE "$MOLECULE_CP_URL/cp/admin/tenants/$slug" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"confirm_token\":\"$slug\"}" >/dev/null || true + -d "{\"confirm\":\"$slug\"}" >/dev/null || true done exit 0 diff --git a/.github/workflows/e2e-staging-canvas.yml b/.github/workflows/e2e-staging-canvas.yml index e3c667cf..c90794bd 100644 --- a/.github/workflows/e2e-staging-canvas.yml +++ b/.github/workflows/e2e-staging-canvas.yml @@ -111,6 +111,6 @@ jobs: curl -sS -X DELETE "$MOLECULE_CP_URL/cp/admin/tenants/$slug" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"confirm_token\":\"$slug\"}" >/dev/null || true + -d "{\"confirm\":\"$slug\"}" >/dev/null || true done exit 0 diff --git a/.github/workflows/e2e-staging-saas.yml b/.github/workflows/e2e-staging-saas.yml index 1780b72d..e52367cc 100644 --- a/.github/workflows/e2e-staging-saas.yml +++ b/.github/workflows/e2e-staging-saas.yml @@ -138,6 +138,6 @@ jobs: curl -sS -X DELETE "$MOLECULE_CP_URL/cp/admin/tenants/$slug" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"confirm_token\":\"$slug\"}" >/dev/null || true + -d "{\"confirm\":\"$slug\"}" >/dev/null || true done exit 0 diff --git a/.github/workflows/e2e-staging-sanity.yml b/.github/workflows/e2e-staging-sanity.yml index f20f628b..6eacac36 100644 --- a/.github/workflows/e2e-staging-sanity.yml +++ b/.github/workflows/e2e-staging-sanity.yml @@ -147,6 +147,6 @@ jobs: curl -sS -X DELETE "$MOLECULE_CP_URL/cp/admin/tenants/$slug" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"confirm_token\":\"$slug\"}" >/dev/null || true + -d "{\"confirm\":\"$slug\"}" >/dev/null || true done exit 0 diff --git a/canvas/e2e/staging-teardown.ts b/canvas/e2e/staging-teardown.ts index f6e79f92..b573cb2d 100644 --- a/canvas/e2e/staging-teardown.ts +++ b/canvas/e2e/staging-teardown.ts @@ -45,7 +45,7 @@ export default async function globalTeardown(): Promise { Authorization: `Bearer ${ADMIN_TOKEN}`, "Content-Type": "application/json", }, - body: JSON.stringify({ confirm_token: slug }), + body: JSON.stringify({ confirm: slug }), }); if (res.ok) { console.log(`[staging-teardown] ${slug} deleted`); diff --git a/tests/e2e/test_staging_full_saas.sh b/tests/e2e/test_staging_full_saas.sh index 85e5bc8a..bb8bc087 100755 --- a/tests/e2e/test_staging_full_saas.sh +++ b/tests/e2e/test_staging_full_saas.sh @@ -84,7 +84,7 @@ cleanup_org() { curl "${CURL_COMMON[@]}" -X DELETE "$CP_URL/cp/admin/tenants/$SLUG" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"confirm_token\":\"$SLUG\"}" >/dev/null 2>&1 \ + -d "{\"confirm\":\"$SLUG\"}" >/dev/null 2>&1 \ && ok "Teardown request accepted" \ || log "Teardown returned non-2xx (may already be gone)"