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

Function publishBuildBinding

coderd/x/chatd/chattool/chattool.go:78–107  ·  view source on GitHub ↗
(
	ctx context.Context,
	db database.Store,
	logger slog.Logger,
	chatID uuid.UUID,
	workspaceID uuid.UUID,
	buildID uuid.UUID,
	onChatUpdated func(database.Chat),
)

Source from the content-addressed store, hash-verified

76}
77
78func 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
109func provisionerJobTerminal(status database.ProvisionerJobStatus) bool {
110 switch status {

Callers 2

StartWorkspaceFunction · 0.85
StopWorkspaceFunction · 0.85

Calls 2

ErrorMethod · 0.45

Tested by

no test coverage detected