Add extends property for configuration inheritance - #772
Draft
Sam Frost (SamuelFrost) wants to merge 1 commit into
Draft
Sam Frost (SamuelFrost) wants to merge 1 commit into
Sam Frost (SamuelFrost) wants to merge 1 commit into
Conversation
Document and schema-enable the extends keyword from devcontainers#22, merging referenced files with the existing image metadata merge logic.
|
Sam Frost (@SamuelFrost) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
(note for reviewers: this is vibe coded based off the existing PR and issues. I have not reviewed it yet beyond minimal local testing-- hence the draft status)
Summary
Teams sharing a codebase often need slightly different
devcontainer.jsonsettings without copying the whole file. Issue #22 (labeledfinalization) proposed anextendsproperty for that.This PR adds
extendsto the schema anddevcontainer.jsonreference so one configuration can inherit another JSON or JSONC file in the same repository.Companion Dev Container CLI implementation: devcontainers/cli#1306
Property
extendsextendsproperty is not present in the merged result.Changes
extendstoschemas/devContainer.base.schema.json.devcontainer.jsonreference, using the examples from Addition of "extends" top level property to enable simple configuration inheritance #22.extendsuses the same merge rules as image metadata (forwardPortsunion,hostRequirementsmax, last-wins for scalars, and so on).Technical choices
Issue #22 originally described Docker Compose–style deep merge. Review of CLI PR #311 (Christof Marti, Josh Spicer, Chuck Lantz) settled on the image metadata merge logic so inheriting a file and reusing a prebuilt image behave the same way. This spec change matches that.
Nested
extendsis allowed; cycles, absolute paths, and URLs are not. Cross-repository references are left as future work, as in #22.Follow-up
CONTRIBUTING.mdalso asks for a PR against the devcontainer.json reference in vscode-docs once maintainers are on board.Finalizes #22.