chore: rollback PR #18081 (#18104)

Rollback https://github.com/coder/coder/pull/18081
This commit is contained in:
Bruno Quaresma
2025-05-29 13:12:13 -03:00
committed by GitHub
parent 345001ffd1
commit d779126ee3
56 changed files with 146 additions and 164 deletions

View File

@ -107,7 +107,7 @@ type Manifest struct {
// OwnerUsername and WorkspaceID are used by an open-source user to identify the workspace.
// We do not provide insurance that this will not be removed in the future,
// but if it's easy to persist lets keep it around.
OwnerUsername string `json:"owner_username"`
OwnerName string `json:"owner_name"`
WorkspaceID uuid.UUID `json:"workspace_id"`
WorkspaceName string `json:"workspace_name"`
// GitAuthConfigs stores the number of Git configurations

View File

@ -38,7 +38,7 @@ func ManifestFromProto(manifest *proto.Manifest) (Manifest, error) {
return Manifest{
AgentID: agentID,
AgentName: manifest.AgentName,
OwnerUsername: manifest.OwnerUsername,
OwnerName: manifest.OwnerUsername,
WorkspaceID: workspaceID,
WorkspaceName: manifest.WorkspaceName,
Apps: apps,
@ -64,7 +64,7 @@ func ProtoFromManifest(manifest Manifest) (*proto.Manifest, error) {
return &proto.Manifest{
AgentId: manifest.AgentID[:],
AgentName: manifest.AgentName,
OwnerUsername: manifest.OwnerUsername,
OwnerUsername: manifest.OwnerName,
WorkspaceId: manifest.WorkspaceID[:],
WorkspaceName: manifest.WorkspaceName,
// #nosec G115 - Safe conversion for GitAuthConfigs which is expected to be small and positive

View File

@ -21,7 +21,7 @@ func TestManifest(t *testing.T) {
manifest := agentsdk.Manifest{
AgentID: uuid.New(),
AgentName: "test-agent",
OwnerUsername: "test-owner",
OwnerName: "test-owner",
WorkspaceID: uuid.New(),
WorkspaceName: "test-workspace",
GitAuthConfigs: 3,
@ -144,7 +144,7 @@ func TestManifest(t *testing.T) {
require.NoError(t, err)
require.Equal(t, manifest.AgentID, back.AgentID)
require.Equal(t, manifest.AgentName, back.AgentName)
require.Equal(t, manifest.OwnerUsername, back.OwnerUsername)
require.Equal(t, manifest.OwnerName, back.OwnerName)
require.Equal(t, manifest.WorkspaceID, back.WorkspaceID)
require.Equal(t, manifest.WorkspaceName, back.WorkspaceName)
require.Equal(t, manifest.GitAuthConfigs, back.GitAuthConfigs)

View File

@ -26,12 +26,12 @@ const (
// Workspace is a deployment of a template. It references a specific
// version and can be updated.
type Workspace struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
OwnerID uuid.UUID `json:"owner_id" format:"uuid"`
OwnerName string `json:"owner_name,omitempty"`
OwnerUsername string `json:"owner_username"`
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
OwnerID uuid.UUID `json:"owner_id" format:"uuid"`
// OwnerName is the username of the owner of the workspace.
OwnerName string `json:"owner_name"`
OwnerAvatarURL string `json:"owner_avatar_url"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
OrganizationName string `json:"organization_name"`
@ -50,7 +50,6 @@ type Workspace struct {
AutostartSchedule *string `json:"autostart_schedule,omitempty"`
TTLMillis *int64 `json:"ttl_ms,omitempty"`
LastUsedAt time.Time `json:"last_used_at" format:"date-time"`
// DeletingAt indicates the time at which the workspace will be permanently deleted.
// A workspace is eligible for deletion if it is dormant (a non-nil dormant_at value)
// and a value has been specified for time_til_dormant_autodelete on its template.
@ -70,7 +69,7 @@ type Workspace struct {
}
func (w Workspace) FullName() string {
return fmt.Sprintf("%s/%s", w.OwnerUsername, w.Name)
return fmt.Sprintf("%s/%s", w.OwnerName, w.Name)
}
type WorkspaceHealth struct {