mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: add workspace_id, owner_name to agent manifest (#10199)
Co-authored-by: Kyle Carberry <kyle@carberry.com> Co-authored-by: Atif Ali <atif@coder.com>
This commit is contained in:
committed by
GitHub
parent
28eca2e53f
commit
baf3bf6b9c
7
coderd/apidoc/docs.go
generated
7
coderd/apidoc/docs.go
generated
@ -6917,6 +6917,10 @@ const docTemplate = `{
|
||||
"motd_file": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner_name": {
|
||||
"description": "OwnerName and WorkspaceID are used by an open-source user to identify the workspace.\nWe do not provide insurance that this will not be removed in the future,\nbut if it's easy to persist lets keep it around.",
|
||||
"type": "string"
|
||||
},
|
||||
"scripts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -6925,6 +6929,9 @@ const docTemplate = `{
|
||||
},
|
||||
"vscode_port_proxy_uri": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspace_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
7
coderd/apidoc/swagger.json
generated
7
coderd/apidoc/swagger.json
generated
@ -6103,6 +6103,10 @@
|
||||
"motd_file": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner_name": {
|
||||
"description": "OwnerName and WorkspaceID are used by an open-source user to identify the workspace.\nWe do not provide insurance that this will not be removed in the future,\nbut if it's easy to persist lets keep it around.",
|
||||
"type": "string"
|
||||
},
|
||||
"scripts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -6111,6 +6115,9 @@
|
||||
},
|
||||
"vscode_port_proxy_uri": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspace_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -237,6 +237,8 @@ func (api *API) workspaceAgentManifest(rw http.ResponseWriter, r *http.Request)
|
||||
|
||||
httpapi.Write(ctx, rw, http.StatusOK, agentsdk.Manifest{
|
||||
AgentID: apiAgent.ID,
|
||||
OwnerName: owner.Username,
|
||||
WorkspaceID: workspace.ID,
|
||||
Apps: convertApps(dbApps, workspaceAgent, owner.Username, workspace),
|
||||
Scripts: convertScripts(scripts),
|
||||
DERPMap: api.DERPMap(),
|
||||
|
@ -998,6 +998,8 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Verify manifest API response.
|
||||
require.Equal(t, workspace.ID, manifest.WorkspaceID)
|
||||
require.Equal(t, workspace.OwnerName, manifest.OwnerName)
|
||||
require.Equal(t, "First Meta", manifest.Metadata[0].DisplayName)
|
||||
require.Equal(t, "foo1", manifest.Metadata[0].Key)
|
||||
require.Equal(t, "echo hi", manifest.Metadata[0].Script)
|
||||
|
Reference in New Issue
Block a user