Skip to content

feat(agent): send devcontainer CLI logs during recreate #17845

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 6 commits into from
May 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
log
  • Loading branch information
mafredri committed May 15, 2025
commit abdd813fbabea04be3600f09c53979a3f6b6bc1a
9 changes: 9 additions & 0 deletions agent/agentcontainers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@
break
}
}
if api.devcontainerLogSourceIDs[devcontainer.WorkspaceFolder] == uuid.Nil {
api.logger.Error(api.ctx, "devcontainer log source ID not found for devcontainer",
slog.F("devcontainer", devcontainer.Name),
slog.F("workspace_folder", devcontainer.WorkspaceFolder),
slog.F("config_path", devcontainer.ConfigPath),
)
}
}
}
}
Expand All @@ -137,8 +144,8 @@
// interface.
type noopScriptLogger struct{}

func (noopScriptLogger) Send(ctx context.Context, log ...agentsdk.Log) error { return nil }

Check failure on line 147 in agent/agentcontainers/api.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (noopScriptLogger) Flush(ctx context.Context) error { return nil }

Check failure on line 148 in agent/agentcontainers/api.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)

// WithScriptLogger sets the script logger provider for devcontainer operations.
func WithScriptLogger(scriptLogger func(logSourceID uuid.UUID) ScriptLogger) Option {
Expand All @@ -164,6 +171,8 @@
configFileModifiedTimes: make(map[string]time.Time),
scriptLogger: func(uuid.UUID) ScriptLogger { return noopScriptLogger{} },
}
// The ctx and logger must be set before applying options to avoid
// nil pointer dereference.
for _, opt := range options {
opt(api)
}
Expand Down
Loading