Repository navigation
Migrate to Strawberry / FastAPI / Mangum (final sibling: container + PynamoDB) #86
Description
Activity
Migration engineering complete — stacked PRs #88–#94
All phases implemented + verified; only the prod cutover (AWS creds + go-ahead) remains.
Phase PR State 0 — pre-flight (poetry→uv, SDL baseline, corpus incl. kororaa) #88 ✅ 1 — FastAPI/Mangum + container entry swap #89 ✅ 2a — PynamoDB → pydantic + boto3 (wrapper API kept) #90 ✅ 2b — schema port, SDL byte-identical #91 ✅ 3 — runtime resolvers, 11 differential-parity checks #92 ✅ 4 — deploy/CI/deps hardening (360MB image, pip-audit clean) #93 ✅ 5 — cutover plan (pre-staged) #94 🟡 deploy held Verified: SDL byte-identical to legacy; full surface runtime-equivalent (in-process differential harness caught real bugs — relay global-id, float defaults, coercion); amd64 container builds + handler imports in-image; no runtime vulns.
Remaining (needs you): deploy to test →
cli_ab_test prod-vs-test→ promote → post-healthy legacy cleanup. Seedocs/PHASE5_CUTOVER.md.✅ Merged to
deploy-test+ deployed to the TEST stageCombined PR #95 merged (one merge → one clean deploy, per runbook G7; #88–#94 landed via it). The
deploy-aws-lambdarun succeeded:- tests + ruff + mypy ✓
- ECR container build + test-stage deploy ✓
- deploy smoke
query QueryRoot{about}✓
The Strawberry app is live on test — container packaging, Mangum entry, and the full schema verified in the real Lambda env.
Folded in at merge: a CI fix (drop the
follow_untyped_importsregressionpoetry2uvadded + aSetOperationEnumtype stub → whole package mypy-clean), and a rebase over 3 concurrentdeploy-testcommits (#81/#82/#84).Remaining (needs you — AWS creds + prod go-ahead)
cli_ab_test WORK/ab.toml -A prod -B test -v— differential prod-vs-test (the built-in harness).- Promote
deploy-test → main(prod) with the pre-staged revert PR + ~30-min watch. - Post-healthy legacy cleanup (delete graphene
schema.py/Flask/handler.py, renamestrawberry_schema.py→schema.py, drop legacy deps). Seedocs/PHASE5_CUTOVER.md.
Done — migrated to Strawberry/FastAPI/Mangum and live in prod (2026-06-26, promote PR #97, merge
5ed85863).- Graphene fully removed (source, tests, deps); PynamoDB
BinaryLargeObject→ pydantic+boto3 behind the unchanged wrapper. - SDL byte-identical to the frozen graphene baseline;
cli_ab_testprod-vs-test 9/9; 30-min prod watch 6/6, 0 failures; live kororaa-prod traffic all 200. - Coverage closed (test: close the de-graphene coverage gap #99/test: SDL parity gate as a CI test (close remaining codecov gap) #100); SDL parity gate is now a permanent CI test.
Tracked under epic GNS-Science/nshm-toshi-api#359 (item 4).
- Graphene fully removed (source, tests, deps); PynamoDB
Summary
Migrate
solvis-graphql-apifrom Graphene 3 / Flask / serverless-wsgi to Strawberry / FastAPI / Mangum — the 4th and final sibling, run last because it adds the two biggest deltas: a container (ECR) Lambda and a PynamoDB ORM.Epic: GNS-Science/nshm-toshi-api#359
Runbook:
nshm-toshi-api/docs/MIGRATION_RUNBOOK.mdWorked log:
docs/MIGRATION_LOG.md(branchmigrate/strawberry)Owner: @chrisbc
Phase 0 inventory — done
Captured in
docs/MIGRATION_LOG.md. Key findings (several easier than the runbook's §A4 framing):BinaryLargeObjectModel(5 attrs) already wrapped by a hand-writtenBinaryLargeObjectclass. Convert to pydantic + boto3 behind the unchanged wrapper API.handler.pyworkaround → Mangum replaces it; updateDockerfileCMD + serverlessimage.command.ab_test/+cli_ab_test, 9 query checks) → reuse as the Phase 5 validation tool and corpus seed..yarnrc.ymllacks the age gate; bothserverless-s3-local+serverless-dynamodbload at boot (runbook §4.7 risk); heavy container image (matplotlib/solvis/shapely).TESTenv (the Model §4.2 caveat, not AWS_TEST/AWS_PROD).Plan (tailored — full detail in the log)
migrate/strawberrypoetry2uvskill (running externally on the branch).yarnrc.ymlage gate; drop serverless-wsgi-uvworkflows; removebranches:filtercli_ab_testprod-vs-new differential validation; promote + prod watch; file runbook feedback PRStatus
Phase 0 inventory complete; branch pushed and awaiting the external
poetry2uvrun before Phase 1 code begins.