-
Notifications
You must be signed in to change notification settings - Fork 124
/
task_output.go
39 lines (34 loc) · 1.13 KB
/
task_output.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package taskoutput
import (
"github.com/evergreen-ci/evergreen"
)
// TaskOutput is the versioned entry point for coordinating persistent storage
// of a task run's output data.
type TaskOutput struct {
TaskLogs TaskLogOutput `bson:"task_logs,omitempty" json:"task_logs"`
TestLogs TestLogOutput `bson:"test_logs,omitempty" json:"test_logs"`
}
// TaskOptions represents the task-level information required for accessing
// task logs belonging to a task run.
type TaskOptions struct {
// ProjectID is the project ID of the task run.
ProjectID string `bson:"-" json:"-"`
// TaskID is the task ID of the task run.
TaskID string `bson:"-" json:"-"`
// Execution is the execution number of the task run.
Execution int `bson:"-" json:"-"`
}
// InitializeTaskOutput initializes the task output for a new task run.
func InitializeTaskOutput(env evergreen.Environment, opts TaskOptions) *TaskOutput {
settings := env.Settings()
return &TaskOutput{
TaskLogs: TaskLogOutput{
Version: 1,
BucketConfig: settings.Buckets.LogBucket,
},
TestLogs: TestLogOutput{
Version: 1,
BucketConfig: settings.Buckets.LogBucket,
},
}
}