Skip to content

test(e2e): Batch B LIVE prod write specs (W-ONBOARD/WEBHOOK/TEAM/DEPLOY) - #184

Merged
mastermanas805 merged 2 commits into
mainfrom
live-writes-batch-b
Jun 5, 2026
Merged

test(e2e): Batch B LIVE prod write specs (W-ONBOARD/WEBHOOK/TEAM/DEPLOY)#184
mastermanas805 merged 2 commits into
mainfrom
live-writes-batch-b

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Batch B — LIVE prod write-flow coverage

Implements Batch B (waves W7–W10) of docs/sessions/2026-06-04/PROD-COVERAGE-MATRIX.md: real-backend (LIVE) integration specs covering the authed WRITE user-flows against production (api.instanode.dev) via the minted cohort PRO account, runnable in e2e-prod.yml.

New file e2e/live-writes.spec.ts mirrors live-reads.spec.ts / live-claim-deploy.spec.ts conventions exactly: E2E_LIVE gating, assertSafeApiTarget, ledger-before-assert + inline reap + afterAll backstop (rule 24), authed-minted vs forceAnon split.

Routes moved to LIVE-PROD-NOW (27 route-legs)

W-ONBOARDGET /start (302 → /claim?t=, and bare /claim w/o token), GET /claim/preview (token_valid + items[] summary; 400 missing_token). The /claim happy-path + 409 replay already run live in live-claim-deploy.spec.tsnot duplicated.

W-WEBHOOKPOST /webhook/new (authed) → POST /webhook/receive/:tokenGET /api/v1/webhooks/:token/requests asserts the captured request reflects the exact method/body/custom-header sent (write→inspect round-trip) → reap.

W-TEAMPATCH /api/v1/team (rename + read-back), GET/PATCH /api/v1/team/settings (TTL policy round-trip + invalid→400), GET/PUT /api/v1/team/env-policy (round-trip, reset to permissive), GET /api/v1/team/summary, GET /api/v1/team/members, GET /api/v1/team/invitations, and member-management: POST /api/v1/team/members/invite (developer) → list → DELETE /api/v1/team/invitations/:id (revoke). Isolation: invite/remove/leave operate against a SECOND throwaway minted account (POST /internal/e2e/account) — the shared primary minted account is never removed/left. DELETE /api/v1/team stays PROD-EXEMPT (destructive).

W-DEPLOYPOST /deploy/new (202 accepted contract: id/app_id/status/environment) → GET /api/v1/deployments + /:id + /:id/eventsPOST /:id/make-permanent + POST /:id/ttl + PATCH /:id (private) → two-step delete (202 pending_confirmation + DELETE /:id/confirm-deletion cancel) → final skip-email DELETE reap → gone. Full Kaniko build is deferred (too heavy); the lifecycle contract is asserted.

Reaper change

e2e/cleanup-ledger.ts adds an e2e-account entity kind that reaps the secondary cohort account via the guarded internal cascade DELETE /internal/e2e/account/:team_id (mint-token header from E2E_ACCOUNT_TOKEN) — there is no DELETE /api/v1/team/:id route, so the out-of-process reaper now covers a stranded secondary account too.

Skipped-with-reason (PROD-EXEMPT, matrix §6)

  • W-TEAM member-mgmt writes skip loudly when E2E_ACCOUNT_TOKEN is unset (can't mint the isolated secondary member without risking the primary). The owner-only team reads/patches still run on the primary.
  • W-DEPLOY two-step delete email is Brevo-gated (sender unvalidated on prod) — contract only (202 pending / 503 send-failed / immediate-200 all accepted), never asserts delivery.

Gate

npm run gate green (tsc + build + 1115 vitest, 0 failures). Whole file self-skips in PR CI (E2E_LIVE!=1); 11 LIVE tests discovered under playwright.live.config.ts. Mocked suite untouched.

🤖 Generated with Claude Code

…DEPLOY)

Batch B of the prod-coverage matrix (docs/sessions/2026-06-04/
PROD-COVERAGE-MATRIX.md §3 waves W7–W10): real-backend (LIVE) integration
specs covering the authed WRITE user-flows against PRODUCTION via the minted
cohort PRO account, runnable in e2e-prod.yml.

New e2e/live-writes.spec.ts (mirrors live-reads.spec.ts / live-claim-deploy
conventions: E2E_LIVE gating, assertSafeApiTarget, ledger-before-assert + reap
rule 24, forceAnon/authed split):

- W-ONBOARD: GET /start (302 → /claim?t=), GET /claim/preview (token_valid +
  items[] summary; 400 missing_token). /claim happy-path + 409 replay already
  live in live-claim-deploy — not duplicated.
- W-WEBHOOK: POST /webhook/new (authed) → POST /webhook/receive/:token →
  GET /api/v1/webhooks/:token/requests captures method/body/header → reap.
- W-TEAM: PATCH /api/v1/team (rename), GET/PATCH /team/settings (TTL policy +
  invalid 400), GET/PUT /team/env-policy round-trip, /team/summary, /members,
  /invitations, and member-mgmt (invite developer → list → revoke). ISOLATION:
  invite/remove/leave use a SECOND throwaway minted account so the shared
  primary is never removed/left.
- W-DEPLOY: POST /deploy/new (202) → list/get/events → make-permanent + set-ttl
  + patch(private) → two-step delete (202 pending + cancel) → skip-email reap.
  Full Kaniko build deferred; lifecycle contract asserted.

cleanup-ledger.ts: new 'e2e-account' entity kind reaps a secondary cohort
account via the guarded internal cascade DELETE /internal/e2e/account/:team_id
(mint-token header, from E2E_ACCOUNT_TOKEN env) so the out-of-process reaper
covers it too — no DELETE /api/v1/team/:id route exists.

PROD-EXEMPT (skip-with-reason, matrix §6): W-TEAM member-mgmt writes skip when
E2E_ACCOUNT_TOKEN is unset (can't mint the isolated secondary); W-DEPLOY
two-step delete email is Brevo-gated (sender unvalidated) — contract only.

npm run gate green (tsc + build + 1115 vitest). Whole file self-skips in PR CI
(E2E_LIVE!=1); 11 LIVE tests discovered under playwright.live.config.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 enabled auto-merge (squash) June 5, 2026 08:27
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/assets/index-902QtfQT.js 161.98 KB (0%)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)

Comment thread e2e/live-writes.spec.ts Fixed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 merged commit 0892e83 into main Jun 5, 2026
18 checks passed
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.

1 participant