Repository navigation
feat(learncard-issuer-adapter): port serverless-http Lambda packaging to main (#171) - #173
Conversation
Verbatim port from demo/e2e-aligned (already running live on AWS): the serverless-http entrypoint (which installs the #163-fixed crash guards before exporting the handler), the multi-stage nodejs:20 Dockerfile.lambda, and the dependency + lockfile entries. main previously had no Dockerfile for this service at all.
mgwozdz-unicon
left a comment
There was a problem hiding this comment.
Approving. Claude diffed this against demo/e2e-aligned's commit 2bd107d73 and confirmed Dockerfile.lambda, src/lambda.ts, and the package.json/package-lock.json entries are byte-for-byte identical to what's already running live, so the "verbatim port" claim in the description checks out.
installCrashGuards() runs at module scope before the handler is exported, so it replaces Lambda's runtime unhandledRejection listener once at cold start rather than per-invocation, which is what #163 needed to actually take effect on the managed runtime. The Dockerfile path also matches what deploy.yml already expects for a service wired into the deploy matrix, though issuer-adapter isn't in that matrix yet, so this image won't build via CI until that's added — filed as #177.
Two small things I noticed, both pre-existing in the ported code and not blockers:
- The build stage uses
npm installrather thannpm ci, which is whatdocker/Dockerfile.node(this service's existing compose image) uses against the same lockfile.npm ciwould be more reproducible if this file gets touched again. - The final stage copies
node_modulesstraight from the build stage, which includes devDependencies (typescript,vitest,tsx,supertest, etc.) in the runtime image. Not a functional issue at this size, just extra image weight that a--omit=devstep could trim later.
No new test for lambda.ts itself, but that's consistent with server.ts also being untested here, and the file is a thin composition of already-covered units (guards.test.ts, api.test.ts, config.test.ts).
What
Closes #171 — verbatim port of the issuer adapter's Lambda packaging from
demo/e2e-aligned, where these exact bytes are already running live on AWS (imagedb6952e):src/lambda.ts— wrapscreateApp(loadConfig())withserverless-http; callsinstallCrashGuards()first, so the fix(learncard-issuer-adapter): crash guard must displace the AWS runtime's rejection listener #163 crash-guard fix finally has a Lambda entrypoint to protect on main.Dockerfile.lambda— multi-stagepublic.ecr.aws/lambda/nodejs:20build,CMD ["dist/lambda.handler"].package.json+package-lock.json—serverless-http@^4.Verification
tsc --noEmitclean.