Documentation
¶
Overview ¶
Package apimodels provides models used across multiple packages by the REST API.
Index ¶
- Constants
- func GetSeverityMapping(s level.Priority) string
- type AWSCredentials
- type AgentSetupData
- type AssumeRoleRequest
- type AttachTestResultsRequest
- type CheckMergeRequest
- type CheckRunAnnotation
- type CheckRunOutput
- type CompleteVirtualTasksRequest
- type CompleteVirtualTasksResponse
- type ContainerIsolationSettings
- type CreateHost
- type CreatePatchModule
- type CreatePatchParameter
- type CreatePatchRequest
- type CreateSetupSecretResponse
- type DisableInfo
- type DisplayTaskInfo
- type DistroView
- type EbsDevice
- type EndTaskResponse
- type ExchangeSetupSecretResponse
- type ExpansionsAndVars
- type ExternalExecutionMetadata
- type FailingCommand
- type GeneratePollResponse
- type GetNextTaskDetails
- type GetPerfCountOptions
- type HeartbeatResponse
- type HighExecTimeoutReport
- type HostView
- type LogInfo
- type LogMessage
- type ModuleCloneInfo
- type NextTaskResponse
- type OOMTrackerInfo
- type PerfCount
- type PrepareVirtualTasksRequest
- type PrepareVirtualTasksResponse
- type ProcessTimeoutResponse
- type RegistrySettings
- type ResourceConstraintInfo
- type S3CopyRequest
- type S3CredentialsRequest
- type SourceCacheClaimResponse
- type SourceCacheCredentialsRequest
- type SourceCacheCredentialsResponse
- type SourceCacheRestoreKey
- type TaskEndDetail
- type TaskEndDetails
- type TaskStartRequest
- type TaskTestResultsInfo
- type TimeoutProcessInfo
- type Token
- type VirtualTaskArtifact
- type VirtualTaskCompletion
- type VirtualTaskCompletionResult
- type VirtualTaskPreparation
- type VirtualTaskPreparationResult
- type VirtualTaskTestResults
- type WorkstationSetupCommandOptions
Constants ¶
const ( ScopeTask = "task" ScopeBuild = "build" DefaultSetupTimeoutSecs = 600 DefaultTeardownTimeoutSecs = 21600 DefaultRetries = 2 )
const ( VirtualTaskCompletionOutcomeSuccess = "success" VirtualTaskCompletionOutcomeFailed = "failed" )
const ( SystemLogPrefix = "S" AgentLogPrefix = "E" TaskLogPrefix = "T" LogErrorPrefix = "E" LogWarnPrefix = "W" LogDebugPrefix = "D" LogInfoPrefix = "I" )
Variables ¶
This section is empty.
Functions ¶
func GetSeverityMapping ¶
Types ¶
type AWSCredentials ¶
type AWSCredentials struct {
AccessKeyID string `json:"access_key_id"`
SecretAccessKey string `json:"secret_access_key"`
SessionToken string `json:"session_token"`
Expiration string `json:"expiration"`
// ExternalID is the external ID used to assume the role
// if available.
ExternalID string `json:"external_id"`
}
AWSCredentials contains AWS credentials.
type AgentSetupData ¶
type AgentSetupData struct {
SplunkServerURL string `json:"splunk_server_url"`
SplunkClientToken string `json:"splunk_client_token"`
SplunkChannel string `json:"splunk_channel"`
TaskOutput evergreen.S3Credentials `json:"task_output"`
TraceCollectorEndpoint string `json:"trace_collector_endpoint"`
MaxExecTimeoutSecs int `json:"max_exec_timeout_secs"`
PSLoggingDisabled bool `json:"ps_logging_disabled"`
}
type AssumeRoleRequest ¶
type AssumeRoleRequest struct {
// RoleARN is the Amazon Resource Name (ARN) of the role to assume.
RoleARN string `json:"role_arn"`
// Policy is an optional field that can be used to restrict the permissions.
Policy *string `json:"policy"`
// DurationSeconds is an optional field of the duration of the role session.
// It defaults to 15 minutes.
DurationSeconds *int32 `json:"duration_seconds"`
}
AssumeRoleRequest is the details of what role to assume.
func (*AssumeRoleRequest) Validate ¶
func (ar *AssumeRoleRequest) Validate() error
Validate checks that the request has valid values.
type AttachTestResultsRequest ¶
type AttachTestResultsRequest struct {
Info testresult.TestResultsInfo `json:"info"`
Stats testresult.TaskTestResultsStats `json:"stats"`
FailedSample []string `json:"failed_sample"`
CreatedAt time.Time `json:"created_at"`
}
AttachTestResultsRequest contains information necessary to send in the request by the agent to attach test results.
type CheckMergeRequest ¶
type CheckMergeRequest struct {
PRNum int `json:"pr_num"`
Owner string `json:"owner"`
Repo string `json:"repo"`
}
CheckMergeRequest holds information sent by the agent to get a PR and check mergeability.
type CheckRunAnnotation ¶
type CheckRunAnnotation struct {
Path string `json:"path,omitempty" plugin:"expand"`
StartLine *int `json:"start_line,omitempty" `
EndLine *int `json:"end_line,omitempty" `
StartColumn *int `json:"start_column,omitempty"`
EndColumn *int `json:"end_column,omitempty" `
AnnotationLevel string `json:"annotation_level,omitempty" plugin:"expand"`
Message string `json:"message,omitempty" plugin:"expand"`
Title string `json:"title,omitempty" plugin:"expand"`
RawDetails string `json:"raw_details,omitempty" plugin:"expand"`
}
CheckRunAnnotation represents an annotation object for a CheckRun output.
type CheckRunOutput ¶
type CheckRunOutput struct {
Title string `json:"title,omitempty" plugin:"expand"`
Summary string `json:"summary,omitempty" plugin:"expand"`
Text string `json:"text,omitempty" plugin:"expand"`
AnnotationsCount *int `json:"annotations_count,omitempty"`
AnnotationsURL string `json:"annotations_url,omitempty" plugin:"expand"`
Annotations []*CheckRunAnnotation `json:"annotations,omitempty" plugin:"expand"`
}
CheckRunOutput represents the output for a CheckRun.
type CompleteVirtualTasksRequest ¶
type CompleteVirtualTasksRequest struct {
Tasks []VirtualTaskCompletion `json:"tasks"`
}
CompleteVirtualTasksRequest is the request body for push-completing a batch of virtual tasks.
type CompleteVirtualTasksResponse ¶
type CompleteVirtualTasksResponse struct {
Results []VirtualTaskCompletionResult `json:"results" extensions:"x-nullable"`
}
CompleteVirtualTasksResponse contains the per-task outcomes of a push completion.
type ContainerIsolationSettings ¶
type ContainerIsolationSettings struct {
Image string `json:"image"`
MemoryMB int64 `json:"memory_mb,omitempty"`
CPUs int64 `json:"cpus,omitempty"`
RequireIsolation bool `json:"require_isolation,omitempty"`
}
ContainerIsolationSettings is the agent-facing view of container isolation config.
type CreateHost ¶
type CreateHost struct {
// agent-controlled settings
NumHosts string `mapstructure:"num_hosts" json:"num_hosts" yaml:"num_hosts" plugin:"expand"`
Scope string `mapstructure:"scope" json:"scope" yaml:"scope" plugin:"expand"`
SetupTimeoutSecs int `mapstructure:"timeout_setup_secs" json:"timeout_setup_secs" yaml:"timeout_setup_secs"`
TeardownTimeoutSecs int `mapstructure:"timeout_teardown_secs" json:"timeout_teardown_secs" yaml:"timeout_teardown_secs"`
Retries int `mapstructure:"retries" json:"retries" yaml:"retries"`
// EC2-related settings
AMI string `mapstructure:"ami" json:"ami" yaml:"ami" plugin:"expand"`
Distro string `mapstructure:"distro" json:"distro" yaml:"distro" plugin:"expand"`
EBSDevices []EbsDevice `mapstructure:"ebs_block_device" json:"ebs_block_device" yaml:"ebs_block_device" plugin:"expand"`
InstanceType string `mapstructure:"instance_type" json:"instance_type" yaml:"instance_type" plugin:"expand"`
IPv6 bool `mapstructure:"ipv6" json:"ipv6" yaml:"ipv6"`
Region string `mapstructure:"region" json:"region" yaml:"region" plugin:"expand"`
SecurityGroups []string `mapstructure:"security_group_ids" json:"security_group_ids" yaml:"security_group_ids" plugin:"expand"`
Subnet string `mapstructure:"subnet_id" json:"subnet_id" yaml:"subnet_id" plugin:"expand"`
Tenancy evergreen.EC2Tenancy `mapstructure:"tenancy" json:"tenancy" yaml:"tenancy" plugin:"expand"`
UserdataFile string `mapstructure:"userdata_file" json:"userdata_file" yaml:"userdata_file" plugin:"expand"`
// UserdataCommand is the content of the userdata file. Users can't actually
// set this directly, instead they pass in a userdata file.
UserdataCommand string `json:"userdata_command" yaml:"userdata_command" plugin:"expand"`
}
func (*CreateHost) Expand ¶
func (ch *CreateHost) Expand(exp *util.Expansions) error
type CreatePatchModule ¶
type CreatePatchModule struct {
// ModuleName is the name of the module, as defined in the project
// configuration, that the diff applies to. Required.
ModuleName string `json:"module_name"`
// Githash is the commit the module diff is based on. Required.
Githash string `json:"githash"`
// Patch is the unified diff to apply to the module. Required.
Patch string `json:"patch"`
}
CreatePatchModule holds the diff for a single module in a patch creation request. The diff is applied to the module's repository at the given githash.
type CreatePatchParameter ¶
type CreatePatchParameter struct {
// Key is the name of the parameter, which must match a parameter defined
// in the project configuration. Required.
Key string `json:"key"`
// Value is the value to set the parameter to. Required.
Value string `json:"value"`
}
CreatePatchParameter is a parameter to set in the patch's project configuration.
type CreatePatchRequest ¶
type CreatePatchRequest struct {
// Description is a human-readable summary of the patch, shown in the UI.
Description string `json:"description"`
// Author is the Evergreen username to attribute the patch to when creating
// it on behalf of someone else. Requires 'Patches: Admin' permission; if
// the user does not exist, the patch is attributed to the caller.
// Optional.
Author string `json:"author"`
// BaseGithash is the commit the patch is based on, in the project's
// repository. Required.
BaseGithash string `json:"base_githash"`
// Patch is the unified diff to apply to the base commit in the project's
// repository. Optional: a patch with no diffs runs its tasks against the
// base commit.
Patch string `json:"patch"`
// Modules holds diffs for the project's modules, applied alongside the
// base diff. Optional.
Modules []CreatePatchModule `json:"modules" extensions:"x-nullable"`
// Parameters sets values for parameters defined in the project
// configuration. Optional.
Parameters []CreatePatchParameter `json:"parameters" extensions:"x-nullable"`
// Variants is the list of build variants to run. Optional, unless
// finalizing.
Variants []string `json:"variants" extensions:"x-nullable"`
// Tasks is the list of tasks to run in the selected variants. Optional,
// unless finalizing.
Tasks []string `json:"tasks" extensions:"x-nullable"`
// RegexVariants selects build variants to run by regular expression, as an
// alternative to Variants. Optional, unless finalizing.
RegexVariants []string `json:"regex_variants" extensions:"x-nullable"`
// RegexTasks selects tasks to run by regular expression, as an
// alternative to Tasks. Optional, unless finalizing.
RegexTasks []string `json:"regex_tasks" extensions:"x-nullable"`
// RegexTestSelectionVariants selects build variants for test selection by
// regular expression. Optional.
RegexTestSelectionVariants []string `json:"regex_test_selection_variants" extensions:"x-nullable"`
// RegexTestSelectionExcludedVariants excludes build variants from test
// selection by regular expression. Optional.
RegexTestSelectionExcludedVariants []string `json:"regex_test_selection_excluded_variants" extensions:"x-nullable"`
// RegexTestSelectionTasks selects tasks for test selection by regular
// expression. Optional.
RegexTestSelectionTasks []string `json:"regex_test_selection_tasks" extensions:"x-nullable"`
// RegexTestSelectionExcludedTasks excludes tasks from test selection by
// regular expression. Optional.
RegexTestSelectionExcludedTasks []string `json:"regex_test_selection_excluded_tasks" extensions:"x-nullable"`
// Alias is a single patch alias that resolves the build variants and tasks
// to run. Optional.
Alias string `json:"alias"`
// Aliases is a list of patch aliases that resolve the build variants and
// tasks to run, combined. Optional.
Aliases []string `json:"aliases" extensions:"x-nullable"`
// TriggerAliases is a list of the project's trigger aliases to run.
// Optional.
TriggerAliases []string `json:"trigger_aliases" extensions:"x-nullable"`
// RepeatLastPatch reuses the build variant/task definition of the user's
// most recent patch in this project. Mutually exclusive with RepeatFailed
// and RepeatPatchId.
RepeatLastPatch bool `json:"repeat_last_patch"`
// RepeatFailed reuses the failed tasks of the user's most recent patch in
// this project (or of RepeatPatchId, when set). Mutually exclusive with
// RepeatLastPatch and RepeatPatchId.
RepeatFailed bool `json:"repeat_failed"`
// RepeatPatchId reuses the build variant/task definition of the given
// patch. Mutually exclusive with RepeatLastPatch and RepeatFailed.
RepeatPatchId string `json:"repeat_patch_id"`
// Finalize activates the patch after creating it, starting its tasks. When
// false, the patch is created unactivated and can be activated later by
// setting "activated" on PATCH /patches/{patch_id}. A finalized patch
// needs both a variant selection and a task selection, whether given
// directly, through an alias, or reused via a repeat option.
Finalize bool `json:"finalize"`
}
CreatePatchRequest is the request body for creating a patch. The base repo diff ("patch") and module diffs are all optional: a patch with no diffs runs its tasks against the base commit. Repeat options are mutually exclusive with each other; each reuses the build variant/task definition from a previous patch instead of specifying variants and tasks.
func (*CreatePatchRequest) Validate ¶
func (r *CreatePatchRequest) Validate() error
Validate checks that the request is internally consistent.
type CreateSetupSecretResponse ¶
type CreateSetupSecretResponse struct {
SetupSecret string `json:"setup_secret"`
}
CreateSetupSecretResponse is what is returned when a new setup secret is created for a host.
type DisableInfo ¶
type DisableInfo struct {
Reason string `bson:"reason" json:"reason"`
}
type DisplayTaskInfo ¶
DisplayTaskInfo represents information about a display task necessary for creating a test result.
type DistroView ¶
type DistroView struct {
DisableShallowClone bool `json:"disable_shallow_clone"`
Mountpoints []string `json:"mountpoints"`
ExecUser string `json:"exec_user"`
ContainerIsolation *ContainerIsolationSettings `json:"container_isolation,omitempty"`
}
DistroView represents the view of data that the agent uses from the distro it is running on.
type EbsDevice ¶
type EbsDevice struct {
DeviceName string `mapstructure:"device_name" json:"device_name" yaml:"device_name"`
IOPS int `mapstructure:"ebs_iops" json:"ebs_iops" yaml:"ebs_iops"`
Throughput int `mapstructure:"ebs_throughput" json:"ebs_throughput" yaml:"ebs_throughput"`
SizeGiB int `mapstructure:"ebs_size" json:"ebs_size" yaml:"ebs_size"`
SnapshotID string `mapstructure:"ebs_snapshot_id" json:"ebs_snapshot_id" yaml:"ebs_snapshot_id"`
}
type EndTaskResponse ¶
type EndTaskResponse struct {
ShouldExit bool `json:"should_exit,omitempty"`
}
EndTaskResponse is what is returned when the task ends
type ExchangeSetupSecretResponse ¶
type ExchangeSetupSecretResponse struct {
HostSecret string `json:"host_secret"`
}
ExchangeSetupSecretResponse is what is returned when a host process exchanges its single-use setup secret for the host secret.
type ExpansionsAndVars ¶
type ExpansionsAndVars struct {
// Expansions contain the expansions for a task.
Expansions util.Expansions `json:"expansions"`
// Parameters contain the parameters for a task.
Parameters map[string]string `json:"parameters"`
// Vars contain the project variables and parameters.
Vars map[string]string `json:"vars"`
// PrivateVars contain the project private variables.
PrivateVars map[string]bool `json:"private_vars"`
// RedactKeys contain patterns to match against expansion keys for redaction
// in logs.
RedactKeys []string `json:"redact_keys"`
// InternalRedactions contain Evergreen-internal values that should not be
// usable by the task but should still be redacted from logs.
InternalRedactions map[string]string `json:"internal_redactions"`
// DevprodOwnedAWSAccountIDs contains the AWS account IDs of the accounts that are
// owned by Devprod that we want to calculate s3 costs for.
DevprodOwnedAWSAccountIDs []string `json:"devprod_owned_aws_account_ids,omitempty"`
// ArtifactAWSAccountsWithoutLifecycleRules contains the AWS account IDs of the accounts that we
// calculate s3 costs for but cannot read lifecycle rules from.
ArtifactAWSAccountsWithoutLifecycleRules []string `json:"artifact_aws_accounts_without_lifecycle_rules,omitempty"`
// SourceCacheBucket is the git.get_project source cache bucket resolved for the
// task's project. It is zero when the project is not opted in. Its RoleARN is
// left unset so a task cannot assume the role through the generic route.
SourceCacheBucket evergreen.BucketConfig `json:"source_cache_bucket,omitempty"`
}
ExpansionsAndVars represents expansions, project variables, and parameters used when running a task.
type ExternalExecutionMetadata ¶
type ExternalExecutionMetadata struct {
EngFlowInvocationID string `bson:"engflow_invocation_id,omitempty" json:"engflow_invocation_id,omitempty"`
ShardID string `bson:"shard_id,omitempty" json:"shard_id,omitempty"`
}
ExternalExecutionMetadata identifies the external execution that produced a virtual task's results.
type FailingCommand ¶
type FailingCommand struct {
FullDisplayName string `bson:"full_display_name,omitempty" json:"full_display_name,omitempty"`
FailureMetadataTags []string `bson:"failure_metadata_tags,omitempty" json:"failure_metadata_tags,omitempty"`
}
FailingCommand represents a command that failed in a task.
type GeneratePollResponse ¶
type GetNextTaskDetails ¶
type GetPerfCountOptions ¶
type GetPerfCountOptions struct {
SPSBaseURL string `json:"-"`
TaskID string `json:"-"`
Execution int `json:"-"`
}
GetPerfCountOptions represents the arguments for getting a count of perf results for a given task id.
type HeartbeatResponse ¶
type HeartbeatResponse struct {
Abort bool `json:"abort,omitempty"`
}
HeartbeatResponse is sent by the API server in response to the agent's heartbeat message.
type HighExecTimeoutReport ¶
type HighExecTimeoutReport struct {
ExecTimeoutSecs int `json:"exec_timeout_secs"`
}
HighExecTimeoutReport is the payload sent when a task dynamically sets an unusually high exec timeout.
type HostView ¶
type HostView struct {
Hostname string `json:"hostname"`
}
HostView includes a relevant subset of information the agent's own host.
type LogMessage ¶
type LogMessage struct {
Type string `bson:"t" json:"t"`
Severity string `bson:"s" json:"s"`
Message string `bson:"m" json:"m"`
Timestamp time.Time `bson:"ts" json:"ts"`
Version int `bson:"v" json:"v"`
}
The LogMessage type is used by the GraphQL resolver and HTML logs.
func ReadLogToSlice ¶
func ReadLogToSlice(it log.LogIterator) ([]*LogMessage, error)
ReadLogToSlice returns a slice of log message pointers from a log iterator.
type ModuleCloneInfo ¶
type NextTaskResponse ¶
type NextTaskResponse struct {
TaskId string `json:"task_id,omitempty"`
TaskExecution int `json:"task_execution,omitempty"`
TaskSecret string `json:"task_secret,omitempty"`
TaskGroup string `json:"task_group,omitempty"`
Version string `json:"version,omitempty"`
Build string `json:"build,omitempty"`
ShouldExit bool `json:"should_exit,omitempty"`
ShouldTeardownGroup bool `json:"should_teardown_group,omitempty"`
// EstimatedMaxIdleDuration is included in the response when there is no task to run.
// It helps the host be smart about retries to request the next task.
EstimatedMaxIdleDuration time.Duration `json:"estimated_max_idle_duration,omitempty"`
}
NextTaskResponse represents the response sent back when an agent asks for a next task
type OOMTrackerInfo ¶
type PerfCount ¶
type PerfCount struct {
NumberOfResults int `json:"number_of_results"`
}
PerfCount holds one element, NumberOfResults, matching the json returned by the perf count rest route.
func PerfResultsCount ¶
func PerfResultsCount(ctx context.Context, opts GetPerfCountOptions) (*PerfCount, error)
PerfResultsCount queries SPS for the number of perf results attached to a task.
type PrepareVirtualTasksRequest ¶
type PrepareVirtualTasksRequest struct {
Tasks []VirtualTaskPreparation `json:"tasks"`
}
PrepareVirtualTasksRequest is the request body for preparing (validating and locking) a batch of virtual tasks before their test results are uploaded.
type PrepareVirtualTasksResponse ¶
type PrepareVirtualTasksResponse struct {
Results []VirtualTaskPreparationResult `json:"results"`
}
PrepareVirtualTasksResponse contains the per-task outcomes of a preparation.
type ProcessTimeoutResponse ¶
type ProcessTimeoutResponse struct {
Status string `json:"status"`
LateProcesses any `json:"late_mci_processes,omitempty"`
}
Struct for reporting process timeouts
type RegistrySettings ¶
type RegistrySettings struct {
Name string `mapstructure:"registry_name" json:"registry_name" yaml:"registry_name"`
Username string `mapstructure:"registry_username" json:"registry_username" yaml:"registry_username"`
Password string `mapstructure:"registry_password" json:"registry_password" yaml:"registry_password"`
}
type ResourceConstraintInfo ¶
type ResourceConstraintInfo struct {
CPUConstrained bool `bson:"cpu_constrained" json:"cpu_constrained"`
MemoryConstrained bool `bson:"memory_constrained" json:"memory_constrained"`
PeakCPUPercent float64 `bson:"peak_cpu_percent,omitempty" json:"peak_cpu_percent,omitempty"`
PeakMemoryPercent float64 `bson:"peak_memory_percent,omitempty" json:"peak_memory_percent,omitempty"`
}
type S3CopyRequest ¶
type S3CopyRequest struct {
S3SourceRegion string `json:"s3_source_region"`
S3SourceBucket string `json:"s3_source_bucket"`
S3SourcePath string `json:"s3_source_path"`
S3DestinationRegion string `json:"s3_destination_region"`
S3DestinationBucket string `json:"s3_destination_bucket"`
S3DestinationPath string `json:"s3_destination_path"`
S3DisplayName string `json:"display_name"`
S3Permissions string `json:"s3_permissions"`
}
S3CopyRequest holds information necessary for the API server to complete an S3 copy request; namely, an S3 key/secret, a source and a destination path
type S3CredentialsRequest ¶
type S3CredentialsRequest struct {
// Bucket is the name of the S3 bucket to access.
Bucket string `json:"bucket"`
}
S3CredentialsRequest contains the s3 bucket to access.
func (*S3CredentialsRequest) Validate ¶
func (ar *S3CredentialsRequest) Validate() error
Validate checks that the request has valid values.
type SourceCacheClaimResponse ¶
type SourceCacheClaimResponse struct {
// Claimed is true when this task may archive and upload the artifact.
Claimed bool `json:"claimed"`
}
SourceCacheClaimResponse reports whether this task may save the source cache artifact.
type SourceCacheCredentialsRequest ¶
type SourceCacheCredentialsRequest struct {
Branch string `json:"branch"`
CloneDepth int `json:"clone_depth"`
RecurseSubmodules bool `json:"recurse_submodules"`
}
SourceCacheCredentialsRequest carries the clone shape the agent resolved, which is the only input to a cache key the server cannot derive from the task.
type SourceCacheCredentialsResponse ¶
type SourceCacheCredentialsResponse struct {
AWSCredentials
// RestoreKeys are the objects to try, most specific first.
RestoreKeys []SourceCacheRestoreKey `json:"restore_keys"`
// SaveKey is the object the task uploads its own tree to.
SaveKey SourceCacheRestoreKey `json:"save_key"`
}
SourceCacheCredentialsResponse carries source cache credentials and the exact restore and save keys the server granted them.
type SourceCacheRestoreKey ¶
type SourceCacheRestoreKey struct {
// Revision is the commit the object's tree is expected to be at.
Revision string `json:"revision"`
// Key is the S3 object key of the artifact.
Key string `json:"key"`
// PRCheckout is true when the artifact's tree is not at the revision the task
// will test, so the agent must check out the PR over the restored tree.
PRCheckout bool `json:"pr_checkout"`
// TagTriggered is true when a git tag push triggered the build, so the
// restored tree must see the tag or the agent falls back to a clone.
TagTriggered bool `json:"tag_triggered"`
}
SourceCacheRestoreKey is one source cache object a task may restore.
type TaskEndDetail ¶
type TaskEndDetail struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
Type string `bson:"type,omitempty" json:"type,omitempty"`
PostErrored bool `bson:"post_errored,omitempty" json:"post_errored,omitempty"`
Description string `bson:"desc,omitempty" json:"desc,omitempty"`
FailingCommand string `bson:"failing_command,omitempty" json:"failing_command,omitempty"`
// FailureMetadataTags are user metadata tags associated with the
// command that caused the task to fail.
FailureMetadataTags []string `bson:"failure_metadata_tags,omitempty" json:"failure_metadata_tags,omitempty"`
// OtherFailingCommands contains information about commands that failed
// while the task was running but did not cause the task to fail.
OtherFailingCommands []FailingCommand `bson:"other_failing_commands,omitempty" json:"other_failing_commands,omitempty"`
TimedOut bool `bson:"timed_out,omitempty" json:"timed_out,omitempty"`
TimeoutType string `bson:"timeout_type,omitempty" json:"timeout_type,omitempty"`
TimeoutDuration time.Duration `bson:"timeout_duration,omitempty" json:"timeout_duration,omitempty" swaggertype:"primitive,integer"`
OOMTracker *OOMTrackerInfo `bson:"oom_killer,omitempty" json:"oom_killer,omitempty"`
TimeoutProcessInfo *TimeoutProcessInfo `bson:"timeout_processes,omitempty" json:"timeout_processes" extensions:"x-nullable"`
Modules ModuleCloneInfo `bson:"modules,omitempty" json:"modules"`
TraceID string `bson:"trace_id,omitempty" json:"trace_id,omitempty"`
DiskDevices []string `bson:"disk_devices,omitempty" json:"disk_devices,omitempty"`
ResourceConstraints *ResourceConstraintInfo `bson:"resource_constraints,omitempty" json:"resource_constraints,omitempty"`
ExecutionPlatform string `bson:"execution_platform,omitempty" json:"execution_platform,omitempty"`
// ExternalExecutionMetadata is only set for push-completed virtual tasks.
ExternalExecutionMetadata *ExternalExecutionMetadata `bson:"external_execution_metadata,omitempty" json:"external_execution_metadata,omitempty"`
// SystemFailureReason is a human-readable explanation of why the task's
// host or agent was lost. It is only set by the app server for system
// failures.
SystemFailureReason string `bson:"system_failure_reason,omitempty" json:"system_failure_reason,omitempty"`
}
TaskEndDetail contains data sent from the agent to the API server after each task run. This should be used to store data relating to what happened when the task ran
func (*TaskEndDetail) IsEmpty ¶
func (ted *TaskEndDetail) IsEmpty() bool
type TaskEndDetails ¶
type TaskStartRequest ¶
type TaskStartRequest struct {
TraceID string `json:"trace_id,omitempty"`
DiskDevices []string `json:"disk_devices,omitempty"`
}
TaskStartRequest holds information sent by the agent to the API server at the beginning of each task run.
type TaskTestResultsInfo ¶
type TaskTestResultsInfo struct {
Failed bool `json:"failed"`
}
TaskTestResultsInfo contains metadata related to test results persisted for a given task.
type TimeoutProcessInfo ¶
type TimeoutProcessInfo struct {
CurrentCommand string `bson:"current_command,omitempty" json:"current_command,omitempty"`
CurrentCommandPID int `bson:"current_command_pid,omitempty" json:"current_command_pid,omitempty"`
RunningPIDs []int `bson:"running_pids,omitempty" json:"running_pids,omitempty"`
ChildPIDs []int `bson:"child_pids,omitempty" json:"child_pids,omitempty"`
Timestamp time.Time `bson:"timestamp,omitempty" json:"timestamp,omitempty"`
}
TimeoutProcessInfo contains process information collected when a task times out
type Token ¶
type Token struct {
Token string `json:"token"`
Permissions *github.InstallationPermissions `json:"permissions"`
}
Token is a struct which wraps a GitHub generated token and associated permissions
type VirtualTaskArtifact ¶
type VirtualTaskArtifact struct {
Name string `json:"name"`
URL string `json:"url"`
Visibility string `json:"visibility,omitempty"`
}
VirtualTaskArtifact describes an artifact file pushed for a virtual task.
type VirtualTaskCompletion ¶
type VirtualTaskCompletion struct {
TaskID string `json:"task_id"`
// Execution must match the task's current execution or the completion
// no-ops.
Execution int `json:"execution"`
Status string `json:"status"`
TestResults *VirtualTaskTestResults `json:"test_results,omitempty"`
Artifacts []VirtualTaskArtifact `json:"artifacts,omitempty"`
ExternalMetadata *ExternalExecutionMetadata `json:"external_metadata,omitempty"`
}
VirtualTaskCompletion contains the final results for a single virtual task.
type VirtualTaskCompletionResult ¶
type VirtualTaskCompletionResult struct {
TaskID string `json:"task_id"`
Outcome string `json:"outcome"`
Reason string `json:"reason,omitempty"`
}
VirtualTaskCompletionResult is the outcome of completing a single virtual task in a push completion.
type VirtualTaskPreparation ¶
type VirtualTaskPreparation struct {
TaskID string `json:"task_id"`
Execution int `json:"execution"`
}
VirtualTaskPreparation identifies a virtual task to prepare for test result upload.
type VirtualTaskPreparationResult ¶
type VirtualTaskPreparationResult struct {
TaskID string `json:"task_id"`
Outcome string `json:"outcome"`
Reason string `json:"reason,omitempty"`
// TestResultsInfo is set only when the task is ready for test result
// upload. It is nil when the preparation no-ops (e.g. the task is already
// finished or running).
TestResultsInfo *testresult.TestResultsInfo `json:"test_results_info,omitempty"`
// TaskCreateTime is the virtual task's creation time, used when building the
// uploaded test results.
TaskCreateTime time.Time `json:"task_create_time,omitzero"`
}
VirtualTaskPreparationResult is the outcome of preparing a single virtual task.
type VirtualTaskTestResults ¶
type VirtualTaskTestResults struct {
Stats testresult.TaskTestResultsStats `json:"stats"`
FailedSample []string `json:"failed_sample,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
VirtualTaskTestResults contains test result metadata pushed for a virtual task.