Repository navigation
FlowStack V2: setup & onboarding, secrets, monitoring, safe deploys, upgrades, E2E - #11
vtshreeram wants to merge 25 commits into
Conversation
- Root scripts for doctor, dev:local/dev:secrets, db:*, secrets:*, sentry:verify, prepare (husky). - Dev dependencies: husky, lint-staged, postgres (db status/migrate), pglite-socket (tests). - Sentry SDK for the TanStack app. - bun audit: 45 advisories (5 critical) on dev resolved by in-range updates (bun audit fix; vitest, shadcn, react-devtools) and a solid-js ^1.9.17 override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Project name, optional integrations, safe ports, and v1 .flowstack.json compatibility. Shared libraries for env manifest and project config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bun run dev uses Infisical when enabled and never falls back silently; dev:local and dev:secrets choose explicitly. Non-development secrets are CI-only and always refused in AI agent sessions. Turborepo passes injected variables to dev tasks; builds hash only public values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hash-based migration status detects migrations drizzle would skip because of out-of-order journal timestamps. Production migrations are CI-only; push/drop are blocked outside development. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…logs - Sentry v11 dataCollection set explicitly (v11 collects everything when unset); shared privacy baseline and beforeSend scrubber in @repo/config. - /health/live and /health/ready (database), request IDs, safe 500s. - R2 credentials required only when storage is enabled. - Build with NODE_ENV=production: an unset NODE_ENV made Bun inline "development", which enabled SQL query logging in production bundles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both apps: optional Sentry with the shared privacy baseline, root error boundaries (TanStack also reports SSR errors), development-only /debug/sentry, source maps only for Sentry uploads and deleted afterwards. Google, magic link and uploads follow TEMPLATE_FEATURES. Fix: axios read the undocumented VITE_API_URL instead of VITE_API_BASE_URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Images tagged by release; candidates deployed with no traffic and health-checked before promotion; optional auto-rollback; rollback and status commands; Secret Manager references so values never pass through the deployer; preflight validation; production deploys CI-only. Legacy key files and env-file secrets keep working with warnings. Manual, approval-gated GitHub workflow using Workload Identity Federation and Infisical OIDC for migrations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a full-history gitleaks job (pinned, checksum-verified; failure to install fails the job), actionlint, shellcheck, a minimal-integrations preset, sentinel-secret builds checked by check-bundle-secrets, a tagged release workflow and Dependabot for dev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md is the single source of agent rules (CLAUDE.md imports it, AGENT.md points to it); removes unrelated WXT/admin examples. New guides for Infisical, database, Sentry, git hooks, CI/CD and upgrading; quick start and setup docs match the commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…udit records A candidate that failed verification stayed Ready and could later be selected as the rollback target once a newer release was promoted. Failed revisions are now marked with a failed-<release> traffic tag (0% traffic, not deleted) and excluded from rollback selection. Every run can write a JSON audit record (DEPLOY_REPORT_FILE), uploaded by the workflow. Actions updated to current majors (auth/setup-gcloud v3, upload-artifact v7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
infisical run passes its own environment, including INFISICAL_TOKEN, to the child. A launcher now strips Infisical credentials before the app starts. Machine identities using Universal Auth exchange client credentials (read from the environment, never argv) for a short-lived token; a rejected identity stops before any command runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neon hosts keep the Neon HTTP driver; other hosts use postgres.js (DATABASE_DRIVER overrides, DATABASE_POOL_MAX sizes the pool). Local, Docker and Cloud SQL databases now work at runtime, not only for migrations, so doctor no longer warns about non-Neon hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bun run setup now checks Node.js and Bun first, then (after install) validates secrets (local .env or Infisical with an offer to sign in), checks database connectivity, applies development migrations only with consent (prompt, --migrate or --yes), and runs doctor. Reruns offer to reuse earlier choices and resume. Setup keeps zero third-party imports so it runs before bun install; onboarding runs as a separate process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
flowstack:upgrade:check reports what a newer starter release changes, using .flowstack.json sourceCommit as the merge base: clean updates, three-way merges, conflicts, deletions, application-owned files (report only), new migrations (never executed) and dependency changes (majors flagged, never applied). flowstack:upgrade previews, requires a clean tree and confirmation, backs up every touched file, writes conflict proposals instead of overwriting, and records the new version only once conflicts are resolved (--mark-resolved). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/e2e-api.test.ts runs the production API build against real migrations on an isolated PostgreSQL with a local mail catcher: registration, email-link verification, sign-out/in, session isolation, forged/tampered/bearer credentials, cross-site requests, per-user and per-organization storage authorization, invitations, safe errors and log redaction. Verified to fail when the membership check is removed. e2e/ (Playwright) walks the browser journey (protected redirect, sign-up, verification, onboarding, sign-out, wrong password, sign-in) and runs for all four presets in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setup docs describe the post-install checks, consent for migrations and resuming; README and AGENTS.md list test:e2e and the upgrade commands; CI docs add the e2e job to the required checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A port check that never answered could stall doctor indefinitely; it now reports the port as unavailable after two seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Better Auth resolves no client IP from a multi-hop X-Forwarded-For chain unless the proxies are trusted, so behind Google's load balancer (client, lb-ip) every client shared one rate-limit bucket: a few failed sign-ins from anyone limited all users. AUTH_TRUSTED_PROXIES and AUTH_IP_HEADERS now configure advanced.ipAddress (default unchanged); deploy preflight warns while unset. E2E tests prove separate buckets and that a forged left-most address cannot escape a limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
FlowStack V2: setup and onboarding, secrets, monitoring, quality gates, safe deploys and template upgrades. Built incrementally on
dev; existing commands, auth, schema and migrations are preserved.Deploy flow (
deploy.sh):Follow-up fixes and verification
Validation on the follow-up commits: 113 tests passed, zero failures and zero skips (including real PostgreSQL-wire-protocol, API lifecycle, deployment simulation, runtime injection and Git-hook tests). Lint, type checking, build and staged gitleaks scan passed. Local browser E2E reached the isolated stack but could not launch Chromium because the pinned Playwright version does not support this host's macOS 13. The Linux CI browser journeys passed for all four personal/organization and React/TanStack combinations on the latest head.
GitHub verification on commit
e766e9d: all 12 jobs passed, covering shared lint/types/tests/audit, secret scanning, workflow lint, all five preset builds and all four browser journeys. Successful verification run.Live Infisical/GCP identity configuration, native runtime authentication against real services and a sandbox deployment have not been performed. These are required before enabling the new runtime mode in a deployed environment.
Evidence from the initial implementation
bun audit45 advisories (5 critical) ondev.After: 103 tests pass (10 consecutive runs, 0 failures); 0 advisories; 5/5 presets (4 combos + no optional integrations) install, type-check, test, build with sentinel secrets (no bundle leaks), audit; Playwright journey passes for all 4 presets.
bun buildinlinedNODE_ENV="development") →logger: falseasserted on the built bundle.X-Forwarded-For: client, lb) all clients shared one auth rate-limit bucket →AUTH_TRUSTED_PROXIES; e2e: client B was429, now401; forged left-most IP still429.dataCollectionis unset → all categories set; runtime test with a fake ingest shows no cookie, bearer or query secret sent.failed-*tag excluded (fake-gcloud test: v1 ok, v2 failed, v3 ok, rollback → v1).0004/0005silently skipped by drizzle on DBs migrated to0003(out-of-order journal timestamps) → hash-baseddb:statusdetects it anddb:migraterefuses.VITE_API_URLinstead ofVITE_API_BASE_URL.infisical runpassedINFISICAL_TOKENinto the app process → stripped before the app starts.Merge Danger
Door: two-way
Revertible commit range; no schema changes, no data migrations, no destructive operations. Deploy script keeps the legacy service-account key and env-file paths working (with warnings); Secret Manager and keyless auth are opt-in.
Blast Radius: tooling-wide
Every developer command goes through new scripts (
bun run dev→scripts/dev.mjs). Runtime-visible changes: optional R2/Google/email followTEMPLATE_FEATURES; API now also runs on non-Neon PostgreSQL (Neon unchanged); production logs become JSON. Before relying on deploys: complete GCP/GitHub setup inapps/server/DEPLOYMENT.mdand do a sandbox run first.🤖 Generated with Claude Code