Skip to content

Commit a8192a5

Browse files
Merge branch 'main' into dm-add-agent-timings
2 parents 0414623 + 86f68b2 commit a8192a5

19 files changed

+424
-388
lines changed

agent/proto/agent.pb.go

Lines changed: 387 additions & 377 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/proto/agent.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ message WorkspaceAgentScript {
5353
bool run_on_stop = 6;
5454
bool start_blocks_login = 7;
5555
google.protobuf.Duration timeout = 8;
56+
string display_name = 9;
5657
bytes id = 10;
5758
}
5859

coderd/database/dump.sql

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE workspace_agent_scripts DROP COLUMN display_name;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ALTER TABLE workspace_agent_scripts ADD COLUMN display_name text;
2+
3+
UPDATE workspace_agent_scripts
4+
SET display_name = workspace_agent_log_sources.display_name
5+
FROM workspace_agent_log_sources
6+
WHERE workspace_agent_scripts.log_source_id = workspace_agent_log_sources.id;
7+
8+
ALTER TABLE workspace_agent_scripts ALTER COLUMN display_name SET NOT NULL;

coderd/database/models.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/workspacescripts.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- name: InsertWorkspaceAgentScripts :many
22
INSERT INTO
3-
workspace_agent_scripts ( workspace_agent_id, created_at, log_source_id, log_path, script, cron, start_blocks_login, run_on_start, run_on_stop, timeout_seconds, display_name, id )
3+
workspace_agent_scripts (workspace_agent_id, created_at, log_source_id, log_path, script, cron, start_blocks_login, run_on_start, run_on_stop, timeout_seconds, display_name, id)
44
SELECT
55
@workspace_agent_id :: uuid AS workspace_agent_id,
66
@created_at :: timestamptz AS created_at,
@@ -12,6 +12,7 @@ SELECT
1212
unnest(@run_on_start :: boolean [ ]) AS run_on_start,
1313
unnest(@run_on_stop :: boolean [ ]) AS run_on_stop,
1414
unnest(@timeout_seconds :: integer [ ]) AS timeout_seconds,
15+
unnest(@display_name :: text [ ]) AS display_name,
1516
unnest(@id :: uuid [ ]) AS id
1617
RETURNING workspace_agent_scripts.*;
1718

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
18651865
StartBlocksLogin: scriptStartBlocksLogin,
18661866
RunOnStart: scriptRunOnStart,
18671867
RunOnStop: scriptRunOnStop,
1868+
DisplayName: scriptDisplayName,
18681869
ID: scriptIDs,
18691870
})
18701871
if err != nil {

coderd/workspaceagents.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ func convertScripts(dbScripts []database.WorkspaceAgentScript) []codersdk.Worksp
978978
RunOnStop: dbScript.RunOnStop,
979979
StartBlocksLogin: dbScript.StartBlocksLogin,
980980
Timeout: time.Duration(dbScript.TimeoutSeconds) * time.Second,
981+
DisplayName: dbScript.DisplayName,
981982
})
982983
}
983984
return scripts

codersdk/agentsdk/convert.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ func AgentScriptFromProto(protoScript *proto.WorkspaceAgentScript) (codersdk.Wor
178178
RunOnStop: protoScript.RunOnStop,
179179
StartBlocksLogin: protoScript.StartBlocksLogin,
180180
Timeout: protoScript.Timeout.AsDuration(),
181+
DisplayName: protoScript.DisplayName,
181182
}, nil
182183
}
183184

@@ -192,6 +193,7 @@ func ProtoFromScript(s codersdk.WorkspaceAgentScript) *proto.WorkspaceAgentScrip
192193
RunOnStop: s.RunOnStop,
193194
StartBlocksLogin: s.StartBlocksLogin,
194195
Timeout: durationpb.New(s.Timeout),
196+
DisplayName: s.DisplayName,
195197
}
196198
}
197199

codersdk/agentsdk/convert_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func TestManifest(t *testing.T) {
115115
RunOnStop: true,
116116
StartBlocksLogin: true,
117117
Timeout: time.Second,
118+
DisplayName: "foo",
118119
},
119120
{
120121
ID: uuid.New(),
@@ -126,6 +127,7 @@ func TestManifest(t *testing.T) {
126127
RunOnStop: true,
127128
StartBlocksLogin: true,
128129
Timeout: time.Second * 4,
130+
DisplayName: "bar",
129131
},
130132
},
131133
}

codersdk/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ type WorkspaceAgentLogSource struct {
186186

187187
type WorkspaceAgentScript struct {
188188
ID uuid.UUID `json:"id" format:"uuid"`
189-
DisplayName string `json:"display_name"`
190189
LogSourceID uuid.UUID `json:"log_source_id" format:"uuid"`
191190
LogPath string `json:"log_path"`
192191
Script string `json:"script"`
@@ -195,6 +194,7 @@ type WorkspaceAgentScript struct {
195194
RunOnStop bool `json:"run_on_stop"`
196195
StartBlocksLogin bool `json:"start_blocks_login"`
197196
Timeout time.Duration `json:"timeout"`
197+
DisplayName string `json:"display_name"`
198198
}
199199

200200
type WorkspaceAgentHealth struct {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ replace github.com/dlclark/regexp2 => github.com/dlclark/regexp2 v1.7.0
3939

4040
// There are a few minor changes we make to Tailscale that we're slowly upstreaming. Compare here:
4141
// https://github.com/tailscale/tailscale/compare/main...coder:tailscale:main
42-
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20240702054557-aa558fbe5374
42+
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20240920101701-ddd4a72e1b56
4343

4444
// This is replaced to include
4545
// 1. a fix for a data race: c.f. https://github.com/tailscale/wireguard-go/pull/25

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ github.com/coder/serpent v0.8.0 h1:6OR+k6fekhSeEDmwwzBgnSjaa7FfGGrMlc3GoAEH9dg=
230230
github.com/coder/serpent v0.8.0/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
231231
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788 h1:YoUSJ19E8AtuUFVYBpXuOD6a/zVP3rcxezNsoDseTUw=
232232
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788/go.mod h1:aGQbuCLyhRLMzZF067xc84Lh7JDs1FKwCmF1Crl9dxQ=
233-
github.com/coder/tailscale v1.1.1-0.20240702054557-aa558fbe5374 h1:a5Eg7D5e2oAc0tN56ee4yxtiTo76ztpRlk6geljaZp8=
234-
github.com/coder/tailscale v1.1.1-0.20240702054557-aa558fbe5374/go.mod h1:rp6BIJxCp127/hvvDWNkHC9MxAlKvQfoOtBr8s5sCqo=
233+
github.com/coder/tailscale v1.1.1-0.20240920101701-ddd4a72e1b56 h1:yIZA92mej1q0h/YJkZMottzwe2Pv3UiSkNaDnHV4PwE=
234+
github.com/coder/tailscale v1.1.1-0.20240920101701-ddd4a72e1b56/go.mod h1:rp6BIJxCp127/hvvDWNkHC9MxAlKvQfoOtBr8s5sCqo=
235235
github.com/coder/terraform-provider-coder v1.0.2 h1:xKbnJF/XUxcUJlZoC3ZkNOj4PZvk5Stdkel2TCZluDQ=
236236
github.com/coder/terraform-provider-coder v1.0.2/go.mod h1:1f3EjO+DA9QcIbM7sBSk/Ffw3u7kh6vXNBIQfV59yUk=
237237
github.com/coder/wgtunnel v0.1.13-0.20240522110300-ade90dfb2da0 h1:C2/eCr+r0a5Auuw3YOiSyLNHkdMtyCZHPFBx7syN4rk=

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/testHelpers/entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ export const MockWorkspaceAgentScript: TypesGen.WorkspaceAgentScript = {
896896
script: "echo 'hello world'",
897897
start_blocks_login: false,
898898
timeout: 0,
899+
display_name: "Say Hello",
899900
};
900901

901902
export const MockWorkspaceAgent: TypesGen.WorkspaceAgent = {

site/src/theme/icons.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"confluence.svg",
2222
"container.svg",
2323
"cpp.svg",
24+
"cursor.svg",
2425
"database.svg",
2526
"datagrip.svg",
2627
"dataspell.svg",

site/static/icon/cursor.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)