(ctx context.Context, log slog.Logger, auditor audit.Auditor, params auditParams)
| 694 | } |
| 695 | |
| 696 | func 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 | |
| 717 | func useActiveVersion(opts dbauthz.TemplateAccessControl, ws database.Workspace) bool { |
| 718 | return opts.RequireActiveVersion || ws.AutomaticUpdates == database.AutomaticUpdatesAlways |
no test coverage detected