- Notifications
You must be signed in to change notification settings - Fork906
feat(cli): support opening devcontainers in vscode#17189
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
de4e8ca
toc29d517
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for opening development containers in VS Code via the CLI. Key changes include:
- Updating the CLI documentation to include a new flag (-c, --container) for specifying the container name.
- Adding tests to cover various scenarios for opening VS Code in dev container mode.
- Updating the CLI command implementation to handle container-based logic and URL link generation for dev containers.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
docs/reference/cli/open_vscode.md | Added documentation for the new container flag. |
cli/open_test.go | Introduced new tests for dev container support and behavior. |
cli/open.go | Implemented container flag handling and URL building tailored for dev containers. |
Files not reviewed (1)
- cli/testdata/coder_open_vscode_--help.golden: Language not supported
Comments suppressed due to low confidence (1)
cli/open.go:145
- Consider including the specified container name in the error message (e.g., 'no container found matching ') for improved clarity.
if (!foundContainer) {
fe73989
toe8479f6
Comparee8479f6
to9cc49f8
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice tests!
cli/open.go Outdated
if !ok { | ||
return xerrors.New("container missing `devcontainer.local_folder` label") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This shouldn't happenin theory, but no harm to check.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
- Invert an if-condition to reduce how nested the code was.- Hide `-c` flag for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice change and tests!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
aa3d71d
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#16427
Adds the option
-c,--container
toopen vscode
that allows opening VSCode into a running devcontainer.