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

Function createChatForSharing

coderd/exp_chats_acl_test.go:467–493  ·  view source on GitHub ↗
(
	ctx context.Context,
	t *testing.T,
	client *codersdk.ExperimentalClient,
	organizationID uuid.UUID,
	text string,
	fileIDs ...uuid.UUID,
)

Source from the content-addressed store, hash-verified

465}
466
467func createChatForSharing(
468 ctx context.Context,
469 t *testing.T,
470 client *codersdk.ExperimentalClient,
471 organizationID uuid.UUID,
472 text string,
473 fileIDs ...uuid.UUID,
474) codersdk.Chat {
475 t.Helper()
476
477 content := []codersdk.ChatInputPart{{
478 Type: codersdk.ChatInputPartTypeText,
479 Text: text,
480 }}
481 for _, fileID := range fileIDs {
482 content = append(content, codersdk.ChatInputPart{
483 Type: codersdk.ChatInputPartTypeFile,
484 FileID: fileID,
485 })
486 }
487 chat, err := client.CreateChat(ctx, codersdk.CreateChatRequest{
488 OrganizationID: organizationID,
489 Content: content,
490 })
491 require.NoError(t, err)
492 return chat
493}
494
495func chatUserRoles(users []codersdk.ChatUser) map[uuid.UUID]codersdk.ChatRole {
496 roles := make(map[uuid.UUID]codersdk.ChatRole, len(users))

Callers 3

TestChatACLValidationFunction · 0.85

Calls 2

HelperMethod · 0.65
CreateChatMethod · 0.65

Tested by

no test coverage detected