Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional features (feature groups). #502

Open
Softyy opened this issue Oct 1, 2024 · 0 comments
Open

Optional features (feature groups). #502

Softyy opened this issue Oct 1, 2024 · 0 comments

Comments

@Softyy
Copy link

Softyy commented Oct 1, 2024

[Proposal] Optional features (feature groups)

One of the shortcomings I've encountered is allowing for slight differences in ci workflows vs local workflows. I was thinking of adding an additional property to the devcontainer-feature.json spec that would allow for
grouping features between the two environments. Namely, allow for a subset of features to be used in ci workflows via cli flags.

Proposal

Extend the devcontainer-feature.json spec with the following property:

Property Type Description
group string Optional Metadata used for excluding this feature.

Example

Consider a devcontainer used for maintaining a gitops related repo. Locally one requires secret management and some manual handling tools, but in CI these tools are not required. A user would mark the features not needed for CI via a group named local. Ref:

devcontainer.json

{
	...
	"features": {
		"ghcr.io/devcontainers/features/aws-cli:1": {"group": "local"},
		"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {"group": "local"},
		"ghcr.io/devcontainers-contrib/features/sops:1": {"group": "local"},
		"ghcr.io/devcontainers/features/node:1": {
			"version": "lts"
		}
	},
	...
}

When it comes to starting the devcontainer locally, there would be no change to existing behaviour. In CI, one would pass in the flag:

> devcontainer up --exclude-group local

This would spin up the devcontainer without the features in the local group.

Plan

I don't mind putting up a couple PRs across the various repo's (cli , ci) to make this a reality, but I'm looking for a green light on the work before I put in the time. Anyhow, I'm open to any feedback, e.g. make the system more extensible with include and exclude or whatever.

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

No branches or pull requests

1 participant