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

Function seedAdvisorConfig

coderd/x/chatd/chatd_test.go:10501–10516  ·  view source on GitHub ↗
(
	ctx context.Context,
	t *testing.T,
	db database.Store,
	cfg codersdk.AdvisorConfig,
)

Source from the content-addressed store, hash-verified

10499}
10500
10501func seedAdvisorConfig(
10502 ctx context.Context,
10503 t *testing.T,
10504 db database.Store,
10505 cfg codersdk.AdvisorConfig,
10506) {
10507 t.Helper()
10508
10509 data, err := json.Marshal(cfg)
10510 require.NoError(t, err)
10511 err = db.UpsertChatAdvisorConfig(
10512 dbauthz.AsSystemRestricted(ctx),
10513 string(data),
10514 )
10515 require.NoError(t, err)
10516}
10517
10518// TestPromoteQueuedWhileRunning guards against the data-loss
10519// failure mode: promoting on a streaming chat must preserve

Calls 4

AsSystemRestrictedFunction · 0.92
HelperMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected