Uh oh!
There was an error while loading. Please reload this page.
Promote local-Supabase follow-ups to main (#363 rich seed, #362 integration suite) - #404
Conversation
…rs (#363) Moves the private _upsert/_insert_if_absent/_exists_by/_print_summary machinery out of seed_staging.py into db/seed_helpers.py so the upcoming seed_local_rich.py (#363) can reuse the exact same upsert-on-UNIQUE / insert-if-absent / summary logic. seed_staging.py's dataset and behavior are unchanged — only the call sites now go through db.seed_helpers (h.*). Also repoints test_seed_staging.py's FakeTable patch from db.seed_staging.table (removed — no longer referenced now that all DB access is delegated to seed_helpers) to db.seed_helpers.table, which is the new seam. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds backend/db/seed_local_rich.py: a LOCAL-ONLY, idempotent, rich-* namespaced dataset covering schools/courses/offerings, all 5 user states (full/minimal profile, pending, admin), multi-term enrollments (incl. one curved), a 13-node/7-edge knowledge graph across 3 courses with mastery events, gradebook categories + assignments spanning every assignment_type/source and graded/ungraded/past/upcoming combos, study rooms with messages, notes/documents/flashcards, quiz attempts across all 3 difficulties, and tutoring sessions with messages. Reuses db.seed_helpers for upsert-on-UNIQUE / insert-if-absent idempotency; 🔒 columns go through services.encryption. Guarded by _guard_local() (SystemExit on a non-local SUPABASE_URL), verified via two live runs against the local Supabase stack (113 created, then 0).
migrate_reload_seed is invoked bare under 'set -uo pipefail' (no set -e), so a 'return 1' was swallowed and local-db-reset.sh still printed success with exit 0. Match the sibling db.migrate/db.seed_staging 'exit 1' handlers. (Task 3 review.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…est cleanup, curved-grade coverage) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying with |
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs | frontend-staging | 01afb0c | Commit Preview URL Branch Preview URL | Jul 22 2026, 07:25 AM |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughA shared seed-helper module, guarded rich local dataset seed, opt-in Supabase integration suite, CI workflow, local reset hook, and supporting documentation were added. Staging seeding now delegates idempotency and summary handling to the shared helpers. ChangesLocal Supabase seeding
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHubActions
participant SupabaseCLI
participant seed_local_rich
participant pytest
participant FastAPI
Developer->>GitHubActions: dispatch integration workflow
GitHubActions->>SupabaseCLI: start local Supabase
GitHubActions->>seed_local_rich: migrate and seed database
GitHubActions->>pytest: run integration-marked tests
pytest->>FastAPI: call authenticated and anonymous routes
FastAPI-->>pytest: return database-backed decrypted responses
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Promotes the local-Supabase follow-ups (merged via #377 into
feat/local-supabase-dev) ontomain. Since #372 already landed onmain, this diff is just the follow-up work — the rich seed and the opt-in integration suite.What lands on main
backend/db/seed_helpers.py(shared idempotency helpers) +backend/db/seed_local_rich.py(local-only, idempotent rich dataset) +SEED_RICH=1reset wiring + docs.integrationpytest marker + hermetic-bypass,backend/tests/integration/(real-local-Supabase suite: DB round-trip, encryption incl.decrypt_numeric,/api/auth/me+ gradebook route E2E), docs, and aworkflow_dispatch-only CI workflow.What does NOT land
middleware→proxy) was reverted — it broke thefrontend-stagingCloudflare Workers build (@opennextjs/cloudflaresupports only Edge middleware; Next 16proxyforces the Node.js runtime).middleware.tsis kept on Edge; the net frontend diff here is zero. chore(frontend): migrate middleware.ts → proxy (Next 16 deprecation) #365 is blocked until OpenNext-Cloudflare supports Node middleware.Risk
Backend dev-tooling + docs + an opt-in (non-default) test suite + a manual-only CI workflow. No app runtime behavior changes; the frontend is unchanged. Merging deploys the staging environment (
main= staging).Verified on the source branch: hermetic suite 965 passed / 5 skipped;
RUN_INTEGRATION=1 pytest -m integration→ 4 passed live; frontendtsc/vitestclean;frontend-stagingWorkers build green.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests