( ctx context.Context, db database.Store, logger slog.Logger, chatID uuid.UUID, workspaceID uuid.UUID, buildID uuid.UUID, onChatUpdated func(database.Chat), )
| 76 | } |
| 77 | |
| 78 | func publishBuildBinding( |
| 79 | ctx context.Context, |
| 80 | db database.Store, |
| 81 | logger slog.Logger, |
| 82 | chatID uuid.UUID, |
| 83 | workspaceID uuid.UUID, |
| 84 | buildID uuid.UUID, |
| 85 | onChatUpdated func(database.Chat), |
| 86 | ) { |
| 87 | updatedChat, bindErr := db.UpdateChatWorkspaceBinding(ctx, database.UpdateChatWorkspaceBindingParams{ |
| 88 | ID: chatID, |
| 89 | WorkspaceID: uuid.NullUUID{UUID: workspaceID, Valid: true}, |
| 90 | BuildID: uuid.NullUUID{ |
| 91 | UUID: buildID, |
| 92 | Valid: buildID != uuid.Nil, |
| 93 | }, |
| 94 | AgentID: uuid.NullUUID{}, |
| 95 | }) |
| 96 | if bindErr != nil { |
| 97 | logger.Error(ctx, "failed to persist build ID on chat binding", |
| 98 | slog.F("chat_id", chatID), |
| 99 | slog.F("build_id", buildID), |
| 100 | slog.Error(bindErr), |
| 101 | ) |
| 102 | return |
| 103 | } |
| 104 | if onChatUpdated != nil { |
| 105 | onChatUpdated(updatedChat) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func provisionerJobTerminal(status database.ProvisionerJobStatus) bool { |
| 110 | switch status { |
no test coverage detected