Skip to content

List settings per Lambda handler, and release 3.1.1 - #290

Merged
ottonomy merged 1 commit into
mainfrom
settings-contract-functions
Dec 1, 2026
Merged

ottonomy merged 1 commit into
mainfrom
settings-contract-functions

Conversation

@ottonomy

@ottonomy ottonomy commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What changed

settings.contract.json now lists settings under the Lambda handler that reads them, so the platform repo's pull request check can match each function in its template to the settings that function may set.

  • The list moves from a top-level settings to functions["run.sh"].settings. The key is the handler string exactly as the Lambda deployment's template gives it. Every entry and field is unchanged. The Docker image reads the same list.
  • Two entries are added for what the Lambda deployment sets for the Lambda Web Adapter:
    • AWS_LAMBDA_EXEC_WRAPPER: /opt/bootstrap, required on Lambda, read by Lambda's Node.js runtime.
    • AWS_LWA_ENABLE_COMPRESSION: optional, default false, read by the adapter.
    • readBy gains two values for them, adapter and lambda-runtime.
  • The contract test reads the new shape. It checks there is one function, run.sh, and that the two adapter entries are set by the template and unused in Docker. The "required on Lambda" tests now cover only the settings the app reads.
  • README, CHANGELOG, and version 3.1.1. No setting the app reads changed, and nothing about how the app runs changed.

The platform template will also stop setting NODE_ENV, which the Next.js standalone server sets to production itself. That change is in the platform repo, not here.

Validated locally

  • npm test: 178 passed, 33 skipped (the MongoDB and DynamoDB store tests, which CI runs against services)
  • npx tsc --noEmit: clean
  • The platform repo's new settings check, run against this branch's contract and the verifier-plus Lambda template: passes

Deferred

Nothing in this repo. Once this is merged, the platform repo pins the merge commit, and its pull request check reads this contract from then on.

🤖 Generated with Claude Code

settings.contract.json now keeps its list under functions["run.sh"].settings,
keyed by the handler string the Lambda deployment uses, so a deployment's
pull request check can match each function in its template to the settings
that function may set. It also lists AWS_LAMBDA_EXEC_WRAPPER and
AWS_LWA_ENABLE_COMPRESSION, which the Lambda deployment sets for the Lambda
Web Adapter. The settings the app reads are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ottonomy

ottonomy commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

The run.sh in the settings contract is a little human-unreadable.

This is the string here because the check finds each function's contract entry by its Handler. The shared contract planned across apps says the keys are handler strings exactly as the template gives them. verifier-plus's template says Handler: run.sh, so its key is run.sh.

Why use the handler as the key:

  • The template already has it. The check reads each function's Handler and looks it up in the contract, with nothing to map in between. A name like "lambda" would need a second link from the template function to that name, such as a new template field. Every product would have to keep that field in step, and the check would have to verify it.
  • It tells functions apart. verifier-plus has one function, but the LCW repos have several each. lcw-back-end's will be keys like lcw-login/index.handler, each with different settings. "lambda" only works for a repo with one function.
  • It's already fixed. Rule 12 in product design guidebook makes handler strings part of the app's interface, so changing one is already a breaking change. The key changes only when something else would break anyway.

@ottonomy
ottonomy merged commit c1092b6 into main Dec 1, 2026
4 checks passed
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