mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: add organization name to workspaces (#13755)
* chore: add organization name to workspaces
This commit is contained in:
3
coderd/apidoc/docs.go
generated
3
coderd/apidoc/docs.go
generated
@ -12500,6 +12500,9 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"organization_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"outdated": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
3
coderd/apidoc/swagger.json
generated
3
coderd/apidoc/swagger.json
generated
@ -11338,6 +11338,9 @@
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"organization_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"outdated": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
@ -1774,6 +1774,7 @@ func convertWorkspace(
|
||||
OwnerName: username,
|
||||
OwnerAvatarURL: avatarURL,
|
||||
OrganizationID: workspace.OrganizationID,
|
||||
OrganizationName: template.OrganizationName,
|
||||
TemplateID: workspace.TemplateID,
|
||||
LatestBuild: workspaceBuild,
|
||||
TemplateName: template.Name,
|
||||
|
@ -64,6 +64,10 @@ func TestWorkspace(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, user.UserID, ws.LatestBuild.InitiatorID)
|
||||
require.Equal(t, codersdk.BuildReasonInitiator, ws.LatestBuild.Reason)
|
||||
|
||||
org, err := client.Organization(ctx, ws.OrganizationID)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, ws.OrganizationName, org.Name)
|
||||
})
|
||||
|
||||
t.Run("Deleted", func(t *testing.T) {
|
||||
@ -1496,6 +1500,9 @@ func TestWorkspaceFilterManual(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
|
||||
org, err := client.Organization(ctx, user.OrganizationID)
|
||||
require.NoError(t, err)
|
||||
|
||||
// single workspace
|
||||
res, err := client.Workspaces(ctx, codersdk.WorkspaceFilter{
|
||||
FilterQuery: fmt.Sprintf("template:%s %s/%s", template.Name, workspace.OwnerName, workspace.Name),
|
||||
@ -1503,6 +1510,7 @@ func TestWorkspaceFilterManual(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Len(t, res.Workspaces, 1)
|
||||
require.Equal(t, workspace.ID, res.Workspaces[0].ID)
|
||||
require.Equal(t, workspace.OrganizationName, org.Name)
|
||||
})
|
||||
t.Run("FilterQueryHasAgentConnecting", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
Reference in New Issue
Block a user