Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb906c16

Browse files
chore: revert breaking changes relating to WorkspaceOwnerName (#18304)
Cherry-picks following commits:*f974addrevertsd63417b*d779126reverts2ec7404---------Co-authored-by: Bruno Quaresma <bruno@coder.com>
1 parent3a68676 commitb906c16

File tree

18 files changed

+82
-103
lines changed

18 files changed

+82
-103
lines changed

‎cli/testdata/coder_list_--output_json.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"workspace_id": "===========[workspace ID]===========",
2424
"workspace_name": "test-workspace",
2525
"workspace_owner_id": "==========[first user ID]===========",
26-
"workspace_owner_username": "testuser",
26+
"workspace_owner_name": "testuser",
2727
"template_version_id": "============[version ID]============",
2828
"template_version_name": "===========[version name]===========",
2929
"build_number": 1,

‎coderd/apidoc/docs.go‎

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/audit.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (api *API) auditLogResourceLink(ctx context.Context, alog database.GetAudit
462462
ifgetWorkspaceErr!=nil {
463463
return""
464464
}
465-
returnfmt.Sprintf("/@%s/%s",workspace.OwnerUsername,workspace.Name)
465+
returnfmt.Sprintf("/@%s/%s",workspace.OwnerName,workspace.Name)
466466

467467
casedatabase.ResourceTypeWorkspaceApp:
468468
ifadditionalFields.WorkspaceOwner!=""&&additionalFields.WorkspaceName!="" {
@@ -472,7 +472,7 @@ func (api *API) auditLogResourceLink(ctx context.Context, alog database.GetAudit
472472
ifgetWorkspaceErr!=nil {
473473
return""
474474
}
475-
returnfmt.Sprintf("/@%s/%s",workspace.OwnerUsername,workspace.Name)
475+
returnfmt.Sprintf("/@%s/%s",workspace.OwnerName,workspace.Name)
476476

477477
casedatabase.ResourceTypeOauth2ProviderApp:
478478
returnfmt.Sprintf("/deployment/oauth2-provider/apps/%s",alog.AuditLog.ResourceID)

‎coderd/workspacebuilds.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,7 @@ func (api *API) convertWorkspaceBuild(
10951095
CreatedAt:build.CreatedAt,
10961096
UpdatedAt:build.UpdatedAt,
10971097
WorkspaceOwnerID:workspace.OwnerID,
1098-
WorkspaceOwnerName:workspace.OwnerName,
1099-
WorkspaceOwnerUsername:workspace.OwnerUsername,
1098+
WorkspaceOwnerName:workspace.OwnerUsername,
11001099
WorkspaceOwnerAvatarURL:workspace.OwnerAvatarUrl,
11011100
WorkspaceID:build.WorkspaceID,
11021101
WorkspaceName:workspace.Name,

‎coderd/workspacebuilds_test.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ func TestWorkspaceBuild(t *testing.T) {
7878
},testutil.WaitShort,testutil.IntervalFast)
7979
wb,err:=client.WorkspaceBuild(testutil.Context(t,testutil.WaitShort),workspace.LatestBuild.ID)
8080
require.NoError(t,err)
81-
require.Equal(t,up.Username,wb.WorkspaceOwnerUsername)
82-
require.Equal(t,up.Name,wb.WorkspaceOwnerName)
81+
require.Equal(t,up.Username,wb.WorkspaceOwnerName)
8382
require.Equal(t,up.AvatarURL,wb.WorkspaceOwnerAvatarURL)
8483
}
8584

‎codersdk/workspacebuilds.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ const (
5151
// WorkspaceBuild is an at-point representation of a workspace state.
5252
// BuildNumbers start at 1 and increase by 1 for each subsequent build
5353
typeWorkspaceBuildstruct {
54-
IDuuid.UUID`json:"id" format:"uuid"`
55-
CreatedAttime.Time`json:"created_at" format:"date-time"`
56-
UpdatedAttime.Time`json:"updated_at" format:"date-time"`
57-
WorkspaceIDuuid.UUID`json:"workspace_id" format:"uuid"`
58-
WorkspaceNamestring`json:"workspace_name"`
59-
WorkspaceOwnerIDuuid.UUID`json:"workspace_owner_id" format:"uuid"`
60-
WorkspaceOwnerNamestring`json:"workspace_owner_name,omitempty"`
61-
WorkspaceOwnerUsernamestring`json:"workspace_owner_username"`
54+
ID uuid.UUID`json:"id" format:"uuid"`
55+
CreatedAt time.Time`json:"created_at" format:"date-time"`
56+
UpdatedAt time.Time`json:"updated_at" format:"date-time"`
57+
WorkspaceID uuid.UUID`json:"workspace_id" format:"uuid"`
58+
WorkspaceNamestring`json:"workspace_name"`
59+
WorkspaceOwnerID uuid.UUID`json:"workspace_owner_id" format:"uuid"`
60+
//WorkspaceOwnerNameis the username of the owner of the workspace.
61+
WorkspaceOwnerNamestring`json:"workspace_owner_name"`
6262
WorkspaceOwnerAvatarURLstring`json:"workspace_owner_avatar_url,omitempty"`
6363
TemplateVersionID uuid.UUID`json:"template_version_id" format:"uuid"`
6464
TemplateVersionNamestring`json:"template_version_name"`

‎codersdk/workspaces.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ const (
2626
// Workspace is a deployment of a template. It references a specific
2727
// version and can be updated.
2828
typeWorkspacestruct {
29-
ID uuid.UUID`json:"id" format:"uuid"`
30-
CreatedAt time.Time`json:"created_at" format:"date-time"`
31-
UpdatedAt time.Time`json:"updated_at" format:"date-time"`
32-
OwnerID uuid.UUID`json:"owner_id" format:"uuid"`
29+
ID uuid.UUID`json:"id" format:"uuid"`
30+
CreatedAt time.Time`json:"created_at" format:"date-time"`
31+
UpdatedAt time.Time`json:"updated_at" format:"date-time"`
32+
OwnerID uuid.UUID`json:"owner_id" format:"uuid"`
33+
// OwnerName is the username of the owner of the workspace.
3334
OwnerNamestring`json:"owner_name"`
3435
OwnerAvatarURLstring`json:"owner_avatar_url"`
3536
OrganizationID uuid.UUID`json:"organization_id" format:"uuid"`
@@ -49,7 +50,6 @@ type Workspace struct {
4950
AutostartSchedule*string`json:"autostart_schedule,omitempty"`
5051
TTLMillis*int64`json:"ttl_ms,omitempty"`
5152
LastUsedAt time.Time`json:"last_used_at" format:"date-time"`
52-
5353
// DeletingAt indicates the time at which the workspace will be permanently deleted.
5454
// A workspace is eligible for deletion if it is dormant (a non-nil dormant_at value)
5555
// and a value has been specified for time_til_dormant_autodelete on its template.

‎docs/reference/api/builds.md‎

Lines changed: 6 additions & 12 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp