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

Function WorkspaceApp

coderd/database/dbgen/dbgen.go:1298–1329  ·  view source on GitHub ↗
(t testing.TB, db database.Store, orig database.WorkspaceApp)

Source from the content-addressed store, hash-verified

1296}
1297
1298func WorkspaceApp(t testing.TB, db database.Store, orig database.WorkspaceApp) database.WorkspaceApp {
1299 resource, err := db.UpsertWorkspaceApp(genCtx, database.UpsertWorkspaceAppParams{
1300 ID: takeFirst(orig.ID, uuid.New()),
1301 CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
1302 AgentID: takeFirst(orig.AgentID, uuid.New()),
1303 Slug: takeFirst(orig.Slug, testutil.GetRandomName(t)),
1304 DisplayName: takeFirst(orig.DisplayName, testutil.GetRandomName(t)),
1305 Icon: takeFirst(orig.Icon, testutil.GetRandomName(t)),
1306 Command: sql.NullString{
1307 String: takeFirst(orig.Command.String, "ls"),
1308 Valid: orig.Command.Valid,
1309 },
1310 Url: sql.NullString{
1311 String: takeFirst(orig.Url.String),
1312 Valid: orig.Url.Valid,
1313 },
1314 External: orig.External,
1315 Subdomain: orig.Subdomain,
1316 SharingLevel: takeFirst(orig.SharingLevel, database.AppSharingLevelOwner),
1317 HealthcheckUrl: takeFirst(orig.HealthcheckUrl, "https://localhost:8000"),
1318 HealthcheckInterval: takeFirst(orig.HealthcheckInterval, 60),
1319 HealthcheckThreshold: takeFirst(orig.HealthcheckThreshold, 60),
1320 Health: takeFirst(orig.Health, database.WorkspaceAppHealthHealthy),
1321 DisplayOrder: takeFirst(orig.DisplayOrder, 1),
1322 DisplayGroup: orig.DisplayGroup,
1323 Hidden: orig.Hidden,
1324 OpenIn: takeFirst(orig.OpenIn, database.WorkspaceAppOpenInSlimWindow),
1325 Tooltip: takeFirst(orig.Tooltip, testutil.GetRandomName(t)),
1326 })
1327 require.NoError(t, err, "insert app")
1328 return resource
1329}
1330
1331func WorkspaceAppStat(t testing.TB, db database.Store, orig database.WorkspaceAppStat) database.WorkspaceAppStat {
1332 // This is not going to be correct, but our query doesn't return the ID.

Callers 10

TestCollectInsightsFunction · 0.92
TestTelemetryFunction · 0.92
createBuildMethod · 0.92
TestTasksWithStatusViewFunction · 0.92
TestListTasksFunction · 0.92
TestGeneratorFunction · 0.92
TestOpenAppFunction · 0.92

Calls 5

NowFunction · 0.92
GetRandomNameFunction · 0.92
takeFirstFunction · 0.70
UpsertWorkspaceAppMethod · 0.65
NewMethod · 0.65

Tested by 10

TestCollectInsightsFunction · 0.74
TestTelemetryFunction · 0.74
createBuildMethod · 0.74
TestTasksWithStatusViewFunction · 0.74
TestListTasksFunction · 0.74
TestGeneratorFunction · 0.74
TestOpenAppFunction · 0.74