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

Commit97474bb

Browse files
authored
feat: support devcontainer agents in ui and unify backend (#18332)
This commit consolidates two container endpoints on the backend and improves thefrontend devcontainer support by showing names and displaying apps asappropriate.With this change, the frontend now has knowledge of the subagent and we can alsodisplay things like port forwards.The frontend was updated to show dev container labels on the border as well assubagent connection status. The recreation flow was also adjusted a bit to showplaceholder app icons when relevant.Support for apps was also added, although these are still WIP on the backend.And the port forwarding utility was added in since the sub agents now providethe necessary info.Fixescoder/internal#666
1 parentcda9208 commit97474bb

File tree

22 files changed

+1261
-662
lines changed

22 files changed

+1261
-662
lines changed

‎agent/agentcontainers/api.go

Lines changed: 189 additions & 167 deletions
Large diffs are not rendered by default.

‎agent/agentcontainers/api_test.go

Lines changed: 112 additions & 68 deletions
Large diffs are not rendered by default.

‎coderd/apidoc/docs.go

Lines changed: 57 additions & 12 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json

Lines changed: 57 additions & 12 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/workspaceagents_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,15 +1403,13 @@ func TestWorkspaceAgentRecreateDevcontainer(t *testing.T) {
14031403
agentcontainers.DevcontainerConfigFileLabel:configFile,
14041404
}
14051405
devContainer= codersdk.WorkspaceAgentContainer{
1406-
ID:uuid.NewString(),
1407-
CreatedAt:dbtime.Now(),
1408-
FriendlyName:testutil.GetRandomName(t),
1409-
Image:"busybox:latest",
1410-
Labels:dcLabels,
1411-
Running:true,
1412-
Status:"running",
1413-
DevcontainerDirty:true,
1414-
DevcontainerStatus:codersdk.WorkspaceAgentDevcontainerStatusRunning,
1406+
ID:uuid.NewString(),
1407+
CreatedAt:dbtime.Now(),
1408+
FriendlyName:testutil.GetRandomName(t),
1409+
Image:"busybox:latest",
1410+
Labels:dcLabels,
1411+
Running:true,
1412+
Status:"running",
14151413
}
14161414
plainContainer= codersdk.WorkspaceAgentContainer{
14171415
ID:uuid.NewString(),

‎codersdk/workspaceagents.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,6 @@ func (c *Client) WorkspaceAgentListeningPorts(ctx context.Context, agentID uuid.
393393
returnlisteningPorts,json.NewDecoder(res.Body).Decode(&listeningPorts)
394394
}
395395

396-
// WorkspaceAgentDevcontainersResponse is the response to the devcontainers
397-
// request.
398-
typeWorkspaceAgentDevcontainersResponsestruct {
399-
Devcontainers []WorkspaceAgentDevcontainer`json:"devcontainers"`
400-
}
401-
402396
// WorkspaceAgentDevcontainerStatus is the status of a devcontainer.
403397
typeWorkspaceAgentDevcontainerStatusstring
404398

@@ -422,6 +416,15 @@ type WorkspaceAgentDevcontainer struct {
422416
StatusWorkspaceAgentDevcontainerStatus`json:"status"`
423417
Dirtybool`json:"dirty"`
424418
Container*WorkspaceAgentContainer`json:"container,omitempty"`
419+
Agent*WorkspaceAgentDevcontainerAgent`json:"agent,omitempty"`
420+
}
421+
422+
// WorkspaceAgentDevcontainerAgent represents the sub agent for a
423+
// devcontainer.
424+
typeWorkspaceAgentDevcontainerAgentstruct {
425+
ID uuid.UUID`json:"id" format:"uuid"`
426+
Namestring`json:"name"`
427+
Directorystring`json:"directory"`
425428
}
426429

427430
// WorkspaceAgentContainer describes a devcontainer of some sort
@@ -450,14 +453,6 @@ type WorkspaceAgentContainer struct {
450453
// Volumes is a map of "things" mounted into the container. Again, this
451454
// is somewhat implementation-dependent.
452455
Volumesmap[string]string`json:"volumes"`
453-
// DevcontainerStatus is the status of the devcontainer, if this
454-
// container is a devcontainer. This is used to determine if the
455-
// devcontainer is running, stopped, starting, or in an error state.
456-
DevcontainerStatusWorkspaceAgentDevcontainerStatus`json:"devcontainer_status,omitempty"`
457-
// DevcontainerDirty is true if the devcontainer configuration has changed
458-
// since the container was created. This is used to determine if the
459-
// container needs to be rebuilt.
460-
DevcontainerDirtybool`json:"devcontainer_dirty"`
461456
}
462457

463458
func (c*WorkspaceAgentContainer)Match(idOrNamestring)bool {
@@ -486,6 +481,8 @@ type WorkspaceAgentContainerPort struct {
486481
// WorkspaceAgentListContainersResponse is the response to the list containers
487482
// request.
488483
typeWorkspaceAgentListContainersResponsestruct {
484+
// Devcontainers is a list of devcontainers visible to the workspace agent.
485+
Devcontainers []WorkspaceAgentDevcontainer`json:"devcontainers"`
489486
// Containers is a list of containers visible to the workspace agent.
490487
Containers []WorkspaceAgentContainer`json:"containers"`
491488
// Warnings is a list of warnings that may have occurred during the

‎docs/reference/api/agents.md

Lines changed: 39 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp