Security:
- /api/setup and /api/bootstrap now require Authorization: Bearer $SETUP_SECRET
before executing any database seed operations
E2E:
- global.setup.ts: replace fixed 2s sleep with waitForServer() poll loop
(60s timeout, 1s interval) so seed POST only fires when server is ready
CI pipeline:
- lint gate: remove || true so ESLint failures propagate; tighten
error threshold from 1500 to 0 (errors are now a hard gate)
- container-build-apps: replace !failure() with explicit
needs.container-base-tier1.result == 'success' so a failed tier-1
build blocks Gate 2 instead of being silently skipped
- skip_tests workflow_dispatch input now wired to gate-2-start,
test-unit, test-e2e, and test-dbal-daemon jobs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The workflowui Next.js app uses basePath: '/workflowui', so its API
routes are served at /workflowui/api/setup, not /api/setup. The global
setup was calling the wrong path, resulting in a 404 and aborting the
entire E2E test suite.
https://claude.ai/code/session_019xbfXDfsSMKjWoH6BkaPx6
The E2E global setup calls POST /api/setup on localhost:3000, but port
3000 is the workflowui dev server which had no such route — it only
existed in the nextjs workspace. This caused a 404, leaving the DB
empty and making all data-dependent tests (workflowui-auth,
workflowui-templates) time out waiting for content that was never seeded.
- Add /api/setup/route.ts to workflowui that seeds InstalledPackage and
PageConfig records via the DBAL REST API
- Make global setup throw on seed failure instead of logging and
continuing, so the suite fails fast rather than running 250 tests
against an empty database
https://claude.ai/code/session_01ChKf8wbKQLBcNbBCtqCwT6
Replace manual docker compose start/stop in the CI workflow with
Testcontainers in Playwright global setup/teardown. This gives:
- Automatic container lifecycle tied to the test run
- Health-check-based wait strategies per service
- Clean teardown even on test failures
- No CI workflow coupling to Docker orchestration
Changes:
- e2e/global.setup.ts: Start smoke stack via DockerComposeEnvironment
(nginx, phpMyAdmin, Mongo Express, RedisInsight) with health check waits
- e2e/global.teardown.ts: New file — stops Testcontainers environment
- e2e/playwright.config.ts: Register globalSetup/globalTeardown, bind dev
servers to 0.0.0.0 in CI so nginx can proxy via host.docker.internal
- gated-pipeline.yml: Remove docker compose start/stop/verify steps,
add 10min timeout to Playwright step
- e2e/deployment-smoke.spec.ts: Update doc comment
- package.json: Add testcontainers@^11.12.0 devDependency
https://claude.ai/code/session_018rmhuicK7L7jV2YBJDXiQz
- Add CLAUDE.md: AI assistant instructions for MetaBuilder project architecture
- Add TESTING.md: Comprehensive E2E testing guide and troubleshooting
Core changes:
- Create Playwright global.setup.ts to seed database before E2E tests
- Add /api/setup endpoint to trigger database seeding via HTTP
- Implement seed-home-page.ts module loaded from ui_home package metadata
- Create ui_home/seed/metadata.json defining home page PageConfig seed data
Architecture established:
- Packages define seed data in seed/metadata.json
- Seed functions are idempotent (check before creating)
- Global setup calls /api/setup before running tests
- Database schema must be created via 'npm run db:push' before seeding
Test flow:
1. Playwright starts webServer (generates Prisma client, starts Next.js)
2. Global setup waits for server, calls POST /api/setup
3. Seeding creates default data from packages
4. E2E tests run against seeded database
This establishes proper separation of concerns:
- DBAL adapter for database access (not raw Prisma)
- Package-driven seed data (not hardcoded in code)
- HTTP endpoint for explicit database initialization
- Idempotent seeds (safe to rerun)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>