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(agent): start devcontainers through agentcontainers package#18471

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

Draft
DanielleMaywood wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromdm-devcontainer-log-spam

Conversation

DanielleMaywood
Copy link
Contributor

Fixescoder/internal#706

Context for the implementation here
coder/internal#706 (comment)

Synchronously starts dev containers defined in terraform with ourDevcontainerCLI abstraction, instead of piggybacking off of ouragentscripts package. This gives us more control over logs, instead of being reliant on packages which may or may not exist in the user-provided image.

Fixescoder/internal#706Context for the implementation herecoder/internal#706 (comment)Synchronously starts dev containers defined in terraform with our`DevcontainerCLI` abstraction, instead of piggybacking off of our`agentscripts` package. This gives us more control over logs, instead ofbeing reliant on packages which may or may not exist in theuser-provided image.
Copy link
Contributor

@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 refactors how devcontainers are started by splitting out the devcontainer CLI functionality from the agentscripts package. Key changes include removing post start scripts from agentscripts, updating tests to reference new expected outputs and behavior, and updating the API to synchronously trigger devcontainer creation via a new CreateDevcontainer method.

Reviewed Changes

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

Show a summary per file
FileDescription
agent/agentscripts/agentscripts_test.goRemoved tests for post-start scripts and updated expectations.
agent/agentscripts/agentscripts.goRefactored to remove runnerScript and post start script logic.
agent/agentcontainers/testdata/devcontainercli/parse/up.expectedUpdated expected log output for devcontainer CLI.
agent/agentcontainers/devcontainercli_test.goUpdated test file references to expected log output file.
agent/agentcontainers/devcontainercli.goUpdated option defaults and logging writer behavior.
agent/agentcontainers/devcontainer_test.goEntire file removed, reflecting changes in devcontainer handling.
agent/agentcontainers/devcontainer.goRemoved devcontainer script extraction helper functions.
agent/agentcontainers/api.goModified recreateDevcontainer to return errors and added CreateDevcontainer.
agent/agent.goRemoved legacy handling of experimental devcontainers and added calls to containerAPI.CreateDevcontainer.
Comments suppressed due to low confidence (1)

@@ -401,6 +408,7 @@ func (l *devcontainerCLILogWriter) Write(p []byte) (n int, err error) {
}
if logLine.Level >= 3 {
l.logger.Info(l.ctx, "@devcontainer/cli", slog.F("line", string(line)))
_, _ = l.writer.Write([]byte(logLine.Text + "\n"))
Copy link
Preview

CopilotAIJun 20, 2025

Choose a reason for hiding this comment

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

It might be beneficial to check the error returned by l.writer.Write rather than ignoring it. Handling any potential write failure could improve the reliability of the logging.

Suggested change
_,_=l.writer.Write([]byte(logLine.Text+"\n"))
if_,err:=l.writer.Write([]byte(logLine.Text+"\n"));err!=nil {
l.logger.Error(l.ctx,"failed to write to log writer",slog.Error(err),slog.F("text",logLine.Text))
}

Copilot uses AI. Check for mistakes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

@DanielleMaywoodDanielleMaywood

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Devcontainers: Decrease log spam from running @devcontainers/cli
1 participant
@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp