Repository navigation
build(deps): Let Dependabot recompile Lambda locks - #208
Open
andreameroni wants to merge 4 commits into
Open
andreameroni wants to merge 4 commits into
andreameroni wants to merge 4 commits into
Conversation
added 2 commits
November 17, 2026 21:07
Rename each Lambda requirements.txt source to requirements.in and each requirements.lock to requirements.txt. Dependabot's uv ecosystem only pairs .in sources with .txt outputs, and only then reruns uv pip compile, so the old names left the deployed Lambda pins outside Dependabot and outside the dependency graph. Add a uv entry for the nine Lambda directories with version updates off, so security updates use uv. Add a CI step that reruns compile.sh and fails when any lockfile changes.
A local Dependabot run showed that its uv pip compile runs inside each Lambda directory, so its "# via" lines name requirements.in and omit the workspace override note. Pins and hashes matched compile.sh, but the plain git diff failed every Dependabot PR.
added 2 commits
November 18, 2026 09:18
The frontend job only installs and audits frontend/web, so a Dependabot PR on frontend/infrastructure passed CI without its yarn.lock being installed. That directory builds the Lambda@Edge auth handler. The new job runs install --immutable, the high+ audit, lint, tests and build.
The drift check proves each lockfile matches compile.sh, but not that it installs. Install each one into a temp dir with the uv_target_args flags that CDK bundling uses, so a stale hash or a missing wheel for python3.13 on arm64 fails the PR instead of the deployment.
raphaho
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Lets Dependabot security updates regenerate the Lambda lockfiles that CDK deploys.
Each Lambda layer had a hand-edited
requirements.txtand arequirements.lockcompiled bybackend/scripts/compile.sh. Dependabot'suvecosystem only pairs arequirements.insource with arequirements.txtoutput, so it never saw the.lockfiles. No Dependabot alert has ever been raised against them, and every Lambda lockfile update was made by hand (#79, #123, #156). An alert onbackend/uv.lockcould close while the deployed Lambdas kept the vulnerable version (#150).requirements.txtbecomesrequirements.inandrequirements.lockbecomesrequirements.txt. Pins and hashes are unchanged; only the# viaand header comments differ.compile.sh,backend_app_function.py,shared_layer.py,test_runtime_stub_dependencies.py, the-rincludes and the backend README use the new names. The constructs readrequirements.txtdirectly instead of falling back from.lock..github/dependabot.ymladds auventry for the nine directories withopen-pull-requests-limit: 0, so only security updates open PRs.ci.ymladds a backend step that rerunscompile.shand fails when a lockfile changes outside comment lines.ci.ymladds a backend step that installs each Lambdarequirements.txtinto a temp dir with theuv_target_argsflags CDK bundling uses (python3.13, arm64). A stale hash or a missing wheel fails the PR.requirements-txt-fixeralso covers.infiles.ci.ymladds afrontend-infrastructurejob:yarn install --immutable, the high+ audit, lint, tests and build. Thefrontendjob only coveredfrontend/web, so a Dependabot PR onfrontend/infrastructurepassed CI without itsyarn.lockbeing installed.Type of change
How was this tested?
uv run pytest app -n auto: 2854 passed.pytest app/shared/tests/test_runtime_stub_dependencies.py infra/constructs/tests: 49 passed, same as onmain. Removing a stub pin from a Lambdarequirements.txtfails the stub test.dependabot-updater-uvimage and simulated advisories, on this branch:/backend/app/shared: PR created,requirements.txtregenerated withuv pip compile --generate-hashes --python-version=3.13 -P certifi requirements.in.requirements.inraised from~= 2.12to~= 2.16andrequirements.txtregenerated.compile.shoutput, and the CI drift step passes on both.mainreturnssecurity_update_dependency_not_found..infile changes without a recompile and when a package is removed from a lockfile.frontend/infrastructure: install, audit, lint, build andyarn test:ci(78 tests) pass locally.Checklist
CONTRIBUTING.mdNotes for reviewers
# vialines namerequirements.ininstead ofapp/shared/requirements.in.Acknowledgment
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.