- Notifications
You must be signed in to change notification settings - Fork921
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 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
Instead of exec'ing `pwd` inside of the container, we instead read`WorkspaceFolder` from the outcome of `read-configuration`.
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.
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 {
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.
👍
d61353f
intomainUh oh!
There was an error while loading.Please reload this page.
Instead of exec'ing
pwd
inside of the container, we instead readWorkspaceFolder
from the outcome ofread-configuration
.