Uh oh!
There was an error while loading. Please reload this page.
Local-Supabase follow-ups: rich seed + integration suite (#363, #362; #365 reverted) - #377
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>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Deploying with |
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs | frontend-staging | 399687a | Commit Preview URL Branch Preview URL | Jul 22 2026, 07:21 AM |
Uh oh!
There was an error while loading. Please reload this page.
Follow-ups to the local-Supabase dev stack (PR #372). Three issues, stacked on
feat/local-supabase-dev(not yet onmain). Order: #363 → #362 → #365.#363 — rich local dataset for E2E
backend/db/seed_helpers.py— shared idempotency/summary helpers, extracted fromseed_staging.py(which is refactored to import them; its dataset/behavior is unchanged).backend/db/seed_local_rich.py— local-only (refuses a non-localSUPABASE_URL), idempotent, self-contained rich dataset, all ids namespacedrich-*:is_approved=false, admin viauser_roles), 6 courses across 6 depts, 8 offerings across 3 terms (CS101 in both fall-2025 and spring-2026).services.encryption(encrypt_if_present,encrypt_json, numeric points read viadecrypt_numeric).scripts/lib/local-common.shas an opt-in step (SEED_RICH=1 scripts/local-db-reset.sh) and documented indocs/local-supabase.md.python -m db.seed_local_richtwice → run 1 creates 113 rows across 21 tables, run 2 creates 0 (idempotent).#362 — opt-in integration suite against the real local stack
tests/conftest.py: registers anintegrationmarker and extends the two autouse hermetic fixtures to bypass for it (real DB client + real auth guard).tests/integration/conftest.py: gated onRUN_INTEGRATION=1+ a localSUPABASE_URL; loadsbackend/.envwithoverride=True(so the seed'sENCRYPTION_KEY/SESSION_SECRETmatch the tests, without leaking into the hermetic suite); localmint_session; plainTestClientfixtures; seeds the rich dataset (idempotent, additive — never resets).tests/integration/test_local_stack.py: a realtable()write→read→delete, an encryption round-trip (write encrypted → read raw →decrypt_if_present/decrypt_numeric), and route E2Es for/api/auth/meand the gradebook (provingdecrypt_numericthrough the route).RUN_INTEGRATION=1 pytest -m integration→ 4 passed against the live local stack; the default hermetic suite is unaffected (965 passed / 5 skipped) and skips these..github/workflows/integration.yml(stretch) boots the Supabase CLI and runs the suite.workflow_dispatch-only and runtime-unverified (no Actions runner available here) — deliberately not auto-run on PRs.#365 — Next.js
middleware→proxy— REVERTED (blocked by the deploy platform)The migration was implemented and passed
tsc/vitest/next build, but it broke thefrontend-stagingCloudflare Workers build: the frontend deploys via@opennextjs/cloudflare, which supports only Edge middleware, while Next 16'sproxyforces the Node.js runtime (ERROR Node.js middleware is not currently supported). It has been reverted here (keptmiddleware.tson Edge; the deprecation warning is a harmless dev-console log). #365 is blocked until OpenNext-Cloudflare supports Node middleware.Review
Each of the 10 commits was reviewed per-task; a final whole-branch review (opus) returned "ready to merge with fixes" (0 Critical), and the one Important item (CI workflow trigger/version/timeout) plus several minor quality items were fixed in
fb8f2bband re-reviewed clean.Notes
db.connection.table().docs/superpowers/{specs,plans}/(~1.1k lines of process markdown). Happy to drop those two commits if you'd rather they not land in the repo.🤖 Generated with Claude Code