-
Notifications
You must be signed in to change notification settings - Fork 889
adding workspace_build resource #4636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
coderd/audit/request.go
Outdated
@@ -43,6 +43,8 @@ func ResourceTarget[T Auditable](tgt T) string { | |||
return typed.Username | |||
case database.Workspace: | |||
return typed.Name | |||
case database.WorkspaceBuild: | |||
return string(typed.Transition) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@coadler I'm close with this! But I want to get the workspace name in this friendly string, which does not exist on the I figured I would just add an optional argument to Do you have any ideas? |
Audit logs have a field called |
@@ -43,6 +44,9 @@ func ResourceTarget[T Auditable](tgt T) string { | |||
return typed.Username | |||
case database.Workspace: | |||
return typed.Name | |||
case database.WorkspaceBuild: | |||
// this isn't used | |||
return string(typed.BuildNumber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ug tell me there's a better way.
workspace_bytes := []byte(alog.AdditionalFields) | ||
var workspaceResourceInfo WorkspaceResourceInfo | ||
json.Unmarshal(workspace_bytes, &workspaceResourceInfo) | ||
str += " for workspace " + workspaceResourceInfo.WorkspaceName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to add this here and instead to use the ResourceTarget
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FE and BE code looks good to me! I don't have answers for your questions tho.
resolves #4625
We now log start/stop for workspace builds
