From 566146af72a048adcff88a6390205df9181686bf Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 29 Oct 2025 15:31:41 +0000 Subject: [PATCH] fix(coderd): fix audit log resource link for tasks (#20545) Existing task audit log links were incorrect. As audit log links are generated on-the-fly, this does not require backfill. --- coderd/audit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coderd/audit.go b/coderd/audit.go index e43ed1c512..3a3237a9fe 100644 --- a/coderd/audit.go +++ b/coderd/audit.go @@ -509,11 +509,11 @@ func (api *API) auditLogResourceLink(ctx context.Context, alog database.GetAudit if err != nil { return "" } - workspace, err := api.Database.GetWorkspaceByID(ctx, task.WorkspaceID.UUID) + user, err := api.Database.GetUserByID(ctx, task.OwnerID) if err != nil { return "" } - return fmt.Sprintf("/tasks/%s/%s", workspace.OwnerName, task.Name) + return fmt.Sprintf("/tasks/%s/%s", user.Username, task.ID) default: return ""