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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 13 commits intomainfromaudit-on-build/kira-pilot
Oct 25, 2022
Merged

Conversation

Kira-Pilot
Copy link
Member

@Kira-PilotKira-Pilot commentedOct 18, 2022
edited
Loading

resolves#4625

We now log start/stop for workspace builds
Screen Shot 2022-10-21 at 2 33 16 PM

bpmct, kylecarbs, and BrunoQuaresma reacted with heart emoji
@@ -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.

@Kira-Pilot
Copy link
MemberAuthor

@coadler I'm close with this!
Screen Shot 2022-10-19 at 1 15 10 PM

But I want to get the workspace name in this friendly string, which does not exist on theworkspace_build resource.

I figured I would just add an optional argument toInitRequest:AlternativeResource and pass that through; however, it seems there aren't optional arguments in Go. Also, maybe that's ugly.

Do you have any ideas?

@coadler
Copy link
Contributor

Audit logs have a field calledadditional_resources, which is intended for this scenario. I haven't really piped it through yet though. This is where you could put the workspace name!

@@ -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)
Copy link
MemberAuthor

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
Copy link
MemberAuthor

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 theResourceTarget function.

@Kira-PilotKira-Pilot marked this pull request as ready for reviewOctober 21, 2022 18:36
@Kira-PilotKira-Pilot requested a review froma team as acode ownerOctober 21, 2022 18:36
@Kira-PilotKira-Pilot requested review fromBrunoQuaresma and removed request fora teamOctober 21, 2022 18:36
Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a 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.

@Kira-PilotKira-Pilot merged commit145faf4 intomainOct 25, 2022
@Kira-PilotKira-Pilot deleted the audit-on-build/kira-pilot branchOctober 25, 2022 13:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 25, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@coadlercoadlercoadler approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

audit: log workspace start and stop actions
3 participants
@Kira-Pilot@coadler@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp