Closed
Description
Exploring more widespread usage of features as they are implemented today a couple of interesting scenarios came up:
- Feature writing feels a little more complicated than it feels it should be. Some features that exist today have checks or code to guard against the features not executing in a predictable manner. This also complicates having features like user creation that a user could define as the first or last part of the execution.
- The more atomic a feature was the easier it was to reuse it in different scenarios.
- Allow features to be referenced multiple times in a devcontainer.json so that it's possible to execute them multiple times with different parameters. Situations came up where it would have been useful to execute a feature multiple times to install multiple versions of an sdk. This would also simplify the feature itself, avoiding the need to write it in a way that can loop.
- Having the feature source code in a repository also allowed for faster iteration and can even help with using features to implement repo specific scripts.
Proposal
Thinking of this situation the proposal is:
- Convert features in devcontainer.json to an array so that it's possible to control the order of execution and to define multiple executions of the same feature.
- Add a source marker to the feature, that would allow the source code of the feature be part of the repository or the filesystem.
- Make features more independent, meaning all code is in the same folder (or subfolders).
- Define a
feature.json
, similar to how GitHub Actions work, where we could eventually support different ways features could be executed besides theinstall.sh
supported today.
Questions
I think the biggest question is to define how we want to handle backwards compatibility with the way features are implemented and defined today.