MCPcopy
hub / github.com/jetify-com/devbox / Task

Interface Task

internal/setup/setup.go:44–55  ·  view source on GitHub ↗

Task is a setup action that can conditionally run based on the state of a previous run.

Source from the content-addressed store, hash-verified

42// Task is a setup action that can conditionally run based on the state of a
43// previous run.
44type Task interface {
45 Run(ctx context.Context) error
46
47 // NeedsRun returns true if the task needs to be run. It should assume
48 // that lastRun persists across executions of the program and is unique
49 // for each user.
50 //
51 // A task that should only run once can check if lastRun.Time is the zero value.
52 // A task that only runs after an update can check if lastRun.Version < build.Version.
53 // A retryable task can check lastRun.Error to see if the previous run failed.
54 NeedsRun(ctx context.Context, lastRun RunInfo) bool
55}
56
57// RunInfo contains metadata that describes the most recent run of a task.
58type RunInfo struct {

Callers 10

RunMethod · 0.65
TestVersionInfoAtLeastFunction · 0.65
RunMethod · 0.65
TestParseFlakeRefFunction · 0.65
TestParseFlakeRefErrorFunction · 0.65
TestFlakeRefStringFunction · 0.65
StatusFunction · 0.65
runFunction · 0.65

Implementers 2

testTaskinternal/setup/setup_test.go
setupTaskinternal/devbox/providers/nixcache/set

Calls

no outgoing calls

Tested by

no test coverage detected