Skip to content

Implement feature installation order and enhance test suite#500

Open
prulloac wants to merge 5 commits intocoder:mainfrom
prulloac:main
Open

Implement feature installation order and enhance test suite#500
prulloac wants to merge 5 commits intocoder:mainfrom
prulloac:main

Conversation

@prulloac
Copy link

@prulloac prulloac commented Mar 9, 2026

This pull request introduces support for the installsAfter and dependsOn fields in the devcontainer feature specification, enabling both soft and hard dependencies between features. It also adds comprehensive internal tests to validate feature installation order logic, and updates documentation to reflect the new support status for these fields.

Feature dependency support:

  • Added InstallsAfter (soft dependency) and DependsOn (hard dependency) fields to the Spec struct in features.go, allowing features to specify installation order preferences and requirements.

Testing improvements:

  • Introduced devcontainer/install_order_internal_test.go with detailed tests covering canonical reference resolution, ambiguity handling, and correct enforcement of install order constraints, including interactions with pinned and free features.

Documentation updates:

  • Updated docs/devcontainer-spec-support.md to mark overrideFeatureInstallOrder, dependsOn, and installsAfter as supported (with the appropriate status icon), reflecting the new implementation. [1] [2]

@prulloac prulloac marked this pull request as ready for review March 9, 2026 22:20
Copilot AI review requested due to automatic review settings March 9, 2026 22:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 overrideFeatureInstallOrder to devcontainer.Spec and implement order resolution (resolveInstallOrder) plus dependency validation (validateDependencies).
  • Extend devcontainer/features.Spec to parse installsAfter (soft ordering) and dependsOn (hard dependency).
  • Add tests covering override ordering, installsAfter behavior, 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.

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.

2 participants