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

Method WithTask

coderd/database/dbfake/dbfake.go:195–218  ·  view source on GitHub ↗
(taskSeed database.TaskTable, appSeed *sdkproto.App)

Source from the content-addressed store, hash-verified

193}
194
195func (b WorkspaceBuildBuilder) WithTask(taskSeed database.TaskTable, appSeed *sdkproto.App) WorkspaceBuildBuilder {
196 //nolint:revive // returns modified struct
197 b.taskSeed = taskSeed
198
199 if appSeed == nil {
200 appSeed = &sdkproto.App{}
201 }
202
203 var err error
204 //nolint: revive // returns modified struct
205 b.taskAppID, err = uuid.Parse(takeFirst(appSeed.Id, uuid.NewString()))
206 require.NoError(b.t, err)
207
208 return b.WithAgent(func(a []*sdkproto.Agent) []*sdkproto.Agent {
209 a[0].Apps = []*sdkproto.App{
210 {
211 Id: b.taskAppID.String(),
212 Slug: takeFirst(appSeed.Slug, "task-app"),
213 Url: takeFirst(appSeed.Url, ""),
214 },
215 }
216 return a
217 })
218}
219
220// Starting sets the job to running status.
221func (b WorkspaceBuildBuilder) Starting(opts ...BuilderOption) WorkspaceBuildBuilder {

Callers 10

createTaskInStateFunction · 0.80
TestTasksNotificationFunction · 0.80
TestPauseTaskFunction · 0.80
TestResumeTaskFunction · 0.80
TestTasksTelemetryFunction · 0.80
TestToolsFunction · 0.80
makeAITaskFunction · 0.80
createTaskInStatusFunction · 0.80

Calls 4

WithAgentMethod · 0.95
takeFirstFunction · 0.70
ParseMethod · 0.65
StringMethod · 0.45

Tested by 10

createTaskInStateFunction · 0.64
TestTasksNotificationFunction · 0.64
TestPauseTaskFunction · 0.64
TestResumeTaskFunction · 0.64
TestTasksTelemetryFunction · 0.64
TestToolsFunction · 0.64
makeAITaskFunction · 0.64
createTaskInStatusFunction · 0.64