Skip to content

ci: enforce devcontainer lockfile integrity - #1062

Merged
skevetter merged 2 commits into
mainfrom
devcontainer-spec/lockfile-integrity-ci
Aug 16, 2026
Merged

ci: enforce devcontainer lockfile integrity#1062
skevetter merged 2 commits into
mainfrom
devcontainer-spec/lockfile-integrity-ci

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Spec requirement

The devcontainer spec/reference CLI (@devcontainers/cli) supports a committed
devcontainer-lock.json to pin feature digests for reproducible builds, and exposes
--frozen-lockfile to enforce an existing lockfile: the build fails if the lockfile
is missing or its resolved digests no longer match the features declared in
devcontainer.json (lock drift).

Gap found

The repo commits .devcontainer/devcontainer-lock.json (4 pinned features: go-task,
prek, uv, node) for reproducibility, but the Devcontainer workflow
(.github/workflows/devcontainer.yml) only builds + runs the devcontainer via
devcontainers/ci. It never verifies the committed lockfile, so a stale/incorrect
lockfile would pass CI silently. The reference devcontainers/ci action exposes no
frozen-lockfile input, so enforcement must be a dedicated step.

Change

Add a Verify feature lockfile integrity step to the Devcontainer workflow that:

  1. Installs @devcontainers/cli.
  2. Runs devcontainer build --workspace-folder . --image-name devsy-lock-verify:tmp --frozen-lockfile.

If the committed lockfile is out of sync with the declared features, the frozen build
fails and the job goes red. No feature versions are bumped; no SHA is changed. The
existing devcontainers/ci build/run step is unchanged.

Verification performed

  • task cli:format — clean (no Go changes).
  • task cli:lint:ci — 0 new issues (--new-from-patch).
  • task cli:test — pass; only the documented pre-existing pkg/git (TestRepoClone*)
    failure on origin/main, unrelated to this change (workflow YAML only).
  • task cli:test:e2e:suite -- "devcontainer" — pass (0 devcontainer-labelled specs, no failures).
  • Positive control: devcontainer build --workspace-folder . --image-name dc-lock-verify:tmp --frozen-lockfile
    against the current committed lockfile → {"outcome":"success"}, exit 0.
  • Negative control: corrupting the uv feature digest in the lockfile and rerunning
    the frozen build → exit 1 (could not be processed), confirming the step catches drift.
    The lockfile was restored to its committed state afterward (no diff).

Expected impact

Lock drift introduced by a feature version bump without devcontainer-lock.json
regeneration is now caught in CI before merge, keeping reproducible devcontainer builds
trustworthy.

This PR was created by an AI agent as part of an automated daily devcontainer spec job.

## Spec requirement

The devcontainer spec/reference CLI (`@devcontainers/cli`) supports a committed
`devcontainer-lock.json` to pin feature digests for reproducible builds, and exposes
`--frozen-lockfile` to *enforce* an existing lockfile: the build fails if the lockfile
is missing or its resolved digests no longer match the features declared in
`devcontainer.json` (lock drift).

## Gap found

The repo commits `.devcontainer/devcontainer-lock.json` (4 pinned features: go-task,
prek, uv, node) for reproducibility, but the `Devcontainer` workflow
(`.github/workflows/devcontainer.yml`) only builds + runs the devcontainer via
`devcontainers/ci`. It never verifies the committed lockfile, so a stale/incorrect
lockfile would pass CI silently. The reference `devcontainers/ci` action exposes no
frozen-lockfile input, so enforcement must be a dedicated step.

## Change

Add a `Verify feature lockfile integrity` step to the `Devcontainer` workflow that:

1. Installs `@devcontainers/cli`.
2. Runs `devcontainer build --workspace-folder . --image-name devsy-lock-verify:tmp --frozen-lockfile`.

If the committed lockfile is out of sync with the declared features, the frozen build
fails and the job goes red. No feature versions are bumped; no SHA is changed. The
existing `devcontainers/ci` build/run step is unchanged.

## Verification performed

- `task cli:format` — clean (no Go changes).
- `task cli:lint:ci` — 0 new issues (`--new-from-patch`).
- `task cli:test` — pass; only the documented pre-existing `pkg/git` (`TestRepoClone*`)
  failure on origin/main, unrelated to this change (workflow YAML only).
- `task cli:test:e2e:suite -- "devcontainer"` — pass (0 devcontainer-labelled specs, no failures).
- **Positive control**: `devcontainer build --workspace-folder . --image-name dc-lock-verify:tmp --frozen-lockfile`
  against the current committed lockfile → `{"outcome":"success"}`, exit 0.
- **Negative control**: corrupting the `uv` feature digest in the lockfile and rerunning
  the frozen build → exit 1 (`could not be processed`), confirming the step catches drift.
  The lockfile was restored to its committed state afterward (no diff).

## Expected impact

Lock drift introduced by a feature version bump without `devcontainer-lock.json`
regeneration is now caught in CI before merge, keeping reproducible devcontainer builds
trustworthy.

This PR was created by an AI agent as part of an automated daily devcontainer spec job.
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh ready!

Name Link
🔨 Latest commit cdac21b
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a814a7332aa9a000823f15b
😎 Deploy Preview https://deploy-preview-1062--images-devsy-sh.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev ready!

Name Link
🔨 Latest commit cdac21b
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a814a735bde7a00089f9973
😎 Deploy Preview https://deploy-preview-1062--devsydev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter marked this pull request as ready for review August 16, 2026 20:39
@skevetter
skevetter merged commit abe7934 into main Aug 16, 2026
28 checks passed
@skevetter
skevetter deleted the devcontainer-spec/lockfile-integrity-ci branch August 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant