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

feat: support devcontainer agents in ui and unify backend#18332

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

Open
mafredri wants to merge17 commits intomain
base:main
Choose a base branch
Loading
frommafredri/feat-agent-devcontainer-injection-6
Open
Show file tree
Hide file tree
Changes fromall commits
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
355 changes: 190 additions & 165 deletionsagent/agentcontainers/api.go
View file
Open in desktop

Large diffs are not rendered by default.

180 changes: 112 additions & 68 deletionsagent/agentcontainers/api_test.go
View file
Open in desktop

Large diffs are not rendered by default.

69 changes: 57 additions & 12 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

69 changes: 57 additions & 12 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

16 changes: 7 additions & 9 deletionscoderd/workspaceagents_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1403,15 +1403,13 @@ func TestWorkspaceAgentRecreateDevcontainer(t *testing.T) {
agentcontainers.DevcontainerConfigFileLabel: configFile,
}
devContainer = codersdk.WorkspaceAgentContainer{
ID: uuid.NewString(),
CreatedAt: dbtime.Now(),
FriendlyName: testutil.GetRandomName(t),
Image: "busybox:latest",
Labels: dcLabels,
Running: true,
Status: "running",
DevcontainerDirty: true,
DevcontainerStatus: codersdk.WorkspaceAgentDevcontainerStatusRunning,
ID: uuid.NewString(),
CreatedAt: dbtime.Now(),
FriendlyName: testutil.GetRandomName(t),
Image: "busybox:latest",
Labels: dcLabels,
Running: true,
Status: "running",
}
plainContainer = codersdk.WorkspaceAgentContainer{
ID: uuid.NewString(),
Expand Down
25 changes: 11 additions & 14 deletionscodersdk/workspaceagents.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -393,12 +393,6 @@ func (c *Client) WorkspaceAgentListeningPorts(ctx context.Context, agentID uuid.
return listeningPorts, json.NewDecoder(res.Body).Decode(&listeningPorts)
}

// WorkspaceAgentDevcontainersResponse is the response to the devcontainers
// request.
type WorkspaceAgentDevcontainersResponse struct {
Devcontainers []WorkspaceAgentDevcontainer `json:"devcontainers"`
}

// WorkspaceAgentDevcontainerStatus is the status of a devcontainer.
type WorkspaceAgentDevcontainerStatus string

Expand All@@ -422,6 +416,15 @@ type WorkspaceAgentDevcontainer struct {
Status WorkspaceAgentDevcontainerStatus `json:"status"`
Dirty bool `json:"dirty"`
Container *WorkspaceAgentContainer `json:"container,omitempty"`
Agent *WorkspaceAgentDevcontainerAgent `json:"agent,omitempty"`
}

// WorkspaceAgentDevcontainerAgent represents the sub agent for a
// devcontainer.
type WorkspaceAgentDevcontainerAgent struct {
ID uuid.UUID `json:"id" format:"uuid"`
Name string `json:"name"`
Directory string `json:"directory"`
}

// WorkspaceAgentContainer describes a devcontainer of some sort
Expand DownExpand Up@@ -450,14 +453,6 @@ type WorkspaceAgentContainer struct {
// Volumes is a map of "things" mounted into the container. Again, this
// is somewhat implementation-dependent.
Volumes map[string]string `json:"volumes"`
// DevcontainerStatus is the status of the devcontainer, if this
// container is a devcontainer. This is used to determine if the
// devcontainer is running, stopped, starting, or in an error state.
DevcontainerStatus WorkspaceAgentDevcontainerStatus `json:"devcontainer_status,omitempty"`
// DevcontainerDirty is true if the devcontainer configuration has changed
// since the container was created. This is used to determine if the
// container needs to be rebuilt.
DevcontainerDirty bool `json:"devcontainer_dirty"`
}

func (c *WorkspaceAgentContainer) Match(idOrName string) bool {
Expand DownExpand Up@@ -486,6 +481,8 @@ type WorkspaceAgentContainerPort struct {
// WorkspaceAgentListContainersResponse is the response to the list containers
// request.
type WorkspaceAgentListContainersResponse struct {
// Devcontainers is a list of devcontainers visible to the workspace agent.
Devcontainers []WorkspaceAgentDevcontainer `json:"devcontainers"`
// Containers is a list of containers visible to the workspace agent.
Containers []WorkspaceAgentContainer `json:"containers"`
// Warnings is a list of warnings that may have occurred during the
Expand Down
41 changes: 39 additions & 2 deletionsdocs/reference/api/agents.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp