Repository navigation
build(deps): pin every image tool in a Dependabot-managed lockfile - #123
Merged
Merged
Conversation
- Dockerfile takes every tool version from a file Dependabot updates: node and terraform from FROM lines (terraform now from its official image, not HashiCorp's apt repo), aws-cdk and lstk from docker/tools/npm/package-lock.json, SAM CLI and Snowflake CLI from hashed pip-compile lockfiles (SAM leaves its installer zip), and dockerode from the root yarn.lock instead of an ad-hoc npm install. - dependabot.yml covers npm (image tools, CDK sample), pip, docker and github-actions. - CI installs with --frozen-lockfile, like the image; the Docker workflow also runs on docker/** and data/** changes, and PRs get a native arm64 build and smoke test. - src/core/dependency-pins.test.ts keeps the node major in step across the Dockerfile, workflows and esbuild target, and rejects installs that bypass a lockfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SAM CLI and Snowflake CLI become one uv project each (pyproject.toml + uv.lock), replacing the pip-compile requirements files and the Docker-based compile script. Both set `exclude-newer = "1 week"`, so Snowflake CLI is pinned at 3.33.0 until 3.34.0 is a week old. - The Dockerfile installs them with `uv sync --locked --no-build` from a build-time mount of ghcr.io/astral-sh/uv (pinned in a FROM line), which is 6-7x faster than pip and keeps uv out of the image. - dependabot.yml uses the uv ecosystem for them and a 7-day cooldown on every entry, matching exclude-newer as the uv Dependabot guide advises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lease Fold the PR-only arm64 job into the smoke job as an amd64/arm64 matrix, so both legs share the same steps and the release push waits for both. The integration test stays on amd64. Pin every runner in docker.yml and ci.yml to ubuntu-26.04 (what ubuntu-latest resolves to today), and drop the unused CI_LOCALSTACK_AUTH_TOKEN job env. The pin test now checks that all these runners share one Ubuntu release and that an arm64 runner exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joe4dev
marked this pull request as ready for review
November 18, 2026 16:06
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.
Summary
Every tool in the Docker image now gets its version from one file that Dependabot updates. Where CI and the image share a dependency, they read it from the same pin. Every Dependabot entry waits 7 days after a release (
cooldown), following uv's Dependabot guide.node:22-bookworm-slim(floating)node:22.23.5-bookworm-slim, both stagesdocker(majors by hand, see below)FROM hashicorp/terraform:1.17.2, static binary copied indockeraws-cdk,lstknpm i -g aws-cdk@2.1145.0 @localstack/lstk@1.4.2npm cifromdocker/tools/npm/package-lock.jsonnpmARGversion + SHA-256docker/tools/sam(pyproject.toml+uv.lock),uv sync --lockedinto its own venvuvpip install snowflake-cli==3.34.0(transitive deps unpinned)docker/tools/snowflake, same as SAMuvFROM ghcr.io/astral-sh/uv:0.13.9, mounted into theRUNsteps, not in the imagedockerdockerodeand other server depsnpm install dockerode@5.0.1, outsideyarn.lockyarn install --production --frozen-lockfile, the sameyarn.lockCI tests withnpm(existing)data/sample-cdk)npmsetup-node@v2in one job,@v4elsewhere)@v4everywheregithub-actionsTool versions are unchanged except Snowflake CLI: Terraform 1.17.2, SAM CLI 1.172.1, aws-cdk 2.1145.0, lstk 1.4.2, Node 22.23.5. Snowflake CLI goes from 3.34.0 to 3.33.0: 3.34.0 was published on 2026-11-17, inside the one-week
exclude-newerwindow, so Dependabot proposes it after the cooldown.Notes on the choices:
ARG. Each CLI is its own project with its own venv, because theirrichpins conflict (see ci(docker): speed up the image build #121).uv.lockis a universal lock with hashes;requires-python = "==3.11.*"matches the image's Debian Python. The image installs withuv sync --locked --no-install-project --no-build --python /usr/bin/python3, usingUV_PYTHON_DOWNLOADS=0andUV_LINK_MODE=copyper uv's Docker guide. uv verifies the lock hashes,--no-buildrefuses source builds, and uv handlesboto3'sbotocore[crt]extra (awscrtis installed).exclude-newer = "1 week"plus a 7-day cooldown. uv only locks releases at least a week old, and Dependabot only proposes such releases, so its PRs never ask for a version uv refuses to lock. The relative span is stored inuv.lock(exclude-newer-span = "P1W"), souv sync --lockedkeeps accepting the lock as time passes. The cooldown is on every Dependabot entry, including the existing root npm one; it delays version updates only, not security updates.uv lockin the tool's directory. No Docker container or pip-tools needed.node-version: 22.xand esbuild uses--target=node22, and Dependabot can update neither. Dependabot therefore ignores node majors, and the newsrc/core/dependency-pins.test.tsfails if the Dockerfile's node major differs from them. CI floats within 22.x; the image is exactly 22.23.5.smokejob is a matrix: amd64 onubuntu-26.04, arm64 onubuntu-26.04-arm, with the same build and MCP startup steps. arm64 catches arm64-only breakage, such as a locked Python package without an arm64 wheel, before the multi-arch push builds it under QEMU. The arm64 leg runs on PRs, pushes to main and tags, andpushwaits for both legs. The integration test stays on amd64: its deploys take minutes and do not depend on the image's architecture. Every runner indocker.ymlandci.ymlis pinned toubuntu-26.04, which is whatubuntu-latestresolves to today, so this changes no OS.azure-smoke.ymlstays onubuntu-latest, which it relies on for the Azure CLI.npm install,npx,pip install,uv pip install,uv syncwithout--locked, versionARGs) and plainyarninstalls in workflows. It also requires every runner indocker.ymlandci.ymlto name the same Ubuntu release, either as a literal label or through${{ matrix.runner }}, and requires an arm64 runner.Evidence
Uncached local builds on an Apple Silicon Mac (Docker Desktop; amd64 is emulated), compared with
mainafter #121:maindocker save(arm64 / amd64)Installing the same locked set into a fresh venv takes pip 15.2 s and uv 2.3 s for SAM CLI, and pip 8.9 s and uv 1.3 s for Snowflake CLI (arm64). The image shrinks because SAM no longer ships its own bundled Python. The amd64 timing reused the arm64 build's uv cache mount for platform-independent wheels. CI builders start cold.
Same behaviour on both images:
sam buildsucceeds for a python3.11 function (withrequests) and a nodejs22.x function (withlodash).snow --versionworks as root, as--user 1000, and with--read-only.awscrt(thebotocore[crt]extra).lstkresolves the right platform package on each arch.tests/docker/validate-image.mjswith the CI smoke settings:tools/list exposes all 15 tools.yarn testpasses 420/420, including the 5 new pin tests. Each of these makes a pin test fail as intended: reverting oneci.ymlinstall to plainyarn, moving the arm64 runner to 24.04, setting a runner back toubuntu-latest, and computing a runner with an expression.An adversarial review agent checked the change against dependabot-core's source:
FROM --platform=… AS …parsing;directoriescombined with groups.It also found the unfrozen
yarninstalls in CI, the missing arm64 PR build and the too-narrow path filter, all fixed here. A second review of the matrix found no blockers. It checked thatubuntu-24.04-armrunners already passed in this repo, and thatmainrequires no status checks, so the renamed checkssmoke (amd64)andsmoke (arm64)cannot block merges. It also found thatubuntu-latestalready resolves to 26.04, so pinning 24.04 would have been a downgrade, and that the job-levelCI_LOCALSTACK_AUTH_TOKENwas unused and would have reached the arm64 leg. Both are fixed. Dependabot PRs getLOCALSTACK_AUTH_TOKEN: the repo already has it as a Dependabot secret, so the integration test still runs real deploys.Merge Danger
Door: two-way
Blast Radius: Docker image users, CI, maintainers (more Dependabot PRs)
sam buildbehaves the same in the checks above.exclude-newer. The first uv Dependabot run will show whether both projects update cleanly.smoke (arm64)runs in parallel with amd64 and takes about 2–3 minutes, less than the amd64 leg, so it adds no wall-clock time. It also runs before releases.smokebecomessmoke (amd64)andsmoke (arm64). No ruleset or branch protection requires them.runs-onlabels. Moving to a new Ubuntu release means editingdocker.ymlandci.ymltogether; the pin test enforces it.aws-cdk(the CLI in the image) andaws-cdk-lib(the sample) live in different directories, so they can arrive in separate PRs. A newaws-cdk-libthat needs a newer CLI fails the CDK deploy in the integration test until the CLI PR lands.data/sample-terraform(~> 5.0, no committed lock), and base image digests (uv's Docker guide recommends a digest for reproducibility; all three images use tags for now).🤖 Generated with Claude Code