Skip to content

Graduate lockfile from experimental to stable#1212

Open
brooke-hamilton wants to merge 9 commits intodevcontainers:mainfrom
brooke-hamilton:brooke-hamilton/graduate-lockfile
Open

Graduate lockfile from experimental to stable#1212
brooke-hamilton wants to merge 9 commits intodevcontainers:mainfrom
brooke-hamilton:brooke-hamilton/graduate-lockfile

Conversation

@brooke-hamilton
Copy link
Copy Markdown
Contributor

This pull request graduates the lockfile feature from experimental to stable. Lockfiles are now generated by default during build and up commands to ensure reproducible builds. New CLI flags (--no-lockfile and --frozen-lockfile) are introduced for more explicit control, while the old experimental flags are deprecated but still accepted with warnings.

Lockfile Feature Graduation and CLI Changes:

  • Lockfiles (.devcontainer-lock.json) are now generated by default on build and up, pinning feature versions for reproducibility. [1] [2]
  • Added new CLI flags: --no-lockfile (disables lockfile generation/verification) and --frozen-lockfile (enforces lockfile existence and immutability). Deprecated --experimental-lockfile and --experimental-frozen-lockfile with warnings. [1] [2] [3] [4] [5] [6]
  • Enforced mutual exclusivity between lockfile-related flags at the CLI layer, throwing errors for invalid combinations. [1] [2]

Documentation and Tooling:

  • Updated README.md and CHANGELOG.md to reflect lockfile graduation and new CLI behavior. [1] [2]
  • Improved test instructions in docs/contributing-code.md to clarify packaging requirements before running tests.
  • Added the Mocha test adapter extension to the devcontainer for better test integration in VS Code.
  • Added a new test config for lockfile opt-out.

This PR closes issue #1195
There are no spec changes in this PR, but there is a related proposal at devcontainers/spec#727

Signed-off-by: Brooke Hamilton <[email protected]>
Signed-off-by: Brooke Hamilton <[email protected]>
Signed-off-by: Brooke Hamilton <[email protected]>
@brooke-hamilton brooke-hamilton requested a review from a team as a code owner April 26, 2026 23:05
Copy link
Copy Markdown
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! Really just one question: The two experimental properties are no longer needed in code, it seems?

Comment thread src/spec-configuration/containerFeaturesConfiguration.ts Outdated
Comment thread src/spec-configuration/lockfile.ts Outdated
@brooke-hamilton
Copy link
Copy Markdown
Contributor Author

@chrmarti please look at my most recent commit that adds .gitignore files to the test config folders. Many of the tests now generate new lockfiles because that is now the default. I added two .gitignore files to prevent a scenario in which the lockfile is committed to the repo and an upstream feature label moves, causing the lockfile to be unexpectedly regenerated.

This could cause confusion for developers who run a test and see the lockfile changed, giving a false indication that their code change caused the lockfile to change.

I found this when running tests unrelated to the lockfile tests.

The downside is that intentionally adding a lockfile to these folders requires an explicit git add --force command.

Comment thread src/spec-node/devContainersSpecCLI.ts Outdated
if (experimentalLockfile) {
process.stderr.write('Warning: --experimental-lockfile is deprecated. Lockfiles are now enabled by default.\n');
}
if (experimentalFrozenLockfile) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to this PR, but we should refactor these to avoid the duplicate logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thank you!

abdurriq
abdurriq previously approved these changes May 5, 2026
chrmarti
chrmarti previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Could you resolve the merge conflict? Otherwise ready for merging. Thanks!

…ate-lockfile

Bring in the 0.86.1 fix that excludes `--additional-features`-only
features from the lockfile, and integrate it with the lockfile
graduation work on this branch.

Conflict resolution:
- src/spec-configuration/containerFeaturesConfiguration.ts:
  Drop the `initLockfile` argument from the `writeLockfile` call.
  The graduation work removed `forceInitLockfile` from
  `writeLockfile` and `initLockfile` from `readLockfile`'s return,
  so the incoming reference no longer compiles. The remaining
  `generateLockfile(featuresConfig, config, additionalFeatures)`
  call from main is preserved inside the `!params.noLockfile` guard.

Other reconciliations:
- package.json: keep 0.87.0 (graduation release) instead of 0.86.1
  so the version reflects the graduation feature set being shipped.
- CHANGELOG.md: move the 0.87.0 graduation entry under "May 2026"
  and nest the 0.86.1 bullet beneath it for historical accuracy.

Signed-off-by: Brooke Hamilton <[email protected]>
@brooke-hamilton brooke-hamilton dismissed stale reviews from chrmarti and abdurriq via 34a4b0f May 6, 2026 13:11
Signed-off-by: Brooke Hamilton <[email protected]>
@brooke-hamilton
Copy link
Copy Markdown
Contributor Author

LGTM! Could you resolve the merge conflict? Otherwise ready for merging. Thanks!

Done. I also made an additional edit to the CHANGELOG.md file and I bumped the version in package.json.

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.

3 participants