MCPcopy Index your code
hub / github.com/coder/coder / auditBuild

Function auditBuild

coderd/autobuild/lifecycle_executor.go:696–715  ·  view source on GitHub ↗
(ctx context.Context, log slog.Logger, auditor audit.Auditor, params auditParams)

Source from the content-addressed store, hash-verified

694}
695
696func auditBuild(ctx context.Context, log slog.Logger, auditor audit.Auditor, params auditParams) {
697 status := http.StatusInternalServerError
698 if params.Success {
699 status = http.StatusOK
700 }
701
702 audit.BackgroundAudit(ctx, &audit.BackgroundAuditParams[database.WorkspaceTable]{
703 Audit: auditor,
704 Log: log,
705 UserID: params.New.OwnerID,
706 OrganizationID: params.New.OrganizationID,
707 // Right now there's no request associated with an autobuild
708 // operation.
709 RequestID: uuid.Nil,
710 Action: database.AuditActionWrite,
711 Old: params.Old,
712 New: params.New,
713 Status: status,
714 })
715}
716
717func useActiveVersion(opts dbauthz.TemplateAccessControl, ws database.Workspace) bool {
718 return opts.RequireActiveVersion || ws.AutomaticUpdates == database.AutomaticUpdatesAlways

Callers 1

runOnceMethod · 0.85

Calls 1

BackgroundAuditFunction · 0.92

Tested by

no test coverage detected