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

Method Do

coderd/database/dbfake/dbfake.go:281–292  ·  view source on GitHub ↗

Do generates all the resources associated with a workspace build. Template and TemplateVersion will be optionally populated if no TemplateID is set on the provided workspace. Workspace will be optionally populated if no ID is set on the provided workspace.

()

Source from the content-addressed store, hash-verified

279// Workspace will be optionally populated if no ID is set on the provided
280// workspace.
281func (b WorkspaceBuildBuilder) Do() WorkspaceResponse {
282 var resp WorkspaceResponse
283 // Use transaction, like real wsbuilder.
284 err := b.db.InTx(func(tx database.Store) error {
285 //nolint:revive // calls do on modified struct
286 b.db = tx
287 resp = b.doInTX() // intxcheck:ignore // b.db is reassigned to tx on the line above
288 return nil
289 }, nil)
290 require.NoError(b.t, err)
291 return resp
292}
293
294func (b WorkspaceBuildBuilder) doInTX() WorkspaceResponse {
295 b.t.Helper()

Callers

nothing calls this directly

Calls 2

doInTXMethod · 0.95
InTxMethod · 0.65

Tested by

no test coverage detected