Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: improveopenDevContainer support with local workspace folder#544

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

Merged

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedJul 1, 2025
edited
Loading

This change allowslocalWorkspaceFolder andlocalConfigFile to be
provided which allows us to usedev-container rather than
attached-container to enter enabling all dev container features like
file change detection and rebuilding.

Example open URL:

vscode://coder.coder-remote/openDevContainer?owner=mafredri&workspace=magenta-rat-8&agent=dev&devContainerName=boring_shaw&devContainerFolder=/workspaces/coder&localWorkspaceFolder=/home/coder/coder&localConfigFile=/home/coder/coder/.devcontainer/devcontainer.json

This change allows `localWorkspaceFolder` and `localConfigFile` to beprovided which allows us to use `dev-container` rather than`attached-container` to enter enabling all dev container features likefile change detection and rebuilding.
@mafredrimafredri requested a review fromCopilotJuly 1, 2025 16:38
Copy link

@CopilotCopilotAI 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

This PR enhances the/openDevContainer command to accept local paths, enabling full dev-container features when a local workspace folder and config file are provided.

  • AddlocalWorkspaceFolder andlocalConfigFile query parameters inextension.ts
  • ExtendCommands to forward new parameters and adjustopenDevContainer behavior
  • UpdateCHANGELOG.md to document the new support

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
src/extension.tsRead, validate, and forwardlocalWorkspaceFolder &localConfigFile
src/commands.tsAccept new CLI args, include hostPath/configFile, choose container type
CHANGELOG.mdDocument unreleased support for hostPath and configFile
Comments suppressed due to low confidence (1)

src/commands.ts:751

  • Add unit or integration tests covering scenarios with and withoutlocalWorkspaceFolder andlocalConfigFile to ensure correct authority strings and request payloads.
async function openDevContainer(

mafredri added a commit to coder/coder that referenced this pull requestJul 1, 2025
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

I really don't know enough about dev containers or this extensions code to feel comfortable approving, but I did have a couple notes

Comment on lines 634 to 635
constlocalWorkspaceFolder=args[5]asstring|undefined;
constlocalConfigFile=args[6]asstring|undefined;
Copy link
Member

Choose a reason for hiding this comment

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

I know this isn't a new thing you're doing but ???

why does this function not just take named arguments??? I really wish someone had left a justification in a comment.

).toString("hex");
constdevContainerAuthority=`attached-container+${devContainer}@${remoteAuthority}`;

consttype=!!localWorkspaceFolder ?"dev-container" :"attached-container";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
consttype=!!localWorkspaceFolder ?"dev-container" :"attached-container";
consttype=localWorkspaceFolder ?"dev-container" :"attached-container";

as the linter is saying, this does nothing

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Haha, I fixed this locally but it didn't get pushed. I know it doesn't matter in the context, but it justfeels better you know, some habits die hard. 😄

@aslilac
Copy link
Member

tested locally and this diff seems to work fine. could we sneak it in here?

diff --git a/src/commands.ts b/src/commands.tsindex c1d49f9..375bca4 100644--- a/src/commands.ts+++ b/src/commands.ts@@ -620,18 +620,18 @@ export class Commands {  *  * Throw if not logged into a deployment.  */-public async openDevContainer(...args: string[]): Promise<void> {+public async openDevContainer(+workspaceOwner: string,+workspaceName: string,+workspaceAgent: string,+devContainerName: string,+devContainerFolder: string,+): Promise<void> { const baseUrl = this.restClient.getAxiosInstance().defaults.baseURL; if (!baseUrl) { throw new Error("You are not logged in"); }-const workspaceOwner = args[0] as string;-const workspaceName = args[1] as string;-const workspaceAgent = args[2] as string;-const devContainerName = args[3] as string;-const devContainerFolder = args[4] as string;- await openDevContainer( baseUrl, workspaceOwner,

you can add your new arguments to the end as optional

mafredri reacted with thumbs up emoji

@mafredrimafredriforce-pushed themafredri/fix-open-devcontainer-with-all-features branch fromf79393a to086ec55CompareJuly 2, 2025 08:33
@mafredri
Copy link
MemberAuthor

@aslilac made the proposed changes 👍🏻

aslilac reacted with heart emoji

@mafredri
Copy link
MemberAuthor

I really don't know enough about dev containers or this extensions code to feel comfortable approving, but I did have a couple notes

Understandable. 👍🏻

@DanielleMaywood researched this topic in the past and came to the conclusion thatdev-container creates a new one, andattached-container works as we want. However, we recently discovered thatattached-container is likely meant for attaching to a Docker container that's not necessarily a Dev Container since the VS Code extension disables some features.

These APIs are totally undocumented and have been reverse-engineered. With some additional effort we discovered thatdev-container can be used to attach to a running dev container given the right inputs.

More context at:coder/coder#16426 (comment)

@mafredrimafredri changed the titlefix: improve /openDevContainer support with local workspace folderfix: improveopenDevContainer support with local workspace folderJul 2, 2025
Copy link
Collaborator

@DanielleMaywoodDanielleMaywood left a comment

Choose a reason for hiding this comment

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

Works on my machine ™️, LGTM!

Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

thanks for the context 😄

@mafredrimafredri merged commite0adfb8 intomainJul 2, 2025
2 checks passed
@mafredrimafredri deleted the mafredri/fix-open-devcontainer-with-all-features branchJuly 2, 2025 17:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@aslilacaslilacaslilac approved these changes

@DanielleMaywoodDanielleMaywoodDanielleMaywood approved these changes

@code-ashercode-asherAwaiting requested review from code-asher

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mafredri@aslilac@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp