feat: add 'display_name' column to 'workspace_agent_scripts' (#14747)

* feat: add 'display_name' column to 'workspace_agent_scripts'

* fix: backfill from workspace_agent_log_sources

* fix: run 'make gen'
This commit is contained in:
Danielle Maywood
2024-09-20 14:26:13 +01:00
committed by GitHub
parent db7b411094
commit 86f68b220e
22 changed files with 420 additions and 349 deletions
+2
View File
@@ -172,6 +172,7 @@ func AgentScriptFromProto(protoScript *proto.WorkspaceAgentScript) (codersdk.Wor
RunOnStop: protoScript.RunOnStop,
StartBlocksLogin: protoScript.StartBlocksLogin,
Timeout: protoScript.Timeout.AsDuration(),
DisplayName: protoScript.DisplayName,
}, nil
}
@@ -185,6 +186,7 @@ func ProtoFromScript(s codersdk.WorkspaceAgentScript) *proto.WorkspaceAgentScrip
RunOnStop: s.RunOnStop,
StartBlocksLogin: s.StartBlocksLogin,
Timeout: durationpb.New(s.Timeout),
DisplayName: s.DisplayName,
}
}
+2
View File
@@ -114,6 +114,7 @@ func TestManifest(t *testing.T) {
RunOnStop: true,
StartBlocksLogin: true,
Timeout: time.Second,
DisplayName: "foo",
},
{
LogSourceID: uuid.New(),
@@ -124,6 +125,7 @@ func TestManifest(t *testing.T) {
RunOnStop: true,
StartBlocksLogin: true,
Timeout: time.Second * 4,
DisplayName: "bar",
},
},
}
+1
View File
@@ -193,6 +193,7 @@ type WorkspaceAgentScript struct {
RunOnStop bool `json:"run_on_stop"`
StartBlocksLogin bool `json:"start_blocks_login"`
Timeout time.Duration `json:"timeout"`
DisplayName string `json:"display_name"`
}
type WorkspaceAgentHealth struct {