Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(agent/agentcontainers): read WorkspaceFolder from config #18467

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

DanielleMaywood
Copy link
Contributor

Instead of exec'ing pwd inside of the container, we instead read WorkspaceFolder from the outcome of read-configuration.

Instead of exec'ing `pwd` inside of the container, we instead read
`WorkspaceFolder` from the outcome of `read-configuration`.
Copy link
Contributor

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

This PR replaces the execution of "pwd" inside containers with reading the workspace folder from the container configuration, thereby aligning the implementation with the new configuration-based approach.

  • Introduces a new Workspace field (of type DevcontainerWorkspace) in the devcontainer configuration.
  • Updates tests to expect the workspace folder from configuration and adjusts label paths accordingly.
  • Removes legacy exec-based workspace folder detection from the API logic.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
agent/agentcontainers/devcontainercli.go Adds the Workspace field and its corresponding type to support configuration-based workspace retrieval.
agent/agentcontainers/api_test.go Updates test expectations by removing assertions on exec-based "pwd" detection and adjusting folder labels.
agent/agentcontainers/api.go Removes exec-based folder detection and assigns the workspace folder from configuration.
Comments suppressed due to low confidence (2)

agent/agentcontainers/api.go:1150

  • Consider adding tests for cases where config.Workspace.WorkspaceFolder might be empty to ensure that the default workspace folder is used as a fallback.
			workspaceFolder = config.Workspace.WorkspaceFolder

agent/agentcontainers/api_test.go:1328

  • Verify that the removal of exec-based checks does not leave any gaps in test coverage for the workspace folder initialization; additional tests may be required to cover this new configuration flow.
		testutil.RequireSend(ctx, t, fakeDCCLI.readConfigErrC, func(envs []string) error {

@DanielleMaywood DanielleMaywood marked this pull request as ready for review June 20, 2025 12:42
@DanielleMaywood DanielleMaywood requested a review from johnstcn June 20, 2025 12:43
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

👍

@DanielleMaywood DanielleMaywood merged commit d61353f into main Jun 20, 2025
38 checks passed
@DanielleMaywood DanielleMaywood deleted the dm-devcontainer-workspace-folder branch June 20, 2025 15:34
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants