Skip to content

Commit a34e202

Browse files
committed
fix comments
1 parent 146cf92 commit a34e202

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

agent/agentcontainers/api.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func WithDevcontainerCLI(dccli DevcontainerCLI) Option {
6464
}
6565
}
6666

67-
// WithDevcontainers sets the known devcontainers and scripts for the
68-
// API. This allows allows the API to be aware of devcontainers defined
69-
// in the workspace agent manifest.
67+
// WithDevcontainers sets the known devcontainers for the API. This
68+
// allows the API to be aware of devcontainers defined in the workspace
69+
// agent manifest.
7070
func WithDevcontainers(devcontainers []codersdk.WorkspaceAgentDevcontainer) Option {
7171
return func(api *API) {
7272
if len(devcontainers) > 0 {
@@ -195,7 +195,6 @@ func (api *API) getContainers(ctx context.Context) (codersdk.WorkspaceAgentListC
195195
}
196196

197197
// If not in our known list, add as a runtime detected entry.
198-
// Parse name from folder
199198
name := path.Base(workspaceFolder)
200199
if _, ok := api.devcontainerNames[name]; ok {
201200
// Try to find a unique name by appending a number.

agent/agentcontainers/api_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func TestAPI(t *testing.T) {
188188
ID: knownDevcontainerID2,
189189
Name: "known-devcontainer-2",
190190
WorkspaceFolder: "/workspace/known2",
191-
// No config path intentionally
191+
// No config path intentionally.
192192
},
193193
}
194194

@@ -293,7 +293,6 @@ func TestAPI(t *testing.T) {
293293
wantStatus: http.StatusOK,
294294
wantCount: 3, // 2 known + 1 runtime
295295
verify: func(t *testing.T, devcontainers []codersdk.WorkspaceAgentDevcontainer) {
296-
// Find and verify devcontainers by workspace folder
297296
known1 := mustFindDevcontainerByPath(t, devcontainers, "/workspace/known1")
298297
known2 := mustFindDevcontainerByPath(t, devcontainers, "/workspace/known2")
299298
runtime1 := mustFindDevcontainerByPath(t, devcontainers, "/workspace/runtime1")
@@ -373,7 +372,6 @@ func TestAPI(t *testing.T) {
373372
wantStatus: http.StatusOK,
374373
wantCount: 2,
375374
verify: func(t *testing.T, devcontainers []codersdk.WorkspaceAgentDevcontainer) {
376-
// Find devcontainer with ID matching knownDevcontainerID2
377375
var dc2 *codersdk.WorkspaceAgentDevcontainer
378376
for i := range devcontainers {
379377
if devcontainers[i].ID == knownDevcontainerID2 {
@@ -484,7 +482,7 @@ func TestAPI(t *testing.T) {
484482
// Verify the number of devcontainers in the response.
485483
assert.Len(t, response.Devcontainers, tt.wantCount, "wrong number of devcontainers")
486484

487-
// Run custom verification if provided
485+
// Run custom verification if provided.
488486
if tt.verify != nil && len(response.Devcontainers) > 0 {
489487
tt.verify(t, response.Devcontainers)
490488
}

0 commit comments

Comments
 (0)