Skip to content

Phase 1 — bootstrap: FastAPI/Mangum scaffold + container entry swap#89

Closed
chrisbc wants to merge 2 commits into
migrate/strawberryfrom
migrate/strawberry-p1
Closed

Phase 1 — bootstrap: FastAPI/Mangum scaffold + container entry swap#89
chrisbc wants to merge 2 commits into
migrate/strawberryfrom
migrate/strawberry-p1

Conversation

@chrisbc

@chrisbc chrisbc commented Jun 24, 2026

Copy link
Copy Markdown
Member

Stacked migration — PR 2 of N. Base = migrate/strawberry (Phase 0, #88). Retarget to deploy-test after #88 lands.
Epic: GNS-Science/nshm-toshi-api#359 · Tracking: #86 · Log: docs/MIGRATION_LOG.md

Stands up the new stack alongside the legacy Graphene/Flask app (removed at cutover). No deploy yet — the migrated app isn't wired to the real schema until Phase 2, so the stack merges as one unit at cutover (runbook G7).

Changes

  • Deps: strawberry-graphql 0.316, fastapi 0.137, mangum 0.21, pydantic 2.13 (legacy kept alongside).
  • app.py — FastAPI + GraphQLRouter + Mangum + CORS. strawberry_schema.py — minimal QueryRoot.about at SDL parity (auto_camel_case=False; root type QueryRoot to match legacy + the kororaa corpus fragments). Named strawberry_schema.py because legacy Graphene owns schema.py (Model G4); rename at cutover.
  • Container entry → Mangum: serverless.yml image.command = solvis_graphql_api.app.handler; dropped serverless-wsgi plugin + custom.wsgi; Dockerfile CMD = app.handler (removed bogus /bin/bash -c entrypoint). The serverless-wsgi handler.py workaround is now unused (deleted at cutover).
  • CI: removed dev.yml branches: filter so stacked PRs get CI (Trap add id resolver; #14); .yarnrc.yml now tracked + age gate (§4.6).

Verification (local)

  • amd64 docker build succeeds (all deps incl. geo stack install)
  • docker run … python -c "import solvis_graphql_api.app" → Mangum handler + FastAPI import clean inside the image
  • uvicorn/TestClient { about } byte-matches legacy; { __typename }QueryRoot
  • full legacy suite 77 passed / 10 skipped; ruff clean

chrisbc added 2 commits June 24, 2026 12:44
- dev.yml: drop the pull_request branches:[main,deploy-test] filter so
  stacked migration PRs get CI (runbook Trap #14)
- .yarnrc.yml: now tracked (was untracked); add npmMinimalAgeGate 7d +
  preapproved project scopes (runbook §4.6); yarn install --immutable OK

Refs #86
- add strawberry/fastapi/mangum/pydantic (legacy graphene/flask kept until cutover)
- app.py: FastAPI + GraphQLRouter + Mangum + CORS
- strawberry_schema.py: minimal QueryRoot.about at SDL parity
  (auto_camel_case=False, root type QueryRoot to match legacy + kororaa corpus)
- serverless.yml: image.command -> solvis_graphql_api.app.handler; drop
  serverless-wsgi plugin + custom.wsgi
- Dockerfile: CMD -> app.handler; drop bogus /bin/bash -c entrypoint
- verified: amd64 docker build OK + handler imports in-image; uvicorn {about}
  byte-matches legacy; full legacy suite 77 passed

Refs #86
@chrisbc

chrisbc commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Landed via the combined PR #95 (one merge → one test-stage deploy, per runbook G7). Per-phase detail preserved here.

@chrisbc chrisbc closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant