Implement feature installation order and enhance test suite#500
Open
prulloac wants to merge 4 commits intocoder:mainfrom
Open
Implement feature installation order and enhance test suite#500prulloac wants to merge 4 commits intocoder:mainfrom
prulloac wants to merge 4 commits intocoder:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for devcontainer Feature installation ordering semantics, including a user-specified override order and dependency metadata read from devcontainer-feature.json, and extends the test suite and docs accordingly.
Changes:
- Add
overrideFeatureInstallOrdertodevcontainer.Specand implement order resolution (resolveInstallOrder) plus dependency validation (validateDependencies). - Extend
devcontainer/features.Specto parseinstallsAfter(soft ordering) anddependsOn(hard dependency). - Add tests covering override ordering,
installsAfterbehavior, hard-dependency presence validation, and cycle detection; update spec support documentation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/devcontainer-spec-support.md | Updates documented support matrix for devcontainer properties/features. |
| devcontainer/features/features.go | Adds JSON fields for installsAfter and dependsOn to feature metadata parsing. |
| devcontainer/devcontainer.go | Implements feature extraction pre-pass, install-order resolution, and hard dependency validation. |
| devcontainer/devcontainer_test.go | Adds tests for override ordering, installsAfter ordering, dependsOn validation, and cycle detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request implements support for advanced feature installation ordering in devcontainer specs, aligning with the devcontainer spec's installation order semantics. It introduces the ability to control feature installation order via the new
overrideFeatureInstallOrderproperty, supports soft and hard feature dependencies (installsAfteranddependsOn), and ensures proper validation and error handling for dependency cycles and missing hard dependencies. Comprehensive tests are added to verify correct behavior in various scenarios.Feature installation ordering and dependency management:
overrideFeatureInstallOrderproperty to theSpecstruct indevcontainer.go, allowing users to explicitly specify the installation order of features. Features not listed are installed alphabetically after the specified ones.resolveInstallOrderfunction, which determines the final installation order by prioritizing user overrides, then honoringinstallsAfter(soft dependencies) via topological sort, and finally breaking ties alphabetically for determinism. Detects cycles and returns errors if found.validateDependenciesfunction to enforce that all hard dependencies (dependsOn) declared by features are satisfied, returning an error if any required feature is missing.features.Specstruct to includeInstallsAfterandDependsOnfields, representing soft and hard dependencies, respectively.Testing and documentation:
devcontainer_test.goto verify correct feature installation order, handling of overrides, soft and hard dependencies, cycle detection, and proper error reporting.devcontainer-spec-support.mdto reflect support foroverrideFeatureInstallOrder,dependsOn, andinstallsAfter. [1] [2]Solves #226