model

package
v0.0.0-...-6be7acf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 52 Imported by: 44

Documentation

Overview

Package model maps database models to API models for REST requests to the server.

Adding Models

Each model is kept in the model package of the REST v2 API in its own file. To create a new model, define a struct containing all of the fields that it will return and implement its two main methods BuildFromService and ToService. Be sure to include struct tags to define the names the fields will have when serialized to JSON.

Note that although it's generally recommended to implement some BuildFromService and ToService methods to facilitate conversion between the REST and service models, it's not necessary to implement the Model interface's exact method definition (i.e. passing in interface{} and returning interface{}). The Model interface is only necessary for a few special cases (e.g. reflection in admin settings); for most REST models, it's much preferred to pass in the concrete service model type and return the concrete service model type rather than pass around interface{} and then type cast it into its expected type.

Guidelines for Creating Models

Include as much data as a user is likely to want when inspecting this resource. This is likely to be more information than seems directly needed, but there is little penalty to its inclusion.

Model Methods

The Model type is an interface with two methods.

BuildFromService(in interface{}) error

BuildFromService fetches all needed data from the passed in object and sets them on the model. BuildFromService may sometimes be called multiple times with different types that all contain data to build up the model object. In this case, a type switch is likely necessary to determine what has been passed in.

ToService()(interface{}, error)

ToService creates an as-complete-as-possible version of the service layer's version of this model. For example, if this is is a REST v2 Task model, the ToService method creates a service layer Task and sets all of the fields it is able to and returns it.

Index

Constants

View Source
const (
	OktaPreferredType   = "okta"
	NaivePreferredType  = "naive"
	GithubPreferredType = "github"
	MultiPreferredType  = "multi"
	KanopyPreferredType = "kanopy"
)
View Source
const (
	TaskLogLinkFormat        = "%s/task_log_raw/%s/%d?type=%s"
	ParsleyTaskLogLinkFormat = "%s/evergreen/%s/%d/%s"
)
View Source
const (
	// APITimeFormat defines ISO-8601 UTC with 3 fractional seconds behind a dot
	// specified by the API spec document.
	APITimeFormat = "\"2006-01-02T15:04:05.000Z\""
)

Variables

This section is empty.

Functions

func APIIssueLinkToService

func APIIssueLinkToService(m APIIssueLink) *annotations.IssueLink

APIIssueLinkToService takes the APIIssueLink REST struct and returns the DB struct *annotations.IssueLink with the corresponding fields populated

func APIMetadataLinkToService

func APIMetadataLinkToService(m APIMetadataLink) *annotations.MetadataLink

APIMetadataLinkToService takes the APIMetadataLink REST struct and returns the DB struct *annotations.MetadataLink with the corresponding fields populated

func APIMetadataLinksToService

func APIMetadataLinksToService(t []*APIMetadataLink) []annotations.MetadataLink

APIMetadataLinksToService converts a slice of APIMetadataLink to a slice of annotations.MetadataLink

func APINoteToService

func APINoteToService(m *APINote) *annotations.Note

APINoteToService takes the APINote REST struct and returns the DB struct *annotations.Note with the corresponding fields populated

func APISourceToService

func APISourceToService(m *APISource) *annotations.Source

APISourceToService takes the APISource REST struct and returns the DB struct *annotations.Source with the corresponding fields populated

func APITaskAnnotationToService

func APITaskAnnotationToService(m APITaskAnnotation) *annotations.TaskAnnotation

APITaskAnnotationToService takes the APITaskAnnotation REST struct and returns the DB struct *annotations.TaskAnnotation with the corresponding fields populated

func ArrstringArrstring

func ArrstringArrstring(t []string) []string
func BuildIssueLinks(t []APIIssueLink) []annotations.IssueLink

BuildIssueLinks converts a slice of APIIssueLink to a slice of annotations.IssueLink

func FromTimePtr

func FromTimePtr(t *time.Time) (time.Time, error)

func GetJiraTicketFromURL

func GetJiraTicketFromURL(ctx context.Context, jiraURL string) (*thirdparty.JiraTicket, error)

func MarshalAPIDuration

func MarshalAPIDuration(b APIDuration) graphql.Marshaler

func ParseTime

func ParseTime(tval string) (time.Time, error)

func RestoreRedactedFileTicketWebhookSecret

func RestoreRedactedFileTicketWebhookSecret(updated *evergreen.AnnotationsSettings, current evergreen.AnnotationsSettings)

RestoreRedactedFileTicketWebhookSecret replaces a redacted placeholder with the currently stored secret.

func ShouldHideCostForProject

func ShouldHideCostForProject(projectID string) bool

shouldHideCostForProject reports whether cost fields should be suppressed in API responses for the given project ID.

func StringPtrString

func StringPtrString(in *string) string

func StringString

func StringString(in string) string

func StringStringPtr

func StringStringPtr(in string) *string

func ToTimePtr

func ToTimePtr(t time.Time) *time.Time

func UpdateUserSettings

func UpdateUserSettings(ctx context.Context, usr *user.DBUser, userSettings APIUserSettings) (*user.UserSettings, error)

UpdateUserSettings Returns an updated version of the user settings struct

func ValidateIssues

func ValidateIssues(issues []APIIssueLink) error

Types

type APIAWSAccountRoleMapping

type APIAWSAccountRoleMapping struct {
	Account *string `json:"account"`
	Role    *string `json:"role"`
}

func (*APIAWSAccountRoleMapping) BuildFromService

func (*APIAWSAccountRoleMapping) ToService

type APIAWSConfig

type APIAWSConfig struct {
	Subnets                []APISubnet                `json:"subnets"`
	ResourceTags           *APIResourceTagsConfig     `json:"resource_tags"`
	SubnetTagName          *string                    `json:"subnet_tag_name"`
	SubnetTagValue         *string                    `json:"subnet_tag_value"`
	ParserProject          *APIParserProjectS3Config  `json:"parser_project"`
	PersistentDNS          *APIPersistentDNSConfig    `json:"persistent_dns"`
	DefaultSecurityGroup   *string                    `json:"default_security_group"`
	AllowedInstanceTypes   []*string                  `json:"allowed_instance_types"`
	AlertableInstanceTypes []*string                  `json:"alertable_instance_types"`
	AllowedRegions         []*string                  `json:"allowed_regions"`
	MaxVolumeSizePerUser   *int                       `json:"max_volume_size"`
	AccountRoles           []APIAWSAccountRoleMapping `json:"account_roles"`
	IPAMPoolID             *string                    `json:"ipam_pool_id"`
	ElasticIPUsageRate     *float64                   `json:"elastic_ip_usage_rate"`
	AllowedSNSTopicARNs    []*string                  `json:"allowed_sns_topic_arns"`
}

func (*APIAWSConfig) BuildFromService

func (a *APIAWSConfig) BuildFromService(h any) error

func (*APIAWSConfig) ToService

func (a *APIAWSConfig) ToService() (any, error)

type APIAWSVPCConfig

type APIAWSVPCConfig struct {
	Subnets        []string `json:"subnets,omitempty"`
	SecurityGroups []string `json:"security_groups,omitempty"`
}

APIAWSVPCConfig represents configuration options for tasks in ECS using AWSVPC networking.

func (*APIAWSVPCConfig) BuildFromService

func (a *APIAWSVPCConfig) BuildFromService(conf evergreen.AWSVPCConfig)

func (*APIAWSVPCConfig) ToService

func (a *APIAWSVPCConfig) ToService() evergreen.AWSVPCConfig

type APIAbortInfo

type APIAbortInfo struct {
	User       string `json:"user,omitempty"`
	TaskID     string `json:"task_id,omitempty"`
	NewVersion string `json:"new_version,omitempty"`
	PRClosed   bool   `json:"pr_closed,omitempty"`
}

type APIAdminEvent

type APIAdminEvent struct {
	Timestamp *time.Time `json:"ts"`
	User      string     `json:"user"`
	Section   string     `json:"section"`
	Before    Model      `json:"before"`
	After     Model      `json:"after"`
	Guid      string     `json:"guid"`
}

func (*APIAdminEvent) BuildFromService

func (e *APIAdminEvent) BuildFromService(h any) error

func (*APIAdminEvent) ToService

func (e *APIAdminEvent) ToService() (any, error)

type APIAdminSettings

type APIAdminSettings struct {
	Amboy                   *APIAmboyConfig               `json:"amboy,omitempty"`
	AmboyDB                 *APIAmboyDBConfig             `json:"amboy_db,omitempty"`
	Api                     *APIapiConfig                 `json:"api,omitempty"`
	AWSInstanceRole         *string                       `json:"aws_instance_role,omitempty"`
	AuthConfig              *APIAuthConfig                `json:"auth,omitempty"`
	OktaServiceConfig       *APIOktaServiceConfig         `json:"okta_service,omitempty"`
	Banner                  *string                       `json:"banner,omitempty"`
	BannerTheme             *string                       `json:"banner_theme,omitempty"`
	Buckets                 *APIBucketsConfig             `json:"buckets,omitempty"`
	Cedar                   *APICedarConfig               `json:"cedar,omitempty"`
	ConfigDir               *string                       `json:"configdir,omitempty"`
	ContainerPools          *APIContainerPoolsConfig      `json:"container_pools,omitempty"`
	DebugSpawnHosts         *APIDebugSpawnHostsConfig     `json:"debug_spawn_hosts,omitempty"`
	Diagnostics             *APIDiagnosticsConfig         `json:"diagnostics,omitempty"`
	DomainName              *string                       `json:"domain_name,omitempty"`
	Expansions              map[string]string             `json:"expansions,omitempty"`
	Cost                    *APICostConfig                `json:"cost,omitempty"`
	FWS                     *APIFWSConfig                 `json:"fws,omitempty"`
	Graphite                *APIGraphiteConfig            `json:"graphite,omitempty"`
	GithubPRCreatorOrg      *string                       `json:"github_pr_creator_org,omitempty"`
	GithubOrgs              []string                      `json:"github_orgs,omitempty"`
	GithubWebhookSecret     *string                       `json:"github_webhook_secret,omitempty"`
	ArtifactSignSecret      *string                       `json:"artifact_sign_secret,omitempty"`
	DisabledGQLQueries      []string                      `json:"disabled_gql_queries"`
	HostInit                *APIHostInitConfig            `json:"hostinit,omitempty"`
	HostJasper              *APIHostJasperConfig          `json:"host_jasper,omitempty"`
	Jira                    *APIJiraConfig                `json:"jira,omitempty"`
	JIRANotifications       *APIJIRANotificationsConfig   `json:"jira_notifications,omitempty"`
	LoggerConfig            *APILoggerConfig              `json:"logger_config,omitempty"`
	LogPath                 *string                       `json:"log_path,omitempty"`
	Notify                  *APINotifyConfig              `json:"notify,omitempty"`
	OldestAllowedCLIVersion *string                       `json:"oldest_allowed_cli_version"`
	Overrides               *APIOverridesConfig           `json:"overrides,omitempty"`
	ParameterStore          *APIParameterStoreConfig      `json:"parameter_store,omitempty"`
	PerfMonitoringURL       *string                       `json:"perf_monitoring_url"`
	PerfMonitoringKanopyURL *string                       `json:"perf_monitoring_kanopy_url"`
	Plugins                 map[string]map[string]any     `json:"plugins,omitempty"`
	PprofPort               *string                       `json:"pprof_port,omitempty"`
	ProjectCreation         *APIProjectCreationConfig     `json:"project_creation,omitempty"`
	Providers               *APICloudProviders            `json:"providers,omitempty"`
	RateLimit               *APIRateLimitConfig           `json:"rate_limit,omitempty"`
	RepoTracker             *APIRepoTrackerConfig         `json:"repotracker,omitempty"`
	ReleaseMode             *APIReleaseModeConfig         `json:"release_mode,omitempty"`
	RuntimeEnvironments     *APIRuntimeEnvironmentsConfig `json:"runtime_environments,omitempty"`
	Scheduler               *APISchedulerConfig           `json:"scheduler,omitempty"`
	ServiceFlags            *APIServiceFlags              `json:"service_flags,omitempty"`
	SingleTaskDistro        *APISingleTaskDistroConfig    `json:"single_task_distro,omitempty"`
	Slack                   *APISlackConfig               `json:"slack,omitempty"`
	SleepSchedule           *APISleepScheduleConfig       `json:"sleep_schedule,omitempty"`
	SSH                     *APISSHConfig                 `json:"ssh,omitempty"`
	Splunk                  *APISplunkConfig              `json:"splunk,omitempty"`
	TaskLimits              *APITaskLimitsConfig          `json:"task_limits,omitempty"`
	TestSelection           *APITestSelectionConfig       `json:"test_selection,omitempty"`
	Triggers                *APITriggerConfig             `json:"triggers,omitempty"`
	Ui                      *APIUIConfig                  `json:"ui,omitempty"`
	Spawnhost               *APISpawnHostConfig           `json:"spawnhost,omitempty"`
	Tracer                  *APITracerSettings            `json:"tracer,omitempty"`
	GitHubCheckRun          *APIGitHubCheckRunConfig      `json:"github_check_run,omitempty"`
	ShutdownWaitSeconds     *int                          `json:"shutdown_wait_seconds,omitempty"`
	Sage                    *APISageConfig                `json:"sage,omitempty"`
}

APIAdminSettings is the structure of a response to the admin route

func NewConfigModel

func NewConfigModel() *APIAdminSettings

func (*APIAdminSettings) BuildFromService

func (as *APIAdminSettings) BuildFromService(h any) error

BuildFromService builds a model from the service layer

func (*APIAdminSettings) ToService

func (as *APIAdminSettings) ToService() (any, error)

ToService returns a service model from an API model

type APIAmboyConfig

type APIAmboyConfig struct {
	Name                                  *string                    `json:"name"`
	SingleName                            *string                    `json:"single_name"`
	PoolSizeLocal                         int                        `json:"pool_size_local"`
	PoolSizeRemote                        int                        `json:"pool_size_remote"`
	LocalStorage                          int                        `json:"local_storage_size"`
	GroupDefaultWorkers                   int                        `json:"group_default_workers"`
	GroupBackgroundCreateFrequencyMinutes int                        `json:"group_background_create_frequency"`
	GroupPruneFrequencyMinutes            int                        `json:"group_prune_frequency"`
	GroupTTLMinutes                       int                        `json:"group_ttl"`
	LockTimeoutMinutes                    int                        `json:"lock_timeout_minutes"`
	SampleSize                            int                        `json:"sample_size"`
	Retry                                 APIAmboyRetryConfig        `json:"retry"`
	NamedQueues                           []APIAmboyNamedQueueConfig `json:"named_queues,omitempty"`
}

func (*APIAmboyConfig) BuildFromService

func (a *APIAmboyConfig) BuildFromService(h any) error

func (*APIAmboyConfig) ToService

func (a *APIAmboyConfig) ToService() (any, error)

type APIAmboyDBConfig

type APIAmboyDBConfig struct {
	URL      *string `json:"url"`
	Database *string `json:"database"`
}

func (*APIAmboyDBConfig) BuildFromService

func (a *APIAmboyDBConfig) BuildFromService(h any) error

func (*APIAmboyDBConfig) ToService

func (a *APIAmboyDBConfig) ToService() (any, error)

type APIAmboyNamedQueueConfig

type APIAmboyNamedQueueConfig struct {
	Name               *string `json:"name"`
	Regexp             *string `json:"regexp"`
	NumWorkers         int     `json:"num_workers,omitempty"`
	SampleSize         int     `json:"sample_size,omitempty"`
	LockTimeoutSeconds int     `json:"lock_timeout_seconds,omitempty"`
}

APIAmboyNamedQueueConfig is the model for named Amboy queue settings.

func (*APIAmboyNamedQueueConfig) BuildFromService

func (*APIAmboyNamedQueueConfig) ToService

type APIAmboyRetryConfig

type APIAmboyRetryConfig struct {
	NumWorkers                          int `json:"num_workers,omitempty"`
	MaxCapacity                         int `json:"max_capacity,omitempty"`
	MaxRetryAttempts                    int `json:"max_retry_attempts,omitempty"`
	MaxRetryTimeSeconds                 int `json:"max_retry_time_seconds,omitempty"`
	RetryBackoffSeconds                 int `json:"retry_backoff_seconds,omitempty"`
	StaleRetryingMonitorIntervalSeconds int `json:"stale_retrying_monitor_interval_seconds,omitempty"`
}

func (*APIAmboyRetryConfig) BuildFromService

func (a *APIAmboyRetryConfig) BuildFromService(h any) error

func (*APIAmboyRetryConfig) ToService

func (a *APIAmboyRetryConfig) ToService() (any, error)

type APIArtifactCredentialSettings

type APIArtifactCredentialSettings struct {
	// Name of the project variable holding the AWS access key ID.
	AWSKeyVarName *string `json:"aws_key_var_name" extensions:"!x-nullable"`
	// Name of the project variable holding the AWS secret access key.
	AWSSecretVarName *string `json:"aws_secret_var_name" extensions:"!x-nullable"`
}

APIArtifactCredentialSettings names the source of a project's artifact AWS credentials. Credentials are variable names, never values.

func (*APIArtifactCredentialSettings) BuildFromService

func (s *APIArtifactCredentialSettings) BuildFromService(settings model.ArtifactCredentialSettings)

func (*APIArtifactCredentialSettings) ToService

type APIAssociatedLink struct {
	Name *string `json:"name" extensions:"!x-nullable"`
	Link *string `json:"url" extensions:"!x-nullable"`
}

type APIAuthConfig

type APIAuthConfig struct {
	Okta                    *APIOktaConfig       `json:"okta"`
	Naive                   *APINaiveAuthConfig  `json:"naive"`
	Github                  *APIGithubAuthConfig `json:"github"`
	Multi                   *APIMultiAuthConfig  `json:"multi"`
	Kanopy                  *APIKanopyAuthConfig `json:"kanopy"`
	OAuth                   *APIOAuthConfig      `json:"oauth"`
	PreferredType           *string              `json:"preferred_type"`
	BackgroundReauthMinutes int                  `json:"background_reauth_minutes"`
	AllowServiceUsers       bool                 `json:"allow_service_users"`
}

func (*APIAuthConfig) BuildFromService

func (a *APIAuthConfig) BuildFromService(h any) error

func (*APIAuthConfig) ToService

func (a *APIAuthConfig) ToService() (any, error)

type APIAuthUser

type APIAuthUser struct {
	Username    *string `json:"username"`
	DisplayName *string `json:"display_name"`
	Password    *string `json:"password"`
	Email       *string `json:"email"`
}

func (*APIAuthUser) BuildFromService

func (a *APIAuthUser) BuildFromService(h any) error

func (*APIAuthUser) ToService

func (a *APIAuthUser) ToService() (any, error)

type APIAvailablePermissions

type APIAvailablePermissions struct {
	Note        string                          `json:"note"`
	Permissions map[string][]APIPermissionLevel `json:"permissions" extensions:"!x-nullable"`
}

APIAvailablePermissions wraps the system-wide permission levels with a note clarifying their scope.

type APIBanner

type APIBanner struct {
	Text  *string `json:"banner" extensions:"x-nullable"`
	Theme *string `json:"theme" extensions:"x-nullable"`
}

APIBanner is a public structure representing the banner part of the admin settings

func (*APIBanner) BuildFromService

func (ab *APIBanner) BuildFromService(h any) error

BuildFromService builds a model from the service layer

func (*APIBanner) ToService

func (ab *APIBanner) ToService() (any, error)

ToService is not yet implemented

type APIBaseTaskInfo

type APIBaseTaskInfo struct {
	Id     *string `json:"id" extensions:"x-nullable"`
	Status *string `json:"status" extensions:"x-nullable"`
}

type APIBetaFeatures

type APIBetaFeatures struct {
	SpruceWaterfallEnabled bool `json:"spruce_waterfall_enabled"`
}

APIBetaFeatures is the API model for BetaFeatures.

func (*APIBetaFeatures) BuildFromService

func (a *APIBetaFeatures) BuildFromService(b evergreen.BetaFeatures)

BuildFromService converts from service level BetaFeatures to APIBetaFeatures.

func (*APIBetaFeatures) ToService

func (a *APIBetaFeatures) ToService() evergreen.BetaFeatures

ToService returns a service layer BetaFeatures using the data from APIBetaFeatures.

type APIBootstrapSettings

type APIBootstrapSettings struct {
	Method                *string                        `json:"method" extensions:"!x-nullable"`
	Communication         *string                        `json:"communication" extensions:"!x-nullable"`
	ClientDir             *string                        `json:"client_dir" extensions:"!x-nullable"`
	JasperBinaryDir       *string                        `json:"jasper_binary_dir" extensions:"!x-nullable"`
	JasperCredentialsPath *string                        `json:"jasper_credentials_path" extensions:"!x-nullable"`
	ServiceUser           *string                        `json:"service_user" extensions:"!x-nullable"`
	ShellPath             *string                        `json:"shell_path" extensions:"!x-nullable"`
	RootDir               *string                        `json:"root_dir" extensions:"!x-nullable"`
	Env                   []APIEnvVar                    `json:"env" extensions:"x-nullable"`
	ResourceLimits        APIResourceLimits              `json:"resource_limits"`
	PreconditionScripts   []APIPreconditionScript        `json:"precondition_scripts" extensions:"x-nullable"`
	ContainerIsolation    *APIContainerIsolationSettings `json:"container_isolation" extensions:"!x-nullable"`
}

func (*APIBootstrapSettings) BuildFromService

func (s *APIBootstrapSettings) BuildFromService(settings distro.BootstrapSettings)

BuildFromService converts from service level distro.BootstrapSettings to an APIBootstrapSettings.

func (*APIBootstrapSettings) ToService

ToService returns a service layer distro.BootstrapSettings using the data from APIBootstrapSettings.

type APIBucketConfig

type APIBucketConfig struct {
	Name                    *string    `json:"name"`
	Type                    *string    `json:"type"`
	DBName                  *string    `json:"db_name"`
	TestResultsPrefix       *string    `json:"test_results_prefix"`
	RoleARN                 *string    `json:"role_arn"`
	ExternalID              *string    `json:"external_id,omitempty"`
	ExpirationDays          *int       `json:"expiration_days,omitempty"`
	TransitionToIADays      *int       `json:"transition_to_ia_days,omitempty"`
	TransitionToGlacierDays *int       `json:"transition_to_glacier_days,omitempty"`
	LifecycleLastSyncedAt   *time.Time `json:"lifecycle_last_synced_at,omitempty"`
	LifecycleSyncError      *string    `json:"lifecycle_sync_error,omitempty"`
}

func (APIBucketConfig) ToService

func (a APIBucketConfig) ToService() evergreen.BucketConfig

type APIBucketsConfig

type APIBucketsConfig struct {
	LogBucket                      APIBucketConfig `json:"log_bucket"`
	LogBucketLongRetention         APIBucketConfig `json:"log_bucket_long_retention"`
	LogBucketFailedTasks           APIBucketConfig `json:"log_bucket_failed_tasks"`
	LongRetentionProjects          []string        `json:"long_retention_projects"`
	RetryFailedLogMoveLookbackDays *int            `json:"retry_failed_log_move_lookback_days,omitempty"`
	// Kept for Spruce backward compatibility.
	RetryFailedLogMoveLookbackMonths *int             `json:"retry_failed_log_move_lookback_months,omitempty"`
	RetryFailedLogMoveMaxJobsPerRun  *int             `json:"retry_failed_log_move_max_jobs_per_run,omitempty"`
	TestResultsBucket                APIBucketConfig  `json:"test_results_bucket"`
	SourceCacheBucket                APIBucketConfig  `json:"source_cache_bucket"`
	SourceCacheOptOutProjects        []string         `json:"source_cache_opt_out_projects"`
	InternalBuckets                  []string         `json:"internal_buckets"`
	Credentials                      APIS3Credentials `json:"credentials"`
}

func (*APIBucketsConfig) BuildFromService

func (a *APIBucketsConfig) BuildFromService(h any) error

func (*APIBucketsConfig) ToService

func (a *APIBucketsConfig) ToService() (any, error)

type APIBuild

type APIBuild struct {
	Id *string `json:"_id" extensions:"!x-nullable"`
	// The identifier of the project this build represents
	ProjectId         *string `json:"project_id" extensions:"!x-nullable"`
	ProjectIdentifier *string `json:"project_identifier" extensions:"x-nullable"`
	// Time at which build was created
	CreateTime *time.Time `json:"create_time" extensions:"x-nullable"`
	// Time at which build started running tasks
	StartTime *time.Time `json:"start_time" extensions:"x-nullable"`
	// Time at which build finished running all tasks
	FinishTime *time.Time `json:"finish_time" extensions:"x-nullable"`
	// The version this build is running tasks for
	Version *string `json:"version" extensions:"!x-nullable"`
	// Hash of the revision on which this build is running
	Revision *string `json:"git_hash" extensions:"!x-nullable"`
	// Build distro and architecture information
	BuildVariant *string `json:"build_variant" extensions:"!x-nullable"`
	// The status of the build (possible values are "created", "started", "success", or "failed")
	Status *string `json:"status" extensions:"!x-nullable"`
	// Whether this build was manually initiated
	Activated bool `json:"activated"`
	// Who initiated the build
	ActivatedBy *string `json:"activated_by" extensions:"!x-nullable"`
	// When the build was initiated
	ActivatedTime *time.Time `json:"activated_time" extensions:"x-nullable"`
	// Incrementing counter of project's builds
	RevisionOrderNumber int `json:"order"`
	// Contains a subset of information about tasks for the build; this is not
	// provided/accurate for most routes (get versions for project is an
	// exception).
	TaskCache []APITaskCache `json:"task_cache,omitempty"`
	// Tasks is the build's task cache with just the names
	Tasks []string `json:"tasks" extensions:"x-nullable"`
	// List of tags defined for the build variant, if any
	Tags []*string `json:"tags,omitempty"`
	// How long the build took to complete all tasks
	TimeTaken APIDuration `json:"time_taken_ms"`
	// Displayed title of the build showing version and variant running
	DisplayName *string `json:"display_name" extensions:"!x-nullable"`
	// Predicted makespan by the scheduler prior to execution
	PredictedMakespan APIDuration `json:"predicted_makespan_ms"`
	// Actual makespan measured during execution
	ActualMakespan APIDuration `json:"actual_makespan_ms"`
	// The source of the patch, a commit or a patch
	Origin *string `json:"origin" extensions:"!x-nullable"`
	// Contains aggregated data about the statuses of tasks in this build. The
	// keys of this object are statuses and the values are the number of tasks
	// within this build in that status. Note that this field provides data that
	// you can get yourself by querying tasks for this build.
	StatusCounts task.TaskStatusCount `json:"status_counts"`
	// Some routes will return information about the variant as defined in the
	// project. Does not expand expansions; they will be returned as written in
	// the project yaml (i.e. ${syntax})
	DefinitionInfo DefinitionInfo `json:"definition_info"`
}

APIBuild is the model to be returned by the API whenever builds are fetched.

func (*APIBuild) BuildFromService

func (apiBuild *APIBuild) BuildFromService(ctx context.Context, v build.Build, pp *model.ParserProject)

BuildFromService converts from service level structs to an APIBuild. APIBuild.ProjectId is set in the route builder's Execute method. If ParserProject isn't nil, include info from project (not applicable to matrix builds).

func (*APIBuild) SetTaskCache

func (apiBuild *APIBuild) SetTaskCache(tasks []task.Task)

type APIBuildBaronSettings

type APIBuildBaronSettings struct {
	// Jira project where tickets should be created.
	TicketCreateProject *string `bson:"ticket_create_project" json:"ticket_create_project" extensions:"!x-nullable"`
	// Type of ticket to create.
	TicketCreateIssueType *string `bson:"ticket_create_issue_type" json:"ticket_create_issue_type" extensions:"!x-nullable"`
	// Jira project to search for tickets.
	TicketSearchProjects []*string `bson:"ticket_search_projects" json:"ticket_search_projects" extensions:"x-nullable"`
}

func (*APIBuildBaronSettings) BuildFromService

func (bb *APIBuildBaronSettings) BuildFromService(def evergreen.BuildBaronSettings)

func (*APIBuildBaronSettings) ToService

type APICLIUpdate

type APICLIUpdate struct {
	ClientConfig APIClientConfig `json:"client_config"`
	IgnoreUpdate bool            `json:"ignore_update"`
}

func (*APICLIUpdate) BuildFromService

func (a *APICLIUpdate) BuildFromService(c evergreen.ClientConfig)

type APICedarConfig

type APICedarConfig struct {
	DBURL  *string `json:"db_url"`
	DBName *string `json:"db_name"`
}

func (*APICedarConfig) BuildFromService

func (a *APICedarConfig) BuildFromService(h any) error

func (*APICedarConfig) ToService

func (a *APICedarConfig) ToService() (any, error)

type APIChildPatchAlias

type APIChildPatchAlias struct {
	Alias   *string `json:"alias" extensions:"!x-nullable"`
	PatchID *string `json:"patch_id" extensions:"!x-nullable"`
}

type APIClientBinary

type APIClientBinary struct {
	Arch        *string `json:"arch" extensions:"!x-nullable"`
	OS          *string `json:"os" extensions:"!x-nullable"`
	URL         *string `json:"url" extensions:"!x-nullable"`
	DisplayName *string `json:"display_name" extensions:"!x-nullable"`
}

func (*APIClientBinary) BuildFromService

func (a *APIClientBinary) BuildFromService(b evergreen.ClientBinary)

func (*APIClientBinary) ToService

func (a *APIClientBinary) ToService() evergreen.ClientBinary

type APIClientConfig

type APIClientConfig struct {
	ClientBinaries   []APIClientBinary `json:"client_binaries,omitempty"`
	S3ClientBinaries []APIClientBinary `json:"s3_client_binaries,omitempty"`
	LatestRevision   *string           `json:"latest_revision" extensions:"!x-nullable"`
	// This field's struct tag is different from the service layer to maintain
	// backward compatibility with existing clients. See DEVPROD-25015.
	OldestAllowedCLIVersion *string `json:"minimum_supported_cli_version" extensions:"!x-nullable"`
}

func (*APIClientConfig) BuildFromService

func (a *APIClientConfig) BuildFromService(c evergreen.ClientConfig)

func (*APIClientConfig) ToService

func (a *APIClientConfig) ToService() evergreen.ClientConfig

type APICloudProviders

type APICloudProviders struct {
	AWS    *APIAWSConfig    `json:"aws"`
	Docker *APIDockerConfig `json:"docker"`
}

func (*APICloudProviders) BuildFromService

func (a *APICloudProviders) BuildFromService(h any) error

func (*APICloudProviders) ToService

func (a *APICloudProviders) ToService() (any, error)

type APICommitQueueParams

type APICommitQueueParams struct {
	// Enable/disable the commit queue.
	Enabled *bool `json:"enabled" extensions:"x-nullable"`
	// Method of merging (squash, merge, or rebase).
	MergeMethod *string `json:"merge_method" extensions:"!x-nullable"`
	// Message to display when users interact with the commit queue.
	Message *string `json:"message" extensions:"!x-nullable"`
}

func (*APICommitQueueParams) BuildFromService

func (cqParams *APICommitQueueParams) BuildFromService(params model.CommitQueueParams)

func (*APICommitQueueParams) ToService

func (cqParams *APICommitQueueParams) ToService() model.CommitQueueParams

type APIContainerIsolationSettings

type APIContainerIsolationSettings struct {
	Enabled  bool    `json:"enabled"`
	Image    *string `json:"image,omitempty"`
	MemoryMB int64   `json:"memory_mb,omitempty"`
	CPUs     int64   `json:"cpus,omitempty"`
	// RequireIsolation has no omitempty so that an explicit false is
	// serialized and the fail-closed flag is never silently dropped
	// when a client round-trips the full block.
	RequireIsolation bool `json:"require_isolation"`
}

APIContainerIsolationSettings is the API model for per-task container isolation configuration on a distro.

func (*APIContainerIsolationSettings) BuildFromService

func (*APIContainerIsolationSettings) ToService

type APIContainerPool

type APIContainerPool struct {
	Distro        *string `json:"distro"`
	Id            *string `json:"id"`
	MaxContainers int     `json:"max_containers"`
	Port          uint16  `json:"port"`
}

func (*APIContainerPool) BuildFromService

func (a *APIContainerPool) BuildFromService(h any) error

func (*APIContainerPool) ToService

func (a *APIContainerPool) ToService() (any, error)

type APIContainerPoolsConfig

type APIContainerPoolsConfig struct {
	Pools []APIContainerPool `json:"pools"`
}

func (*APIContainerPoolsConfig) BuildFromService

func (a *APIContainerPoolsConfig) BuildFromService(h any) error

func (*APIContainerPoolsConfig) ToService

func (a *APIContainerPoolsConfig) ToService() (any, error)

type APICostConfig

type APICostConfig struct {
	FinanceFormula      *float64          `json:"finance_formula"`
	SavingsPlanDiscount *float64          `json:"savings_plan_discount"`
	OnDemandDiscount    *float64          `json:"on_demand_discount"`
	S3Cost              *APIS3CostConfig  `json:"s3_cost"`
	EBSCost             *APIEBSCostConfig `json:"ebs_cost"`
	HiddenCostProjects  []string          `json:"hidden_cost_projects"`
}

func (*APICostConfig) BuildFromService

func (a *APICostConfig) BuildFromService(h any) error

func (*APICostConfig) ToService

func (a *APICostConfig) ToService() (any, error)

type APICostData

type APICostData struct {
	OnDemandRate    float64 `json:"on_demand_rate"`
	SavingsPlanRate float64 `json:"savings_plan_rate"`
}

func (*APICostData) BuildFromService

func (s *APICostData) BuildFromService(settings distro.CostData)

func (*APICostData) ToService

func (s *APICostData) ToService() distro.CostData

type APICreateHost

type APICreateHost struct {
	DNSName    *string `json:"dns_name,omitempty"`
	IP         *string `json:"ip_address,omitempty"`
	IPv4       *string `json:"ipv4_address,omitempty"`
	InstanceID *string `json:"instance_id,omitempty"`

	HostID   *string `json:"host_id,omitempty"`
	ParentID *string `json:"parent_id,omitempty"`
	Image    *string `json:"image,omitempty"`
	Command  *string `json:"command,omitempty"`
}

func (*APICreateHost) BuildFromService

func (createHost *APICreateHost) BuildFromService(h host.Host)

type APIDBUser

type APIDBUser struct {
	BetaFeatures APIBetaFeatures `json:"beta_features"`
	DisplayName  *string         `json:"display_name" extensions:"!x-nullable"`
	EmailAddress *string         `json:"email_address" extensions:"!x-nullable"`
	// will be set to true if the user represents a service user
	OnlyApi                   bool               `json:"only_api"`
	Roles                     []string           `json:"roles" extensions:"x-nullable"`
	HasTokenExchangePending   bool               `json:"has_token_exchange_pending"`
	TokenAccessTokenExpiresAt *time.Time         `json:"token_access_token_expires_at" extensions:"x-nullable"`
	ParsleyFilters            []APIParsleyFilter `json:"parsley_filters" extensions:"!x-nullable"`
	Settings                  APIUserSettings    `json:"settings"`
	UserID                    *string            `json:"user_id" extensions:"!x-nullable"`
}

func (*APIDBUser) BuildFromService

func (s *APIDBUser) BuildFromService(usr user.DBUser)

BuildFromService converts a service layer user.DBUser to an APIDBUser.

func (*APIDBUser) ToService

func (s *APIDBUser) ToService() (*user.DBUser, error)

ToService returns a service layer user.DBUser using the data from APIDBUser.

type APIDebugSpawnHostsConfig

type APIDebugSpawnHostsConfig struct {
	SetupScript *string `json:"setup_script"`
}

func (*APIDebugSpawnHostsConfig) BuildFromService

func (c *APIDebugSpawnHostsConfig) BuildFromService(h any) error

func (*APIDebugSpawnHostsConfig) ToService

func (c *APIDebugSpawnHostsConfig) ToService() (any, error)

type APIDependency

type APIDependency struct {
	TaskId string `bson:"_id" json:"id"`
	Status string `bson:"status" json:"status"`
}

func (*APIDependency) BuildFromService

func (ad *APIDependency) BuildFromService(dep task.Dependency)

type APIDiagnosticsConfig

type APIDiagnosticsConfig struct {
	S3BucketName *string `json:"s3_bucket_name"`
	S3Prefix     *string `json:"s3_prefix"`
}

func (*APIDiagnosticsConfig) BuildFromService

func (c *APIDiagnosticsConfig) BuildFromService(h any) error

func (*APIDiagnosticsConfig) ToService

func (c *APIDiagnosticsConfig) ToService() (any, error)

type APIDispatcherSettings

type APIDispatcherSettings struct {
	Version *string `json:"version" extensions:"!x-nullable"`
}

func (*APIDispatcherSettings) BuildFromService

func (s *APIDispatcherSettings) BuildFromService()

BuildFromService converts from service level distro.DispatcherSettings to an APIDispatcherSettings

func (*APIDispatcherSettings) ToService

ToService returns a service layer distro.DispatcherSettings using the data from APIDispatcherSettings

type APIDisplayTask

type APIDisplayTask struct {
	Name           *string  `json:"name" extensions:"!x-nullable"`
	ExecutionTasks []string `json:"execution_tasks" extensions:"!x-nullable"`
}

func APIDisplayTaskBuildFromService

func APIDisplayTaskBuildFromService(t patch.DisplayTask) *APIDisplayTask

APIDisplayTaskBuildFromService takes the patch.DisplayTask DB struct and returns the REST struct *APIDisplayTask with the corresponding fields populated

type APIDistro

type APIDistro struct {
	Name                  *string                  `json:"name" extensions:"!x-nullable"`
	AdminOnly             bool                     `json:"admin_only"`
	Aliases               []string                 `json:"aliases" extensions:"x-nullable"`
	UserSpawnAllowed      bool                     `json:"user_spawn_allowed"`
	Provider              *string                  `json:"provider" extensions:"!x-nullable"`
	ProviderSettingsList  []*birch.Document        `json:"provider_settings" swaggertype:"object" extensions:"x-nullable"`
	ProviderAccount       *string                  `json:"provider_account" extensions:"!x-nullable"`
	Arch                  *string                  `json:"arch" extensions:"!x-nullable"`
	WorkDir               *string                  `json:"work_dir" extensions:"!x-nullable"`
	SetupAsSudo           bool                     `json:"setup_as_sudo"`
	Setup                 *string                  `json:"setup" extensions:"!x-nullable"`
	User                  *string                  `json:"user" extensions:"!x-nullable"`
	BootstrapSettings     APIBootstrapSettings     `json:"bootstrap_settings"`
	SSHOptions            []string                 `json:"ssh_options" extensions:"x-nullable"`
	AuthorizedKeysFile    *string                  `json:"authorized_keys_file" extensions:"!x-nullable"`
	Expansions            []APIExpansion           `json:"expansions" extensions:"x-nullable"`
	Disabled              bool                     `json:"disabled"`
	ContainerPool         *string                  `json:"container_pool" extensions:"!x-nullable"`
	FinderSettings        APIFinderSettings        `json:"finder_settings"`
	PlannerSettings       APIPlannerSettings       `json:"planner_settings"`
	DispatcherSettings    APIDispatcherSettings    `json:"dispatcher_settings"`
	HostAllocatorSettings APIHostAllocatorSettings `json:"host_allocator_settings"`
	DisableShallowClone   bool                     `json:"disable_shallow_clone"`
	HomeVolumeSettings    APIHomeVolumeSettings    `json:"home_volume_settings"`
	IcecreamSettings      APIIceCreamSettings      `json:"icecream_settings"`
	IsVirtualWorkstation  bool                     `json:"is_virtual_workstation"`
	IsCluster             bool                     `json:"is_cluster"`
	IsIaCManaged          bool                     `json:"is_iac_managed"`
	Note                  *string                  `json:"note" extensions:"!x-nullable"`
	WarningNote           *string                  `json:"warning_note" extensions:"!x-nullable"`
	ValidProjects         []*string                `json:"valid_projects" extensions:"x-nullable"`
	Mountpoints           []string                 `json:"mountpoints" extensions:"x-nullable"`
	SingleTaskDistro      bool                     `json:"single_task_distro"`
	ImageID               *string                  `json:"image_id" extensions:"!x-nullable"`
	ExecUser              *string                  `json:"exec_user" extensions:"!x-nullable"`
	CostData              APICostData              `json:"cost_data"`
	TaskHostOverrides     *APITaskHostOverrides    `json:"task_host_overrides" extensions:"x-nullable"`
}

func (*APIDistro) BuildFromService

func (apiDistro *APIDistro) BuildFromService(d distro.Distro)

BuildFromService converts from service level distro.Distro to an APIDistro

func (*APIDistro) ToService

func (apiDistro *APIDistro) ToService() *distro.Distro

ToService returns a service layer distro using the data from APIDistro

type APIDistroPermissionSummary

type APIDistroPermissionSummary struct {
	DistroID    string              `json:"distro_id"`
	Permissions map[string][]string `json:"permissions" extensions:"!x-nullable"`
}

APIDistroPermissionSummary lists the granted permissions for one distro, grouped by category. Categories with no access are omitted.

type APIDockerConfig

type APIDockerConfig struct {
	APIVersion *string `json:"api_version"`
}

func (*APIDockerConfig) BuildFromService

func (a *APIDockerConfig) BuildFromService(h any) error

func (*APIDockerConfig) ToService

func (a *APIDockerConfig) ToService() (any, error)

type APIDuration

type APIDuration uint64

Represents duration in milliseconds

func NewAPIDuration

func NewAPIDuration(d time.Duration) APIDuration

func UnmarshalAPIDuration

func UnmarshalAPIDuration(v any) (APIDuration, error)

func (APIDuration) ToDuration

func (i APIDuration) ToDuration() time.Duration

type APIEBSCostConfig

type APIEBSCostConfig struct {
	EBSDiscount *float64 `json:"ebs_discount"`
}

func (*APIEBSCostConfig) BuildFromService

func (a *APIEBSCostConfig) BuildFromService(h any) error

func (*APIEBSCostConfig) ToService

func (a *APIEBSCostConfig) ToService() (any, error)

type APIEC2Key

type APIEC2Key struct {
	Name   *string `json:"name"`
	Region *string `json:"region"`
	Key    *string `json:"key"`
	Secret *string `json:"secret"`
}

func (*APIEC2Key) BuildFromService

func (a *APIEC2Key) BuildFromService(h any) error

func (*APIEC2Key) ToService

func (a *APIEC2Key) ToService() (any, error)

type APIEmail

type APIEmail struct {
	Recipients        []string            `json:"recipients"`
	Subject           *string             `json:"subject"`
	Body              *string             `json:"body"`
	PlainTextContents bool                `json:"is_plain_text"`
	Headers           map[string][]string `json:"headers"`
}

func (*APIEmail) BuildFromService

func (n *APIEmail) BuildFromService(email message.Email)

BuildFromService converts from service level message.Email to an APIEmail.

func (*APIEmail) ToService

func (n *APIEmail) ToService() message.Email

ToService returns a service layer message.Email using the data from APIEmail.

type APIEntry

type APIEntry struct {
	TaskId          *string   `json:"task_id"`
	TaskDisplayName *string   `json:"task_name"`
	BuildId         *string   `json:"build"`
	Files           []APIFile `json:"files"`
	Execution       int       `json:"execution"`
}

func (*APIEntry) BuildFromService

func (e *APIEntry) BuildFromService(v artifact.Entry)

func (*APIEntry) ToService

func (e *APIEntry) ToService() artifact.Entry

type APIEnvVar

type APIEnvVar struct {
	Key   *string `json:"key" extensions:"!x-nullable"`
	Value *string `json:"value" extensions:"!x-nullable"`
}

func (*APIEnvVar) BuildFromService

func (e *APIEnvVar) BuildFromService(v distro.EnvVar)

BuildFromService converts a service level distro.EnvVar to an APIEnvVar

func (*APIEnvVar) ToService

func (e *APIEnvVar) ToService() distro.EnvVar

ToService returns a service layer distro.EnvVar using the data from an APIEnvVar

type APIEventStats

type APIEventStats struct {
	LastProcessedAt            *time.Time           `json:"last_processed_at"`
	NumUnprocessedEvents       int                  `json:"unprocessed_events"`
	PendingNotificationsByType apiNotificationStats `json:"pending_notifications_by_type"`
}

func (*APIEventStats) BuildFromService

func (n *APIEventStats) BuildFromService(stats notification.NotificationStats)

type APIExpansion

type APIExpansion struct {
	Key   *string `json:"key" extensions:"!x-nullable"`
	Value *string `json:"value" extensions:"!x-nullable"`
}

APIExpansion is derived from a service layer distro.Expansion

func (*APIExpansion) BuildFromService

func (e *APIExpansion) BuildFromService(val distro.Expansion)

BuildFromService converts a service level distro.Expansion to an APIExpansion

func (*APIExpansion) ToService

func (e *APIExpansion) ToService() distro.Expansion

ToService returns a service layer distro.Expansion using the data from an APIExpansion

type APIExternalLink struct {
	// Display name for the URL.
	DisplayName *string `json:"display_name" extensions:"!x-nullable"`
	// Requester filter for when to display the link.
	Requesters []*string `json:"requesters" extensions:"x-nullable"`
	// URL format to add to the version metadata panel.
	URLTemplate *string `json:"url_template" extensions:"!x-nullable"`
}

func (*APIExternalLink) BuildFromService

func (t *APIExternalLink) BuildFromService(h model.ExternalLink)

func (*APIExternalLink) ToService

func (t *APIExternalLink) ToService() model.ExternalLink

type APIFWSConfig

type APIFWSConfig struct {
	URL *string `json:"url"`
}

func (*APIFWSConfig) BuildFromService

func (a *APIFWSConfig) BuildFromService(h any) error

func (*APIFWSConfig) ToService

func (a *APIFWSConfig) ToService() (any, error)

type APIFailedWebhook

type APIFailedWebhook struct {
	NotificationID *string    `json:"notification_id" extensions:"!x-nullable"`
	Project        *string    `json:"project,omitempty"`
	Error          *string    `json:"error" extensions:"!x-nullable"`
	FailedAt       *time.Time `json:"failed_at" extensions:"!x-nullable"`
}

APIFailedWebhook is a webhook notification that failed to deliver.

func (*APIFailedWebhook) BuildFromService

func (m *APIFailedWebhook) BuildFromService(f notification.FailedWebhook)

BuildFromService fills the API model from a failed webhook delivery.

type APIFailingCommand

type APIFailingCommand struct {
	// FullDisplayName is the full display name of the failing command.
	FullDisplayName *string `json:"full_display_name,omitempty"`
	// FailureMetadataTags are tags associated with the failing command.
	FailureMetadataTags []string `json:"failure_metadata_tags,omitempty"`
}

APIFailingCommand represents information about a command that failed in a task.

func (*APIFailingCommand) BuildFromService

func (afc *APIFailingCommand) BuildFromService(fc apimodels.FailingCommand)

func (*APIFailingCommand) ToService

func (afc *APIFailingCommand) ToService() apimodels.FailingCommand

type APIFeedbackSubmission

type APIFeedbackSubmission struct {
	Type        *string             `json:"type" extensions:"x-nullable"`
	User        *string             `json:"user" extensions:"x-nullable"`
	SubmittedAt *time.Time          `json:"submitted_at" extensions:"x-nullable"`
	Questions   []APIQuestionAnswer `json:"questions" extensions:"x-nullable"`
}

func (*APIFeedbackSubmission) ToService

type APIFile

type APIFile struct {
	// Human-readable name of the file
	Name *string `json:"name" extensions:"!x-nullable"`
	// Link to the file
	Link       *string `json:"url" extensions:"!x-nullable"`
	URLParsley *string `json:"url_parsley" extensions:"x-nullable"`
	// Determines who can see the file in the UI
	Visibility *string `json:"visibility" extensions:"!x-nullable"`
	// When true, these artifacts are excluded from reproduction
	IgnoreForFetch  bool                `json:"ignore_for_fetch"`
	ContentType     *string             `json:"content_type" extensions:"!x-nullable"`
	AssociatedLinks []APIAssociatedLink `json:"associated_links" extensions:"!x-nullable"`
}

func (*APIFile) BuildFromService

func (f *APIFile) BuildFromService(file artifact.File)

func (*APIFile) GetLogURL

func (f *APIFile) GetLogURL(env evergreen.Environment, taskID string, execution int)

func (*APIFile) ToService

func (f *APIFile) ToService() artifact.File

type APIFinderSettings

type APIFinderSettings struct {
	Version *string `json:"version" extensions:"!x-nullable"`
}

func (*APIFinderSettings) BuildFromService

func (s *APIFinderSettings) BuildFromService(settings distro.FinderSettings)

BuildFromService converts from service level distro.FinderSettings to an APIFinderSettings

func (*APIFinderSettings) ToService

func (s *APIFinderSettings) ToService() distro.FinderSettings

ToService returns a service layer distro.FinderSettings using the data from APIFinderSettings

type APIGeneratedTaskInfo

type APIGeneratedTaskInfo struct {
	// The unique identifier of the task
	TaskID string `json:"task_id"`
	// The display name of the task
	TaskName string `json:"task_name"`
	// The unique identifier of the build
	BuildID string `json:"build_id"`
	// The name of the build variant
	BuildVariant string `json:"build_variant"`
	// The display name of the build variant
	BuildVariantDisplayName string `json:"build_variant_display_name"`
}

APIGeneratedTaskInfo contains basic information about a generated task.

func (*APIGeneratedTaskInfo) BuildFromService

func (i *APIGeneratedTaskInfo) BuildFromService(dbInfo task.GeneratedTaskInfo)

type APIGitHubCheckRunConfig

type APIGitHubCheckRunConfig struct {
	CheckRunLimit *int `json:"check_run_limit"`
}

func (*APIGitHubCheckRunConfig) BuildFromService

func (c *APIGitHubCheckRunConfig) BuildFromService(h any) error

func (*APIGitHubCheckRunConfig) ToService

func (c *APIGitHubCheckRunConfig) ToService() (any, error)

type APIGitHubDynamicTokenPermissionGroup

type APIGitHubDynamicTokenPermissionGroup struct {
	// Name of the GitHub permission group.
	Name *string `json:"name" extensions:"!x-nullable"`
	// Permissions for the GitHub permission group.
	Permissions map[string]string `json:"permissions" extensions:"!x-nullable"`
	// AllPermissions is a flag that indicates that the group has all permissions.
	// If this is set to true, the Permissions field is ignored.
	// If this is set to false, the Permissions field is used (and may be
	// nil, representing no permissions).
	AllPermissions *bool `json:"all_permissions" extensions:"!x-nullable"`
}

func (*APIGitHubDynamicTokenPermissionGroup) BuildFromService

func (*APIGitHubDynamicTokenPermissionGroup) ToService

type APIGitMetadata

type APIGitMetadata struct {
	Username      *string `json:"username" extensions:"!x-nullable"`
	Email         *string `json:"email" extensions:"!x-nullable"`
	GitVersion    *string `json:"git_version,omitempty"`
	LocalBranch   *string `json:"local_branch,omitempty"`
	LocalHeadHash *string `json:"local_head_hash,omitempty"`
}

APIGitMetadata is the REST API model for patch.GitMetadata.

func (*APIGitMetadata) BuildFromService

func (g *APIGitMetadata) BuildFromService(m *patch.GitMetadata)

BuildFromService converts from service-level GitMetadata to an APIGitMetadata.

func (*APIGitMetadata) ToService

func (g *APIGitMetadata) ToService() patch.GitMetadata

ToService converts an APIGitMetadata to a service-layer GitMetadata.

type APIGitTag

type APIGitTag struct {
	Tag    *string `json:"tag" extensions:"!x-nullable"`
	Pusher *string `json:"pusher" extensions:"!x-nullable"`
}

type APIGithubAppAuth

type APIGithubAppAuth struct {
	AppID      int     `json:"app_id"`
	PrivateKey *string `json:"private_key"`
}

func (*APIGithubAppAuth) BuildFromService

func (g *APIGithubAppAuth) BuildFromService(v githubapp.GithubAppAuth)

func (*APIGithubAppAuth) ToService

func (g *APIGithubAppAuth) ToService() *githubapp.GithubAppAuth

type APIGithubAuthConfig

type APIGithubAuthConfig struct {
	AppId        int64     `json:"app_id"`
	ClientId     *string   `json:"client_id"`
	ClientSecret *string   `json:"client_secret"`
	DefaultOwner *string   `json:"default_owner"`
	DefaultRepo  *string   `json:"default_repo"`
	Organization *string   `json:"organization"`
	Users        []*string `json:"users"`
}

func (*APIGithubAuthConfig) BuildFromService

func (a *APIGithubAuthConfig) BuildFromService(h any) error

func (*APIGithubAuthConfig) ToService

func (a *APIGithubAuthConfig) ToService() (any, error)

type APIGithubCheckSubscriber

type APIGithubCheckSubscriber struct {
	Owner *string `json:"owner" mapstructure:"owner"`
	Repo  *string `json:"repo" mapstructure:"repo"`
	Ref   *string `json:"ref" mapstructure:"ref"`
}

func (*APIGithubCheckSubscriber) BuildFromService

func (s *APIGithubCheckSubscriber) BuildFromService(h any) error

func (*APIGithubCheckSubscriber) ToService

type APIGithubMergeGroup

type APIGithubMergeGroup struct {
	Org                   *string    `json:"org" extensions:"!x-nullable"`
	Repo                  *string    `json:"repo" extensions:"!x-nullable"`
	BaseBranch            *string    `json:"base_branch" extensions:"!x-nullable"`
	HeadBranch            *string    `json:"head_branch" extensions:"!x-nullable"`
	HeadSHA               *string    `json:"head_sha" extensions:"!x-nullable"`
	BaseSHA               *string    `json:"base_sha" extensions:"!x-nullable"`
	HeadCommit            *string    `json:"head_commit" extensions:"!x-nullable"`
	HeadCommitDate        *time.Time `json:"head_commit_date" extensions:"x-nullable"`
	RemovedFromQueueAt    *time.Time `json:"removed_from_queue_at" extensions:"x-nullable"`
	RemovalReason         *string    `json:"removal_reason" extensions:"!x-nullable"`
	GitRefNotFound        bool       `json:"git_ref_not_found"`
	InvalidatedByUpstream bool       `json:"invalidated_by_upstream"`
}

APIGithubMergeGroup is the REST API model for thirdparty.GithubMergeGroup.

func (*APIGithubMergeGroup) BuildFromService

func (g *APIGithubMergeGroup) BuildFromService(mg thirdparty.GithubMergeGroup)

BuildFromService converts a service-layer GithubMergeGroup to an APIGithubMergeGroup.

func (*APIGithubMergeGroup) ToService

ToService converts an APIGithubMergeGroup to a service-layer GithubMergeGroup.

type APIGithubMergeSubscriber

type APIGithubMergeSubscriber struct {
	Owner *string `json:"owner" mapstructure:"owner"`
	Repo  *string `json:"repo" mapstructure:"repo"`
	Ref   *string `json:"ref" mapstructure:"ref"`
}

func (*APIGithubMergeSubscriber) BuildFromService

func (s *APIGithubMergeSubscriber) BuildFromService(h any) error

func (*APIGithubMergeSubscriber) ToService

type APIGithubPRSubscriber

type APIGithubPRSubscriber struct {
	Owner    *string `json:"owner" mapstructure:"owner"`
	Repo     *string `json:"repo" mapstructure:"repo"`
	PRNumber int     `json:"pr_number" mapstructure:"pr_number"`
	Ref      *string `json:"ref" mapstructure:"ref"`
}

func (*APIGithubPRSubscriber) BuildFromService

func (s *APIGithubPRSubscriber) BuildFromService(h any) error

func (*APIGithubPRSubscriber) ToService

type APIGithubPatch

type APIGithubPatch struct {
	PRNumber   int     `json:"pr_number"`
	BaseOwner  *string `json:"base_owner" extensions:"!x-nullable"`
	BaseRepo   *string `json:"base_repo" extensions:"!x-nullable"`
	HeadOwner  *string `json:"head_owner" extensions:"!x-nullable"`
	HeadRepo   *string `json:"head_repo" extensions:"!x-nullable"`
	HeadBranch *string `json:"head_branch" extensions:"!x-nullable"`
	HeadHash   *string `json:"head_hash" extensions:"!x-nullable"`
	Author     *string `json:"author" extensions:"!x-nullable"`
}

func (*APIGithubPatch) BuildFromService

func (g *APIGithubPatch) BuildFromService(p thirdparty.GithubPatch)

BuildFromService converts from service level structs to an APIPatch

func (*APIGithubPatch) ToService

func (g *APIGithubPatch) ToService() thirdparty.GithubPatch

ToService converts an APIGithubPatch to a service-layer GithubPatch.

type APIGithubUser

type APIGithubUser struct {
	UID         int     `json:"uid,omitempty"`
	LastKnownAs *string `json:"last_known_as,omitempty"`
}

func (*APIGithubUser) BuildFromService

func (g *APIGithubUser) BuildFromService(usr user.GithubUser)

func (*APIGithubUser) ToService

func (g *APIGithubUser) ToService() user.GithubUser

type APIGraphiteConfig

type APIGraphiteConfig struct {
	CIOptimizationToken *string `json:"ci_optimization_token"`
	ServerURL           *string `json:"server_url"`
}

func (*APIGraphiteConfig) BuildFromService

func (a *APIGraphiteConfig) BuildFromService(h any) error

func (*APIGraphiteConfig) ToService

func (a *APIGraphiteConfig) ToService() (any, error)

type APIHomeVolumeSettings

type APIHomeVolumeSettings struct {
	FormatCommand *string `json:"format_command" extensions:"!x-nullable"`
}

func (*APIHomeVolumeSettings) BuildFromService

func (s *APIHomeVolumeSettings) BuildFromService(settings distro.HomeVolumeSettings)

func (*APIHomeVolumeSettings) ToService

type APIHost

type APIHost struct {
	// Unique identifier of a specific host
	Id                *string `json:"host_id" extensions:"!x-nullable"`
	HostURL           *string `json:"host_url" extensions:"!x-nullable"`
	PersistentDNSName *string `json:"persistent_dns_name" extensions:"!x-nullable"`
	Tag               *string `json:"tag" extensions:"!x-nullable"`
	// Object containing information about the distro type of this host
	Distro      DistroInfo `json:"distro"`
	Provisioned bool       `json:"provisioned"`
	// Name of the process or user that started this host
	StartedBy *string `json:"started_by" extensions:"!x-nullable"`
	// The instance type requested for the provider, primarily used for ec2 dynamic hosts
	Provider *string `json:"host_type" extensions:"!x-nullable"`
	// The user associated with this host. Set if this host was spawned for a specific user
	User *string `json:"user" extensions:"!x-nullable"`
	// The current state of the host
	Status *string `json:"status" extensions:"!x-nullable"`
	// Object containing information about the task the host is currently running
	RunningTask           TaskInfo    `json:"running_task"`
	UserHost              bool        `json:"user_host"`
	NoExpiration          bool        `json:"no_expiration"`
	InstanceTags          []host.Tag  `json:"instance_tags" extensions:"x-nullable"`
	InstanceType          *string     `json:"instance_type" extensions:"!x-nullable"`
	AvailabilityZone      *string     `json:"zone" extensions:"!x-nullable"`
	DisplayName           *string     `json:"display_name" extensions:"!x-nullable"`
	HomeVolumeID          *string     `json:"home_volume_id" extensions:"!x-nullable"`
	LastCommunicationTime time.Time   `json:"last_communication"`
	TotalIdleTime         APIDuration `json:"total_idle_time"`
	CreationTime          *time.Time  `json:"creation_time" extensions:"x-nullable"`
	Expiration            *time.Time  `json:"expiration_time" extensions:"x-nullable"`
	AttachedVolumeIDs     []string    `json:"attached_volume_ids" extensions:"!x-nullable"`
	// Contains options for spawn hosts.
	ProvisionOptions APIProvisionOptions `json:"provision_options"`
	NeedsReprovision *string             `json:"needs_reprovision" extensions:"!x-nullable"`
}

APIHost is the model to be returned by the API whenever hosts are fetched.

func (*APIHost) BuildFromService

func (apiHost *APIHost) BuildFromService(ctx context.Context, h *host.Host, t *task.Task)

BuildFromService converts from service level structs to an APIHost. If a task is given, we set that to the APIHost's running task.

type APIHostAllocatorSettings

type APIHostAllocatorSettings struct {
	Version                *string     `json:"version" extensions:"!x-nullable"`
	MinimumHosts           int         `json:"minimum_hosts"`
	MaximumHosts           int         `json:"maximum_hosts"`
	AutoTuneMaximumHosts   bool        `json:"auto_tune_maximum_hosts"`
	RoundingRule           *string     `json:"rounding_rule" extensions:"!x-nullable"`
	FeedbackRule           *string     `json:"feedback_rule" extensions:"!x-nullable"`
	HostsOverallocatedRule *string     `json:"hosts_overallocated_rule" extensions:"!x-nullable"`
	AcceptableHostIdleTime APIDuration `json:"acceptable_host_idle_time"`
	FutureHostFraction     float64     `json:"future_host_fraction"`
}

func (*APIHostAllocatorSettings) BuildFromService

func (s *APIHostAllocatorSettings) BuildFromService(settings distro.HostAllocatorSettings)

BuildFromService converts from service level distro.HostAllocatorSettings to an APIHostAllocatorSettings

func (*APIHostAllocatorSettings) ToService

ToService returns a service layer distro.HostAllocatorSettings using the data from APIHostAllocatorSettings

type APIHostCreateDetail

type APIHostCreateDetail struct {
	HostId *string `bson:"host_id" json:"host_id"`
	Error  *string `bson:"error" json:"error"`
}

func (*APIHostCreateDetail) BuildFromService

func (a *APIHostCreateDetail) BuildFromService(t any) error

func (*APIHostCreateDetail) ToService

func (a *APIHostCreateDetail) ToService() (any, error)

type APIHostInitConfig

type APIHostInitConfig struct {
	HostThrottle         int `json:"host_throttle"`
	ProvisioningThrottle int `json:"provisioning_throttle"`
	CloudStatusBatchSize int `json:"cloud_batch_size"`
	MaxTotalDynamicHosts int `json:"max_total_dynamic_hosts"`
}

func (*APIHostInitConfig) BuildFromService

func (a *APIHostInitConfig) BuildFromService(h any) error

func (*APIHostInitConfig) ToService

func (a *APIHostInitConfig) ToService() (any, error)

type APIHostJasperConfig

type APIHostJasperConfig struct {
	BinaryName       *string `json:"binary_name,omitempty"`
	DownloadFileName *string `json:"download_file_name,omitempty"`
	Port             int     `json:"port,omitempty"`
	URL              *string `json:"url,omitempty"`
	Version          *string `json:"version,omitempty"`
}

func (*APIHostJasperConfig) BuildFromService

func (c *APIHostJasperConfig) BuildFromService(h any) error

func (*APIHostJasperConfig) ToService

func (c *APIHostJasperConfig) ToService() (any, error)

type APIHostParams

type APIHostParams struct {
	CreatedBefore time.Time `json:"created_before"`
	CreatedAfter  time.Time `json:"created_after"`
	Distro        string    `json:"distro"`
	Status        string    `json:"status"`
	Region        string    `json:"region"`
	UserSpawned   bool      `json:"user_spawned"`
	Mine          bool      `json:"mine"`
}

type APIHostProcess

type APIHostProcess struct {
	HostID   string `json:"host_id"`
	ProcID   string `json:"proc_id"`
	Complete bool   `json:"complete"`
	Output   string `json:"output"`
}

type APIHostProvisioningOptions

type APIHostProvisioningOptions struct {
	Content string `json:"content"`
	// ContainerImage is the image to pre-pull after provisioning, if configured.
	ContainerImage string `json:"container_image,omitempty"`
}

APIHostProvisioningOptions represents the script to provision a host.

type APIHostScript

type APIHostScript struct {
	Hosts  []string `json:"hosts"`
	Script string   `json:"script"`
}

type APIHostStatsByDistro

type APIHostStatsByDistro struct {
	Distros []apiHostStatsForDistro `json:"distros"`
}

APIHostStatsByDistro is a slice of host stats for a distro the 3 structs below are nested within it

func (*APIHostStatsByDistro) BuildFromService

func (s *APIHostStatsByDistro) BuildFromService(stats []host.StatsByDistro)

BuildFromService takes the slice of stats returned by GetHostStatsByDistro and embeds them so that the return value is a slice of distros

type APIHourlyPatchTaskOverride

type APIHourlyPatchTaskOverride struct {
	// ProjectOrRepoID is the ID of the branch project or repo the override applies to.
	ProjectOrRepoID *string `json:"project_or_repo_id" extensions:"!x-nullable"`
	// MaxHourlyPatchTasks is the maximum number of patch tasks a single user can schedule per hour in the target project or repo.
	MaxHourlyPatchTasks *int `json:"max_hourly_patch_tasks" extensions:"!x-nullable"`
}

APIHourlyPatchTaskOverride is a per-project or per-repo override to the hourly per-user patch task scheduling limit.

func (*APIHourlyPatchTaskOverride) BuildFromService

func (*APIHourlyPatchTaskOverride) ToService

type APIIceCreamSettings

type APIIceCreamSettings struct {
	SchedulerHost *string `json:"scheduler_host" extensions:"!x-nullable"`
	ConfigPath    *string `json:"config_path" extensions:"!x-nullable"`
}

func (*APIIceCreamSettings) BuildFromService

func (s *APIIceCreamSettings) BuildFromService(settings distro.IceCreamSettings)

func (*APIIceCreamSettings) ToService

type APIImage

type APIImage struct {
	ID           *string    `json:"id"`
	AMI          *string    `json:"ami"`
	LastDeployed *time.Time `json:"last_deployed"`
}

APIImage is the model to be returned by the API whenever images are fetched.

func (*APIImage) BuildFromService

func (apiImage *APIImage) BuildFromService(image thirdparty.DistroImage)

BuildFromService converts from service level thirdparty.Image to an APIImage.

func (*APIImage) ToService

func (apiImage *APIImage) ToService() *thirdparty.DistroImage

ToService returns a service layer image using the data from APIImage.

type APIImageEvent

type APIImageEvent struct {
	Entries   []APIImageEventEntry `json:"entries"`
	Timestamp *time.Time           `json:"timestamp"`
	AMIBefore *string              `json:"ami_before"`
	AMIAfter  *string              `json:"ami_after"`
}

APIImageEvent is the model to be returned by the API whenever image events are fetched.

func (*APIImageEvent) BuildFromService

func (apiImageEvent *APIImageEvent) BuildFromService(imageEvent thirdparty.ImageEvent)

BuildFromService converts from service level thirdparty.ImageEvent to an APIImageEvent.

func (*APIImageEvent) ToService

func (apiImage *APIImageEvent) ToService() *thirdparty.ImageEvent

ToService returns a service layer image event using the data from APIImageEvent.

type APIImageEventEntry

type APIImageEventEntry struct {
	Name   *string                          `json:"name"`
	Before *string                          `json:"before"`
	After  *string                          `json:"after"`
	Type   thirdparty.ImageEventType        `json:"type"`
	Action thirdparty.ImageEventEntryAction `json:"action"`
}

APIImageEventEntry is the model to be returned by the API whenever image event entries are fetched.

func (*APIImageEventEntry) BuildFromService

func (apiImageEventEntry *APIImageEventEntry) BuildFromService(imageEventEntry thirdparty.ImageEventEntry)

BuildFromService converts from service level thirdparty.ImageEventEntry to an APIImageEventEntry.

func (*APIImageEventEntry) ToService

func (apiImageEventEntry *APIImageEventEntry) ToService() *thirdparty.ImageEventEntry

ToService returns a service layer image event entry using the data from APIImageEventEntry.

type APIImageFile

type APIImageFile struct {
	Name    *string `json:"name"`
	Path    *string `json:"path"`
	Version *string `json:"version"`
}

APIImageFile is the model to be returned by the API whenever files are fetched.

func (*APIImageFile) BuildFromService

func (apiFile *APIImageFile) BuildFromService(file thirdparty.File)

BuildFromService converts from service level thirdparty.File to an APIImageFile.

func (*APIImageFile) ToService

func (apiFile *APIImageFile) ToService() *thirdparty.File

ToService returns a service layer file using the data from APIImageFile.

type APIIssueLink struct {
	// The url of the ticket
	URL *string `bson:"url" json:"url" extensions:"!x-nullable"`
	// Text to be displayed
	IssueKey *string `bson:"issue_key,omitempty" json:"issue_key,omitempty"`
	// The source of the edit
	Source *APISource `bson:"source,omitempty" json:"source,omitempty"`
	// The confidence score of the issue
	ConfidenceScore *float64 `bson:"confidence_score,omitempty" json:"confidence_score,omitempty"`
}

func APIIssueLinkBuildFromService

func APIIssueLinkBuildFromService(t annotations.IssueLink) *APIIssueLink

APIIssueLinkBuildFromService takes the annotations.IssueLink DB struct and returns the REST struct *APIIssueLink with the corresponding fields populated

func BuildAPIIssueLinks(t []annotations.IssueLink) []APIIssueLink

BuildAPIIssueLinks converts a slice of annotations.IssueLink to a slice of APIIssueLink

type APIJIRAIssueSubscriber

type APIJIRAIssueSubscriber struct {
	Project   *string `json:"project" mapstructure:"project"`
	IssueType *string `json:"issue_type" mapstructure:"issue_type"`
}

func (*APIJIRAIssueSubscriber) BuildFromService

func (s *APIJIRAIssueSubscriber) BuildFromService(h any) error

func (*APIJIRAIssueSubscriber) ToService

type APIJIRANotificationsConfig

type APIJIRANotificationsConfig struct {
	CustomFields map[string]APIJIRANotificationsProject `json:"custom_fields,omitempty"`
}

func (*APIJIRANotificationsConfig) BuildFromService

func (j *APIJIRANotificationsConfig) BuildFromService(h any) error

func (*APIJIRANotificationsConfig) ToService

func (j *APIJIRANotificationsConfig) ToService() (any, error)

type APIJIRANotificationsProject

type APIJIRANotificationsProject struct {
	Fields     map[string]string `json:"fields,omitempty"`
	Components []string          `json:"components,omitempty"`
	Labels     []string          `json:"labels,omitempty"`
}

func (*APIJIRANotificationsProject) BuildFromService

func (j *APIJIRANotificationsProject) BuildFromService(h any) error

func (*APIJIRANotificationsProject) ToService

func (j *APIJIRANotificationsProject) ToService() (any, error)

type APIJiraConfig

type APIJiraConfig struct {
	Host                *string `json:"host"`
	DefaultProject      *string `json:"default_project"`
	Email               *string `json:"email"`
	PersonalAccessToken *string `json:"personal_access_token"`
}

func (*APIJiraConfig) BuildFromService

func (a *APIJiraConfig) BuildFromService(h any) error

func (*APIJiraConfig) ToService

func (a *APIJiraConfig) ToService() (any, error)

type APIKanopyAuthConfig

type APIKanopyAuthConfig struct {
	HeaderName *string `json:"header_name"`
	Issuer     *string `json:"issuer"`
	KeysetURL  *string `json:"keyset_url"`
}

func (*APIKanopyAuthConfig) BuildFromService

func (a *APIKanopyAuthConfig) BuildFromService(h any) error

func (*APIKanopyAuthConfig) ToService

func (a *APIKanopyAuthConfig) ToService() (any, error)

type APILocalModuleInclude

type APILocalModuleInclude struct {
	Module      string `json:"module"`
	FileName    string `json:"filename"`
	FileContent []byte `json:"file_content,omitempty"`
}

type APILogBuffering

type APILogBuffering struct {
	UseAsync             bool `json:"use_async"`
	DurationSeconds      int  `json:"duration_seconds"`
	Count                int  `json:"count"`
	IncomingBufferFactor int  `json:"incoming_buffer_factor"`
}

func (*APILogBuffering) BuildFromService

func (a *APILogBuffering) BuildFromService(h any) error

func (*APILogBuffering) ToService

func (a *APILogBuffering) ToService() (any, error)

type APILoggerConfig

type APILoggerConfig struct {
	Buffer         *APILogBuffering `json:"buffer"`
	DefaultLevel   *string          `json:"default_level"`
	ThresholdLevel *string          `json:"threshold_level"`
	LogkeeperURL   *string          `json:"logkeeper_url"`
	RedactKeys     []*string        `json:"redact_keys"`
}

func (*APILoggerConfig) BuildFromService

func (a *APILoggerConfig) BuildFromService(h any) error

func (*APILoggerConfig) ToService

func (a *APILoggerConfig) ToService() (any, error)

type APIManifest

type APIManifest struct {
	Id                *string             `json:"id" extensions:"!x-nullable"`
	Revision          *string             `json:"revision" extensions:"!x-nullable"`
	ProjectName       *string             `json:"project" extensions:"!x-nullable"`
	Branch            *string             `json:"branch" extensions:"!x-nullable"`
	IsBase            bool                `json:"is_base"`
	Modules           []APIManifestModule `json:"modules" extensions:"x-nullable"`
	PreviousVersionID *string             `json:"previous_version_id,omitempty"`
	ChangedModules    []string            `json:"changed_modules,omitempty"`
}

func (*APIManifest) BuildFromService

func (m *APIManifest) BuildFromService(mfst *manifest.Manifest)

type APIManifestModule

type APIManifestModule struct {
	Name          *string `json:"name" extensions:"!x-nullable"`
	Owner         *string `json:"owner" extensions:"!x-nullable"`
	Repo          *string `json:"repo" extensions:"!x-nullable"`
	Branch        *string `json:"branch" extensions:"!x-nullable"`
	Revision      *string `json:"revision" extensions:"!x-nullable"`
	URL           *string `json:"url" extensions:"!x-nullable"`
	SelectionRule *string `json:"selection_rule,omitempty"`
}

func (*APIManifestModule) BuildFromService

func (m *APIManifestModule) BuildFromService(modName string, mod *manifest.Module)
type APIMetadataLink struct {
	// The url of the link
	URL *string `bson:"url" json:"url" extensions:"!x-nullable"`
	// Text to be displayed
	Text *string `bson:"text" json:"text" extensions:"!x-nullable"`
	// The source of the edit
	Source *APISource `bson:"source,omitempty" json:"source,omitempty"`
}

func APIMetadataLinkBuildFromService

func APIMetadataLinkBuildFromService(t annotations.MetadataLink) *APIMetadataLink

APIMetadataLinkBuildFromService takes the annotations.MetadataLink DB struct and returns the REST struct *APIIssueLink with the corresponding fields populated

func BuildAPIMetadataLinks(t []annotations.MetadataLink) []APIMetadataLink

BuildAPIMetadataLinks converts a slice of annotations.MetadataLink to a slice of APIMetadataLink

type APIModule

type APIModule struct {
	Module *string `json:"module"`
	Issue  *string `json:"issue"`
}

type APIMultiAuthConfig

type APIMultiAuthConfig struct {
	ReadWrite []string `json:"read_write"`
	ReadOnly  []string `json:"read_only"`
}

func (*APIMultiAuthConfig) BuildFromService

func (a *APIMultiAuthConfig) BuildFromService(h any) error

func (*APIMultiAuthConfig) ToService

func (a *APIMultiAuthConfig) ToService() (any, error)

type APINaiveAuthConfig

type APINaiveAuthConfig struct {
	Users []APIAuthUser `json:"users"`
}

func (*APINaiveAuthConfig) BuildFromService

func (a *APINaiveAuthConfig) BuildFromService(h any) error

func (*APINaiveAuthConfig) ToService

func (a *APINaiveAuthConfig) ToService() (any, error)

type APINote

type APINote struct {
	// Comment about the task failure
	Message *string `bson:"message,omitempty" json:"message,omitempty"`
	// The source of the note
	Source *APISource `bson:"source,omitempty" json:"source,omitempty"`
}

func APINoteBuildFromService

func APINoteBuildFromService(t *annotations.Note) *APINote

APINoteBuildFromService takes the annotations.Note DB struct and returns the REST struct *APINote with the corresponding fields populated

type APINotificationPreferences

type APINotificationPreferences struct {
	BuildBreak            *string `json:"build_break" extensions:"!x-nullable"`
	BuildBreakID          *string `json:"build_break_id,omitempty"`
	PatchFinish           *string `json:"patch_finish" extensions:"!x-nullable"`
	PatchFinishID         *string `json:"patch_finish_id,omitempty"`
	PatchFirstFailure     *string `json:"patch_first_failure" extensions:"!x-nullable"`
	PatchFirstFailureID   *string `json:"patch_first_failure_id,omitempty"`
	SpawnHostExpiration   *string `json:"spawn_host_expiration" extensions:"!x-nullable"`
	SpawnHostExpirationID *string `json:"spawn_host_expiration_id,omitempty"`
	SpawnHostOutcome      *string `json:"spawn_host_outcome" extensions:"!x-nullable"`
	SpawnHostOutcomeID    *string `json:"spawn_host_outcome_id,omitempty"`
}

func (*APINotificationPreferences) BuildFromService

func (*APINotificationPreferences) ToService

type APINotifyConfig

type APINotifyConfig struct {
	BufferTargetPerInterval int          `json:"buffer_target_per_interval"`
	BufferIntervalSeconds   int          `json:"buffer_interval_seconds"`
	SES                     APISESConfig `json:"ses"`
}

func (*APINotifyConfig) BuildFromService

func (a *APINotifyConfig) BuildFromService(h any) error

func (*APINotifyConfig) ToService

func (a *APINotifyConfig) ToService() (any, error)

type APINumTasksToFinalize

type APINumTasksToFinalize struct {
	NumTasksToFinalize *int `json:"num_tasks_to_finalize"`
}

APINumTasksToFinalize contains information on the number of tasks a generator is set to finalize.

type APIOAuthConfig

type APIOAuthConfig struct {
	Issuer      *string `json:"issuer"`
	ClientID    *string `json:"client_id"`
	ConnectorID *string `json:"connector_id"`
}

func (*APIOAuthConfig) BuildFromService

func (a *APIOAuthConfig) BuildFromService(h any) error

func (*APIOAuthConfig) ToService

func (a *APIOAuthConfig) ToService() (any, error)

type APIOSInfo

type APIOSInfo struct {
	Name    *string `json:"name"`
	Version *string `json:"version"`
}

APIOSInfo is the model to be returned by the API whenever OS information is fetched.

func (*APIOSInfo) BuildFromService

func (apiOSInfo *APIOSInfo) BuildFromService(osInfo thirdparty.OSInfo)

BuildFromService converts from service level thirdparty.OSInfo to an APIOSInfo.

func (*APIOSInfo) ToService

func (apiOSInfo *APIOSInfo) ToService() *thirdparty.OSInfo

ToService returns a service layer OS info using the data from APIOSInfo.

type APIOffboardUserResults

type APIOffboardUserResults struct {
	TerminatedHosts   []string `json:"terminated_hosts" extensions:"!x-nullable"`
	TerminatedVolumes []string `json:"terminated_volumes" extensions:"!x-nullable"`
}

type APIOktaConfig

type APIOktaConfig struct {
	ClientID             *string  `json:"client_id"`
	ClientSecret         *string  `json:"client_secret"`
	Issuer               *string  `json:"issuer"`
	Scopes               []string `json:"scopes"`
	UserGroup            *string  `json:"user_group"`
	ExpireAfterMinutes   int      `json:"expire_after_minutes"`
	ExpectedEmailDomains []string `json:"expected_email_domains"`
}

func (*APIOktaConfig) BuildFromService

func (a *APIOktaConfig) BuildFromService(h any) error

func (*APIOktaConfig) ToService

func (a *APIOktaConfig) ToService() (any, error)

type APIOktaServiceConfig

type APIOktaServiceConfig struct {
	ClientID     *string  `json:"client_id"`
	ClientSecret *string  `json:"client_secret"`
	Scopes       []string `json:"scopes"`
	Audience     *string  `json:"audience"`
	Issuer       *string  `json:"issuer"`
}

func (*APIOktaServiceConfig) BuildFromService

func (a *APIOktaServiceConfig) BuildFromService(h any) error

func (*APIOktaServiceConfig) ToService

func (a *APIOktaServiceConfig) ToService() (any, error)

type APIOomTrackerInfo

type APIOomTrackerInfo struct {
	Detected bool  `json:"detected"`
	Pids     []int `json:"pids" extensions:"x-nullable"`
}

func (*APIOomTrackerInfo) BuildFromService

func (at *APIOomTrackerInfo) BuildFromService(t *apimodels.OOMTrackerInfo)

func (*APIOomTrackerInfo) ToService

func (ad *APIOomTrackerInfo) ToService() *apimodels.OOMTrackerInfo

type APIOverride

type APIOverride struct {
	SectionID *string `bson:"section_id" json:"section_id"`
	Field     *string `bson:"field" json:"field"`
	Value     any     `bson:"value" json:"value"`
}

func (*APIOverride) BuildFromService

func (a *APIOverride) BuildFromService(h any) error

func (APIOverride) MarshalJSON

func (a APIOverride) MarshalJSON() ([]byte, error)

MarshalJSON is a custom JSON marshaler function to satisfy the json.Marshaler interface. This is necessary because the regular JSON marshaler doesn't account for all the bson data types.

func (*APIOverride) ToService

func (a *APIOverride) ToService() (any, error)

func (*APIOverride) UnmarshalJSON

func (a *APIOverride) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom JSON unmarshaler function to satisfy the json.Unmarshaler interface. This is necessary because the regular JSON unmarshaler doesn't account for all the bson data types.

type APIOverridesConfig

type APIOverridesConfig struct {
	Overrides []APIOverride `json:"overrides"`
}

func (*APIOverridesConfig) BuildFromService

func (a *APIOverridesConfig) BuildFromService(h any) error

func (*APIOverridesConfig) ToService

func (a *APIOverridesConfig) ToService() (any, error)

type APIOwnerRepo

type APIOwnerRepo struct {
	Owner *string `json:"owner"`
	Repo  *string `json:"repo"`
}

func (*APIOwnerRepo) BuildFromService

func (a *APIOwnerRepo) BuildFromService(h any) error

func (*APIOwnerRepo) ToService

func (a *APIOwnerRepo) ToService() (any, error)

type APIPackage

type APIPackage struct {
	Name    *string `json:"name"`
	Manager *string `json:"manager"`
	Version *string `json:"version"`
}

APIPackage is the model to be returned by the API whenever packages are fetched.

func (*APIPackage) BuildFromService

func (apiPackage *APIPackage) BuildFromService(pkg thirdparty.Package)

BuildFromService converts from service level thirdparty.Package to an APIPackage.

func (*APIPackage) ToService

func (apiPackage *APIPackage) ToService() *thirdparty.Package

ToService returns a service layer package using the data from APIPackage.

type APIParameter

type APIParameter struct {
	Key   *string `json:"key" extensions:"!x-nullable"`
	Value *string `json:"value" extensions:"!x-nullable"`
}

func (*APIParameter) BuildFromService

func (p *APIParameter) BuildFromService(param *patch.Parameter)

BuildFromService converts from service level parameter to an APIPatch.

func (*APIParameter) ToService

func (p *APIParameter) ToService() patch.Parameter

ToService converts a service layer parameter using the data from APIParameter

type APIParameterInfo

type APIParameterInfo struct {
	Key         *string `json:"key" extensions:"!x-nullable"`
	Value       *string `json:"value" extensions:"!x-nullable"`
	Description *string `json:"description" extensions:"!x-nullable"`
}

func (*APIParameterInfo) BuildFromService

func (c *APIParameterInfo) BuildFromService(info model.ParameterInfo)

type APIParameterStoreConfig

type APIParameterStoreConfig struct {
	Prefix *string `json:"prefix"`
}

func (*APIParameterStoreConfig) BuildFromService

func (a *APIParameterStoreConfig) BuildFromService(h any) error

func (*APIParameterStoreConfig) ToService

func (a *APIParameterStoreConfig) ToService() (any, error)

type APIParserProjectS3Config

type APIParserProjectS3Config struct {
	APIS3Credentials
	Prefix              *string `json:"prefix"`
	GeneratedJSONPrefix *string `json:"generated_json_prefix"`
}

APIParserProjectS3Config represents configuration options for storing and accessing parser projects in S3.

func (*APIParserProjectS3Config) BuildFromService

func (a *APIParserProjectS3Config) BuildFromService(h any) error

func (*APIParserProjectS3Config) ToService

func (a *APIParserProjectS3Config) ToService() (any, error)

type APIParsleyFilter

type APIParsleyFilter struct {
	// Description is a description for the filter.
	Description *string `json:"description" extensions:"!x-nullable"`
	// Expression is a regular expression representing the filter.
	Expression *string `json:"expression" extensions:"!x-nullable"`
	// CaseSensitive indicates whether the filter is case sensitive.
	CaseSensitive *bool `json:"case_sensitive" extensions:"!x-nullable"`
	// ExactMatch indicates whether the filter must be an exact match.
	ExactMatch *bool `json:"exact_match" extensions:"!x-nullable"`
}

func (*APIParsleyFilter) BuildFromService

func (t *APIParsleyFilter) BuildFromService(h parsley.Filter)

func (*APIParsleyFilter) ToService

func (t *APIParsleyFilter) ToService() parsley.Filter

type APIPatch

type APIPatch struct {
	// Unique identifier of a specific patch
	Id *string `json:"patch_id" extensions:"!x-nullable"`
	// Description of the patch
	Description *string `json:"description" extensions:"!x-nullable"`
	// Immutable ID for the project
	ProjectId *string `json:"project_id" extensions:"!x-nullable"`
	// Deprecated -- this is equivalent to project_id, and shouldn't be used.
	LegacyProjectId *string `json:"branch" extensions:"!x-nullable"`
	// Identifier for the project
	ProjectIdentifier *string `json:"project_identifier" extensions:"x-nullable"`

	// The branch on which the patch was initiated.
	Branch *string `json:"branch_name" extensions:"!x-nullable"`
	// Hash of commit off which the patch was initiated
	Githash *string `json:"git_hash" extensions:"!x-nullable"`
	// Incrementing counter of user's patches
	PatchNumber int  `json:"patch_number"`
	Hidden      bool `json:"hidden"`
	// Author of the patch
	Author  *string `json:"author" extensions:"!x-nullable"`
	Version *string `json:"version" extensions:"!x-nullable"`
	// Aggregated actual cost of the patch's version (empty until the patch is finalized to a version with cost data).
	Cost *cost.Cost `json:"cost,omitempty"`
	// Aggregated predicted cost of the patch's version.
	PredictedCost *cost.Cost `json:"predicted_cost,omitempty"`
	// Status of patch (possible values are "created", "started", "success", or "failed")
	Status *string `json:"status" extensions:"!x-nullable"`
	// Time patch was created
	CreateTime *time.Time `json:"create_time" extensions:"!x-nullable"`
	// Time the patch document was first persisted in Evergreen
	IngestTime *time.Time `json:"ingest_time,omitempty"`
	// Time patch started to run
	StartTime *time.Time `json:"start_time" extensions:"x-nullable"`
	// Time at patch completion
	FinishTime *time.Time `json:"finish_time" extensions:"x-nullable"`
	// List of identifiers of builds to run for this patch
	Variants []*string `json:"builds" extensions:"!x-nullable"`
	// List of identifiers of tasks used in this patch
	Tasks           []*string         `json:"tasks" extensions:"!x-nullable"`
	DownstreamTasks []DownstreamTasks `json:"downstream_tasks" extensions:"x-nullable"`
	// List of documents of available tasks and associated build variant
	VariantsTasks []VariantTask `json:"variants_tasks" extensions:"!x-nullable"`
	// Whether the patch has been finalized and activated
	Activated bool `json:"activated"`
	// InvalidatedByUpstream is whether the patch was invalidated because an item ahead of it in the merge queue failed.
	// Repeated from GithubMergeData to preserve backwards compatibility.
	InvalidatedByUpstream bool                     `json:"invalidated_by_upstream"`
	Alias                 *string                  `json:"alias,omitempty"`
	Aliases               []string                 `json:"aliases,omitempty"`
	GithubPatchData       APIGithubPatch           `json:"github_patch_data"`
	GithubMergeData       APIGithubMergeGroup      `json:"github_merge_data"`
	ModuleCodeChanges     []patch.ModuleCodeChange `json:"module_code_changes" extensions:"x-nullable"`
	Parameters            []APIParameter           `json:"parameters" extensions:"x-nullable"`
	ProjectStorageMethod  *string                  `json:"project_storage_method,omitempty"`
	ChildPatches          []APIPatch               `json:"child_patches" extensions:"x-nullable"`
	ChildPatchAliases     []APIChildPatchAlias     `json:"child_patch_aliases,omitempty"`
	Requester             *string                  `json:"requester" extensions:"!x-nullable"`
	MergedFrom            *string                  `json:"merged_from" extensions:"!x-nullable"`
	// GitInfo contains metadata about the author's local git environment for CLI patches.
	GitInfo *APIGitMetadata `json:"git_info,omitempty"`

	LocalModuleIncludes []APILocalModuleInclude `json:"local_module_includes,omitempty"`
	S3Usage             *APIVersionS3Usage      `json:"s3_usage,omitempty"`
}

APIPatch is the model to be returned by the API whenever patches are fetched.

func (*APIPatch) BuildFromService

func (apiPatch *APIPatch) BuildFromService(ctx context.Context, p patch.Patch, args *APIPatchArgs) error

BuildFromService converts from service level structs to an APIPatch. An APIPatch expects the VariantTasks to be populated with only non-execution tasks and display tasks. If args are set, includes identifier, branch, and/or child patches from the DB, if applicable.

func (*APIPatch) GetIdentifier

func (apiPatch *APIPatch) GetIdentifier(ctx context.Context)

func (*APIPatch) ToService

func (apiPatch *APIPatch) ToService() (patch.Patch, error)

ToService converts a service layer patch using the data from APIPatch

type APIPatchArgs

type APIPatchArgs struct {
	IncludeProjectIdentifier bool
	IncludeChildPatches      bool
	// IncludeVersionCost loads Cost/PredictedCost from the version document (extra DB read).
	IncludeVersionCost bool
}

type APIPatchTriggerDefinition

type APIPatchTriggerDefinition struct {
	// Alias to run in the downstream project.
	Alias *string `json:"alias" extensions:"!x-nullable"`
	// ID of the downstream project.
	ChildProjectId *string `json:"child_project_id" extensions:"!x-nullable"`
	// Identifier of the downstream project.
	ChildProjectIdentifier *string `json:"child_project_identifier" extensions:"!x-nullable"`
	// List of task specifiers.
	TaskSpecifiers []APITaskSpecifier `json:"task_specifiers" extensions:"x-nullable"`
	// Status for the parent patch to conditionally kick off the child patch.
	Status *string `json:"status,omitempty"`
	// Name of the module corresponding to the upstream project in the
	// downstream project's YAML.
	ParentAsModule *string `json:"parent_as_module,omitempty"`
	// An optional field representing the revision at which to create the downstream patch.
	// By default, this field is empty and the downstream patch will be based off of its
	// most recent commit.
	DownstreamRevision *string `json:"downstream_revision,omitempty"`
	// The list of variants/tasks from the alias that will run in the downstream
	// project.
	VariantsTasks []VariantTask `json:"variants_tasks,omitempty"`
}

func (*APIPatchTriggerDefinition) BuildFromService

func (*APIPatchTriggerDefinition) ToService

type APIPeriodicBuildDefinition

type APIPeriodicBuildDefinition struct {
	// Identifier for the periodic build.
	ID *string `json:"id" extensions:"!x-nullable"`
	// Project config file to use for the periodic build.
	ConfigFile *string `json:"config_file" extensions:"!x-nullable"`
	// Interval (in hours) between periodic build runs.
	IntervalHours *int `json:"interval_hours" extensions:"!x-nullable"`
	// Cron specification for when to run periodic builds.
	Cron *string `json:"cron" extensions:"!x-nullable"`
	// Alias to run for the periodic build.
	Alias *string `json:"alias,omitempty"`
	// Message to display in the version metadata.
	Message *string `json:"message,omitempty"`
	// Next time that the periodic build will run.
	NextRunTime *time.Time `json:"next_run_time,omitempty"`
}

func (*APIPeriodicBuildDefinition) BuildFromService

func (bd *APIPeriodicBuildDefinition) BuildFromService(params model.PeriodicBuildDefinition)

func (*APIPeriodicBuildDefinition) ToService

type APIPermission

type APIPermission struct {
	Key    string                      `json:"key"`
	Name   string                      `json:"name"`
	Levels []evergreen.PermissionLevel `json:"levels" extensions:"!x-nullable"`
}

type APIPermissionLevel

type APIPermissionLevel struct {
	Description       string `json:"description"`
	GrantedToAllUsers bool   `json:"granted_to_all_users"`
}

APIPermissionLevel describes a single permission level within a category.

type APIPermissions

type APIPermissions struct {
	ProjectPermissions []APIPermission `json:"projectPermissions" extensions:"!x-nullable"`
	DistroPermissions  []APIPermission `json:"distroPermissions" extensions:"!x-nullable"`
}

type APIPersistentDNSConfig

type APIPersistentDNSConfig struct {
	HostedZoneID *string `json:"hosted_zone_id"`
	Domain       *string `json:"domain"`
}

APIPersistentDNSConfig represents configuration options for supporting persistent DNS names for hosts.

func (*APIPersistentDNSConfig) BuildFromService

func (a *APIPersistentDNSConfig) BuildFromService(h any) error

func (*APIPersistentDNSConfig) ToService

func (a *APIPersistentDNSConfig) ToService() (any, error)

type APIPlannerSettings

type APIPlannerSettings struct {
	Version                   *string     `json:"version" extensions:"!x-nullable"`
	TargetTime                APIDuration `json:"target_time"`
	MergeQueueTargetTime      APIDuration `json:"merge_queue_target_time"`
	GroupVersions             bool        `json:"group_versions"`
	PatchFactor               int64       `json:"patch_factor"`
	PatchTimeInQueueFactor    int64       `json:"patch_time_in_queue_factor"`
	MainlineTimeInQueueFactor int64       `json:"mainline_time_in_queue_factor"`
	ExpectedRuntimeFactor     int64       `json:"expected_runtime_factor"`
	GenerateTaskFactor        int64       `json:"generate_task_factor"`
	NumDependentsFactor       float64     `json:"num_dependents_factor"`
	CommitQueueFactor         int64       `json:"commit_queue_factor"`
}

func (*APIPlannerSettings) BuildFromService

func (s *APIPlannerSettings) BuildFromService(settings distro.PlannerSettings)

BuildFromService converts from service level distro.PlannerSetting to an APIPlannerSettings

func (*APIPlannerSettings) ToService

func (s *APIPlannerSettings) ToService() distro.PlannerSettings

ToService returns a service layer distro.PlannerSettings using the data from APIPlannerSettings

type APIPreconditionScript

type APIPreconditionScript struct {
	Path   *string `json:"path" extensions:"!x-nullable"`
	Script *string `json:"script" extensions:"!x-nullable"`
}

APIPreconditionScript is the model used by the API to represent a distro.PreconditionScript.

func (*APIPreconditionScript) BuildFromService

func (s *APIPreconditionScript) BuildFromService(script distro.PreconditionScript)

BuildFromService converts a service-level distro.PreconditionScript to an APIPreconditionScript.

func (*APIPreconditionScript) ToService

ToService returns a service-level distro.PreconditionScript using the data from the APIPreconditionScript.

type APIProjectAlias

type APIProjectAlias struct {
	// Name of the alias.
	Alias *string `json:"alias" extensions:"!x-nullable"`
	// Regex for matching git tags to run git tag versions.
	GitTag *string `json:"git_tag" extensions:"!x-nullable"`
	// Regex for build variants to match.
	Variant *string `json:"variant" extensions:"!x-nullable"`
	// Human-friendly description for the alias.
	Description *string `json:"description" extensions:"!x-nullable"`
	// Regex for tasks to match.
	Task *string `json:"task" extensions:"!x-nullable"`
	// Path to project config file to use.
	RemotePath *string `json:"remote_path" extensions:"!x-nullable"`
	// Build variant tags selectors to match.
	VariantTags []*string `json:"variant_tags,omitempty"`
	// Task tag selectors to match.
	TaskTags []*string `json:"tags,omitempty"`
	// If set, deletes the project alias by name.
	Delete bool `json:"delete,omitempty"`
	// Identifier for the project alias.
	ID *string `json:"_id,omitempty"`
	// List of allowed parameters to the alias.
	Parameters []*APIParameter `json:"parameters,omitempty"`
	// GitHub PR labels required for this alias to contribute tasks.
	RequiredLabels []*string `json:"required_labels,omitempty"`
}

func (*APIProjectAlias) BuildFromService

func (a *APIProjectAlias) BuildFromService(in model.ProjectAlias)

func (*APIProjectAlias) ToService

func (a *APIProjectAlias) ToService() model.ProjectAlias

type APIProjectBanner

type APIProjectBanner struct {
	// Banner theme.
	Theme evergreen.BannerTheme `json:"theme"`
	// Banner text.
	Text *string `json:"text" extensions:"!x-nullable"`
}

func (*APIProjectBanner) BuildFromService

func (t *APIProjectBanner) BuildFromService(h model.ProjectBanner)

func (*APIProjectBanner) ToService

func (t *APIProjectBanner) ToService() model.ProjectBanner

type APIProjectCreationConfig

type APIProjectCreationConfig struct {
	RepoProjectLimit int            `json:"repo_project_limit"`
	RepoExceptions   []APIOwnerRepo `json:"repo_exceptions"`
}

func (*APIProjectCreationConfig) BuildFromService

func (a *APIProjectCreationConfig) BuildFromService(h any) error

func (*APIProjectCreationConfig) ToService

func (a *APIProjectCreationConfig) ToService() (any, error)

type APIProjectEvent

type APIProjectEvent struct {
	Timestamp *time.Time              `json:"ts"`
	User      *string                 `json:"user"`
	Before    APIProjectEventSettings `json:"before"`
	After     APIProjectEventSettings `json:"after"`
}

func (*APIProjectEvent) BuildFromService

func (e *APIProjectEvent) BuildFromService(ctx context.Context, entry model.ProjectChangeEventEntry) error

func (*APIProjectEvent) ToService

func (e *APIProjectEvent) ToService() (any, error)

type APIProjectEventSettings

type APIProjectEventSettings struct {
	Id                    *string           `json:"id"`
	ProjectRef            APIProjectRef     `json:"proj_ref"`
	GithubAppAuth         APIGithubAppAuth  `json:"github_app_auth"`
	GithubWebhooksEnabled bool              `json:"github_webhooks_enabled"`
	Vars                  APIProjectVars    `json:"vars"`
	Aliases               []APIProjectAlias `json:"aliases"`
	Subscriptions         []APISubscription `json:"subscriptions"`
}

take this from the original place instead of redefinning it here

type APIProjectPermissionSummary

type APIProjectPermissionSummary struct {
	ProjectID         string              `json:"project_id"`
	ProjectIdentifier string              `json:"project_identifier"`
	IsRepo            bool                `json:"is_repo"`
	Permissions       map[string][]string `json:"permissions" extensions:"!x-nullable"`
}

APIProjectPermissionSummary lists the granted permissions for one project, grouped by category. Categories with no access are omitted.

type APIProjectRef

type APIProjectRef struct {
	Id *string `json:"id" extensions:"!x-nullable"`
	// GitHub org name.
	Owner *string `json:"owner_name" extensions:"!x-nullable"`
	// GitHub repository name.
	Repo *string `json:"repo_name" extensions:"!x-nullable"`
	// Name of tracking branch.
	Branch *string `json:"branch_name" extensions:"!x-nullable"`
	// Whether evergreen is enabled for this project.
	Enabled *bool `json:"enabled" extensions:"!x-nullable"`
	// Time interval between commits for Evergreen to activate.
	BatchTime int `json:"batch_time"`
	// Path to config file in repo.
	RemotePath *string `json:"remote_path" extensions:"!x-nullable"`
	// Oldest allowed merge base for PR patches
	OldestAllowedMergeBase *string `json:"oldest_allowed_merge_base" extensions:"!x-nullable"`
	// File path to script that users can run on spawn hosts loaded with task
	// data.
	SpawnHostScriptPath *string `json:"spawn_host_script_path" extensions:"!x-nullable"`
	// Internal evergreen identifier for project.
	Identifier *string `json:"identifier" extensions:"!x-nullable"`
	// Project name displayed to users.
	DisplayName *string `json:"display_name" extensions:"!x-nullable"`
	// List of identifiers of tasks used in this patch.
	DeactivatePrevious *bool `json:"deactivate_previous" extensions:"x-nullable"`
	// Enable GitHub automated pull request testing.
	PRTestingEnabled *bool `json:"pr_testing_enabled" extensions:"x-nullable"`
	// Enable GitHub manual pull request testing.
	ManualPRTestingEnabled *bool `json:"manual_pr_testing_enabled" extensions:"x-nullable"`
	// Enable testing when git tags are pushed.
	GitTagVersionsEnabled *bool `json:"git_tag_versions_enabled" extensions:"x-nullable"`
	// Enable GitHub checks.
	GithubChecksEnabled *bool `json:"github_checks_enabled" extensions:"x-nullable"`
	// Whether or not to default to using repo settings.
	UseRepoSettings *bool `json:"use_repo_settings" extensions:"!x-nullable"`
	// Identifier of the attached repo ref. Cannot be modified by users.
	RepoRefId *string `json:"repo_ref_id" extensions:"!x-nullable"`
	// Options for commit queue.
	CommitQueue APICommitQueueParams `json:"commit_queue"`
	// Options for task annotations.
	TaskAnnotationSettings APITaskAnnotationSettings `json:"task_annotation_settings"`
	// Options for Build Baron.
	BuildBaronSettings APIBuildBaronSettings `json:"build_baron_settings"`
	// Enable the performance plugin.
	PerfEnabled *bool `json:"perf_enabled" extensions:"x-nullable"`
	// Source of the AWS credentials used to presign signed artifacts. Not editable
	// from the project settings UI.
	ArtifactCredentials APIArtifactCredentialSettings `json:"artifact_credentials"`
	// Whether or not the project can be seen in the UI. Cannot be modified by
	// users.
	Hidden *bool `json:"hidden" extensions:"x-nullable"`
	// Disable patching.
	PatchingDisabled *bool `json:"patching_disabled" extensions:"x-nullable"`
	// Disable the repotracker.
	RepotrackerDisabled *bool `json:"repotracker_disabled" extensions:"x-nullable"`
	// Error from the repotracker, if any. Cannot be modified by users.
	RepotrackerError *APIRepositoryErrorDetails `json:"repotracker_error" extensions:"x-nullable"`
	// Disable task dispatching.
	DispatchingDisabled *bool `json:"dispatching_disabled" extensions:"x-nullable"`
	// Disable automatic task activation on the waterfall.
	WaterfallDisabled *bool `json:"waterfall_disabled" extensions:"x-nullable"`
	// Disable stepback.
	StepbackDisabled *bool `json:"stepback_disabled" extensions:"x-nullable"`
	// Enable debug spawn host functionality.
	DebugSpawnHostsDisabled *bool `json:"debug_spawn_hosts_disabled" extensions:"x-nullable"`
	// Use bisect stepback instead of linear.
	StepbackBisect *bool `json:"stepback_bisect" extensions:"x-nullable"`
	// Step back mainline and push-triggered versions together.
	StepbackPushTriggers *bool `json:"stepback_push_triggers" extensions:"x-nullable"`
	// Enable setting project aliases from version-controlled project configs.
	VersionControlEnabled *bool `json:"version_control_enabled" extensions:"x-nullable"`
	// Disable stats caching.
	DisabledStatsCache *bool `json:"disabled_stats_cache" extensions:"x-nullable"`
	// Source cache mode, or nil when unset.
	SourceCacheMode *model.SourceCacheMode `json:"source_cache_mode" extensions:"x-nullable"`
	// Usernames of project admins. Can be null for some projects (EVG-6598).
	Admins []*string `json:"admins" extensions:"x-nullable"`
	// Usernames of project admins to remove.
	DeleteAdmins []*string `json:"delete_admins,omitempty"`
	// Usernames authorized to submit git tag versions.
	GitTagAuthorizedUsers []*string `json:"git_tag_authorized_users" bson:"git_tag_authorized_users" extensions:"x-nullable"`
	// Usernames of git tag-authorized users to remove.
	DeleteGitTagAuthorizedUsers []*string `json:"delete_git_tag_authorized_users,omitempty" bson:"delete_git_tag_authorized_users,omitempty"`
	// Names of GitHub teams authorized to submit git tag versions.
	GitTagAuthorizedTeams []*string `json:"git_tag_authorized_teams" bson:"git_tag_authorized_teams" extensions:"x-nullable"`
	// Names of GitHub teams authorized to submit git tag versions to remove.
	DeleteGitTagAuthorizedTeams []*string `json:"delete_git_tag_authorized_teams,omitempty" bson:"delete_git_tag_authorized_teams,omitempty"`
	// Notify original committer (or admins) when build fails.
	NotifyOnBuildFailure *bool `json:"notify_on_failure" extensions:"x-nullable"`
	// Prevent users from being able to view this project unless explicitly
	// granted access.
	Restricted *bool `json:"restricted" extensions:"x-nullable"`
	// Only used when modifying projects to change the base revision and run the repotracker.
	Revision *string `json:"revision" extensions:"x-nullable"`
	// List of triggers for the project.
	Triggers []APITriggerDefinition `json:"triggers" extensions:"x-nullable"`
	// List of GitHub pull request trigger aliases.
	GithubPRTriggerAliases []*string `json:"github_trigger_aliases" extensions:"x-nullable"`
	// List of GitHub merge queue trigger aliases.
	GithubMQTriggerAliases []*string `json:"github_merge_queue_trigger_aliases" extensions:"x-nullable"`
	// List of patch trigger aliases.
	PatchTriggerAliases []APIPatchTriggerDefinition `json:"patch_trigger_aliases" extensions:"x-nullable"`
	// List of aliases for the project.
	Aliases []APIProjectAlias `json:"aliases" extensions:"x-nullable"`
	// Project variables information
	Variables APIProjectVars `json:"variables"`
	// Options for workstations.
	WorkstationConfig APIWorkstationConfig `json:"workstation_config"`
	// List of subscriptions for the project.
	Subscriptions []APISubscription `json:"subscriptions" extensions:"x-nullable"`
	// IDs of subscriptions to delete.
	DeleteSubscriptions []*string `json:"delete_subscriptions,omitempty"`
	// List of periodic build definitions.
	PeriodicBuilds []APIPeriodicBuildDefinition `json:"periodic_builds,omitempty"`
	// List of external links in the version metadata.
	ExternalLinks []APIExternalLink `json:"external_links" extensions:"x-nullable"`
	// Options for banner to display for the project.
	Banner APIProjectBanner `json:"banner"`
	// List of custom Parsley filters.
	ParsleyFilters []APIParsleyFilter `json:"parsley_filters" extensions:"x-nullable"`
	// Default project health view.
	ProjectHealthView model.ProjectHealthView `json:"project_health_view"`
	// List of GitHub permission groups.
	GitHubDynamicTokenPermissionGroups []APIGitHubDynamicTokenPermissionGroup `json:"github_dynamic_token_permission_groups,omitempty"`
	// GitHub permission group by requester.
	GitHubPermissionGroupByRequester map[string]string `json:"github_permission_group_by_requester,omitempty"`
	// Test selection settings.
	TestSelection APITestSelectionSettings `json:"test_selection,omitzero"`
	// Virtual task registration enabled.
	VirtualTasksEnabled *bool `json:"virtual_tasks_enabled,omitempty"`
	// Task ownership settings. This is related to Foliage Web Services (FWS).
	TaskOwnership APITaskOwnershipSettings `json:"task_ownership,omitempty"`
	// Whether or not to run every mainline commit version.
	RunEveryMainlineCommit *bool `json:"run_every_mainline_commit,omitzero" extensions:"x-nullable"`
}

func (*APIProjectRef) BuildFromService

func (p *APIProjectRef) BuildFromService(ctx context.Context, projectRef model.ProjectRef) error

func (*APIProjectRef) BuildPublicFields

func (p *APIProjectRef) BuildPublicFields(ctx context.Context, projectRef model.ProjectRef) error

BuildPublicFields only builds the fields that anyone should be able to see so that we can return these to non project admins.

func (*APIProjectRef) DefaultUnsetBooleans

func (pRef *APIProjectRef) DefaultUnsetBooleans(ctx context.Context)

DefaultUnsetBooleans is used to set booleans to their default value.

func (*APIProjectRef) ToService

func (p *APIProjectRef) ToService() (*model.ProjectRef, error)

ToService returns a service layer ProjectRef using the data from APIProjectRef

type APIProjectSettings

type APIProjectSettings struct {
	Id                    *string           `json:"id"`
	ProjectRef            APIProjectRef     `json:"proj_ref"`
	GithubAppAuth         APIGithubAppAuth  `json:"github_app_auth"`
	GithubWebhooksEnabled bool              `json:"github_webhooks_enabled"`
	Vars                  APIProjectVars    `json:"vars"`
	Aliases               []APIProjectAlias `json:"aliases"`
	Subscriptions         []APISubscription `json:"subscriptions"`
}

func DbProjectSettingsToRestModel

func DbProjectSettingsToRestModel(ctx context.Context, settings model.ProjectSettings) (APIProjectSettings, error)

type APIProjectTasksPair

type APIProjectTasksPair struct {
	ProjectID string `json:"project_id"`
	// IsRegex uses a pointer to handle the legacy case where we don't support regex.
	IsRegex      *bool    `json:"is_regex"`
	AllowedTasks []string `json:"allowed_tasks"`
	AllowedBVs   []string `json:"allowed_bvs"`
}

func (*APIProjectTasksPair) BuildFromService

func (a *APIProjectTasksPair) BuildFromService(h any) error

func (*APIProjectTasksPair) ToService

func (a *APIProjectTasksPair) ToService() (any, error)

type APIProjectToBucketMapping

type APIProjectToBucketMapping struct {
	ProjectID *string `json:"project_id"`
	Bucket    *string `json:"bucket"`
	Prefix    *string `json:"prefix"`
}

type APIProjectToPrefixMapping

type APIProjectToPrefixMapping struct {
	ProjectID *string `json:"project_id"`
	Prefix    *string `json:"prefix"`
}

type APIProjectVars

type APIProjectVars struct {
	// Regular project variable names and their values.
	Vars map[string]string `json:"vars" extensions:"x-nullable"`
	// Private variable names.
	PrivateVars map[string]bool `json:"private_vars" extensions:"x-nullable"`
	// Admin-only variable names.
	AdminOnlyVars map[string]bool `json:"admin_only_vars" extensions:"x-nullable"`
	// Descriptions for project variables.
	VarsDescriptions map[string]string `json:"vars_descriptions,omitempty"`
	// Names of project variables to delete.
	VarsToDelete []string `json:"vars_to_delete,omitempty"`

	// to use for the UI
	PrivateVarsList   []string `json:"-"`
	AdminOnlyVarsList []string `json:"-"`
}

func (*APIProjectVars) BuildFromService

func (p *APIProjectVars) BuildFromService(v model.ProjectVars)

func (*APIProjectVars) IsPrivate

func (vars *APIProjectVars) IsPrivate(key string) bool

IsPrivate returns true if the given key is a private variable.

func (*APIProjectVars) ToService

func (p *APIProjectVars) ToService() *model.ProjectVars

type APIProvisionOptions

type APIProvisionOptions struct {
	// ID of the task that the host was spawned from.
	TaskID *string `json:"task_id" extensions:"!x-nullable"`
}

APIProvisionOptions contains options for spawn hosts.

func (*APIProvisionOptions) BuildFromService

func (apiOpts *APIProvisionOptions) BuildFromService(opts host.ProvisionOptions)

type APIPubKey

type APIPubKey struct {
	Name *string `json:"name" extensions:"!x-nullable"`
	Key  *string `json:"key" extensions:"!x-nullable"`
}

func (*APIPubKey) BuildFromService

func (pk *APIPubKey) BuildFromService(in user.PubKey)

BuildFromService converts from service level structs to an APIPubKey.

type APIQuestionAnswer

type APIQuestionAnswer struct {
	ID     *string `json:"id" extensions:"x-nullable"`
	Prompt *string `json:"prompt" extensions:"x-nullable"`
	Answer *string `json:"answer" extensions:"x-nullable"`
}

func (*APIQuestionAnswer) ToService

func (a *APIQuestionAnswer) ToService() model.QuestionAnswer

type APIRateLimitConfig

type APIRateLimitConfig struct {
	RESTUserPerHour          int      `json:"rest_user_per_hour"`
	RESTUserBurst            int      `json:"rest_user_burst"`
	RESTServicePerHour       int      `json:"rest_service_per_hour"`
	RESTServiceBurst         int      `json:"rest_service_burst"`
	GraphQLUserPerHour       int      `json:"graphql_user_per_hour"`
	GraphQLUserBurst         int      `json:"graphql_user_burst"`
	GraphQLServicePerHour    int      `json:"graphql_service_per_hour"`
	GraphQLServiceBurst      int      `json:"graphql_service_burst"`
	GraphQLComplexityLimit   int      `json:"graphql_complexity_limit"`
	GraphQLComplexityPerHour int      `json:"graphql_complexity_per_hour"`
	GraphQLComplexityBurst   int      `json:"graphql_complexity_burst"`
	ElevatedUserIDs          []string `json:"elevated_user_ids"`
	ExemptUserIDs            []string `json:"exempt_user_ids"`
}

func (*APIRateLimitConfig) BuildFromService

func (a *APIRateLimitConfig) BuildFromService(h any) error

func (*APIRateLimitConfig) ToService

func (a *APIRateLimitConfig) ToService() (any, error)

type APIRateLimitStatus

type APIRateLimitStatus struct {
	Limit             int `json:"hourly_limit"`
	Burst             int `json:"burst_limit"`
	Remaining         int `json:"remaining"`
	ResetAfterSeconds int `json:"reset_after_seconds"`
}

func (*APIRateLimitStatus) BuildFromService

func (s *APIRateLimitStatus) BuildFromService(result *redis_rate.Result)

BuildFromService converts a redis_rate.Result into an APIRateLimitStatus.

type APIRawModule

type APIRawModule struct {
	// The module name
	Name string `json:"name"`
	// The module diff
	Diff string `json:"diff"`
	// The githash for the module
	Githash string `json:"githash"`
}

APIRawModule contains a module diff.

type APIRawPatch

type APIRawPatch struct {
	// The main patch
	Patch APIRawModule `json:"patch"`
	// The list of module diffs
	RawModules []APIRawModule `json:"raw_modules" extensions:"x-nullable"`
	// LocalModuleIncludes contains module config file overrides from the source patch.
	LocalModuleIncludes []APILocalModuleInclude `json:"local_module_includes,omitempty"`
}

APIRawPatch contains a patch diff along with its module diffs.

type APIRecentTaskStats

type APIRecentTaskStats struct {
	Total              int `json:"total"`
	Inactive           int `json:"inactive"`
	Unstarted          int `json:"unstarted"`
	Started            int `json:"started"`
	Succeeded          int `json:"succeeded"`
	Failed             int `json:"failed"`
	SystemFailed       int `json:"system-failed"`
	SetupFailed        int `json:"setup-failed"`
	SystemUnresponsive int `json:"system-unresponsive"`
	SystemTimedOut     int `json:"system-timed-out"`
	TestTimedOut       int `json:"test-timed-out"`
}

APIRecentTaskStats is the model to be returned by the API whenever recent tasks are fetched.

func (*APIRecentTaskStats) BuildFromService

func (ts *APIRecentTaskStats) BuildFromService(rc task.ResultCounts)

BuildFromService converts from service level structs to an APIRecentTaskStats.

type APIRecentTaskStatsList

type APIRecentTaskStatsList map[string][]APIStat

func (*APIRecentTaskStatsList) BuildFromService

func (s *APIRecentTaskStatsList) BuildFromService(statsMap map[string][]task.Stat)

type APIReleaseModeConfig

type APIReleaseModeConfig struct {
	DistroMaxHostsFactor                float64 `json:"distro_max_hosts_factor"`
	TargetTimeSecondsOverride           int     `json:"target_time_seconds_override"`
	IdleTimeSecondsOverride             int     `json:"idle_time_seconds_override"`
	MergeQueueTargetTimeSecondsOverride int     `json:"merge_queue_target_time_seconds_override"`
}

func (*APIReleaseModeConfig) BuildFromService

func (a *APIReleaseModeConfig) BuildFromService(h any) error

func (*APIReleaseModeConfig) ToService

func (a *APIReleaseModeConfig) ToService() (any, error)

type APIRepoTrackerConfig

type APIRepoTrackerConfig struct {
	NumNewRepoRevisionsToFetch int `json:"revs_to_fetch"`
	MaxRepoRevisionsToSearch   int `json:"max_revs_to_search"`
	MaxConcurrentRequests      int `json:"max_con_requests"`
}

func (*APIRepoTrackerConfig) BuildFromService

func (a *APIRepoTrackerConfig) BuildFromService(h any) error

func (*APIRepoTrackerConfig) ToService

func (a *APIRepoTrackerConfig) ToService() (any, error)

type APIRepositoryCredentials

type APIRepositoryCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type APIRepositoryErrorDetails

type APIRepositoryErrorDetails struct {
	Exists            *bool   `json:"exists" extensions:"!x-nullable"`
	InvalidRevision   *string `json:"invalid_revision" extensions:"!x-nullable"`
	MergeBaseRevision *string `json:"merge_base_revision" extensions:"!x-nullable"`
}

func (*APIRepositoryErrorDetails) BuildFromService

type APIResourceConstraintInfo

type APIResourceConstraintInfo struct {
	CPUConstrained    bool    `json:"cpu_constrained"`
	MemoryConstrained bool    `json:"memory_constrained"`
	PeakCPUPercent    float64 `json:"peak_cpu_percent,omitempty"`
	PeakMemoryPercent float64 `json:"peak_memory_percent,omitempty"`
}

func (*APIResourceConstraintInfo) BuildFromService

func (*APIResourceConstraintInfo) ToService

type APIResourceLimits

type APIResourceLimits struct {
	NumFiles        int `json:"num_files"`
	NumProcesses    int `json:"num_processes"`
	NumTasks        int `json:"num_tasks"`
	LockedMemoryKB  int `json:"locked_memory"`
	VirtualMemoryKB int `json:"virtual_memory"`
}

type APIResourceTagsConfig

type APIResourceTagsConfig struct {
	MongoDBEnv   *string `json:"mongodb_env"`
	MongoDBOwner *string `json:"mongodb_owner"`
}

func (*APIResourceTagsConfig) BuildFromService

func (a *APIResourceTagsConfig) BuildFromService(h any) error

func (*APIResourceTagsConfig) ToService

func (a *APIResourceTagsConfig) ToService() (any, error)

type APIRuntimeEnvironmentsConfig

type APIRuntimeEnvironmentsConfig struct {
	BaseURL *string `json:"base_url"`
	APIKey  *string `json:"api_key"`
}

func (*APIRuntimeEnvironmentsConfig) BuildFromService

func (a *APIRuntimeEnvironmentsConfig) BuildFromService(h any) error

func (*APIRuntimeEnvironmentsConfig) ToService

func (a *APIRuntimeEnvironmentsConfig) ToService() (any, error)

type APIS3CostConfig

type APIS3CostConfig struct {
	Upload  APIS3UploadCostConfig  `json:"upload"`
	Storage APIS3StorageCostConfig `json:"storage"`
}

func (*APIS3CostConfig) BuildFromService

func (a *APIS3CostConfig) BuildFromService(h any) error

func (*APIS3CostConfig) ToService

func (a *APIS3CostConfig) ToService() (any, error)

type APIS3Credentials

type APIS3Credentials struct {
	Key    *string `json:"key"`
	Secret *string `json:"secret"`
	Bucket *string `json:"bucket"`
}

func (*APIS3Credentials) BuildFromService

func (a *APIS3Credentials) BuildFromService(h any) error

func (*APIS3Credentials) ToService

func (a *APIS3Credentials) ToService() (any, error)

type APIS3StorageCostConfig

type APIS3StorageCostConfig struct {
	StandardStorageCostDiscount              float64  `json:"standard_storage_cost_discount"`
	IAStorageCostDiscount                    float64  `json:"i_a_storage_cost_discount"`
	ArchiveStorageCostDiscount               float64  `json:"archive_storage_cost_discount"`
	DefaultMaxArtifactExpirationDays         int      `json:"default_max_artifact_expiration_days"`
	DevprodOwnedAWSAccountIds                []string `json:"devprod_owned_aws_account_ids"`
	ArtifactAwsAccountsWithoutLifecycleRules []string `json:"artifact_aws_accounts_without_lifecycle_rules"`
}

func (*APIS3StorageCostConfig) BuildFromService

func (a *APIS3StorageCostConfig) BuildFromService(h any) error

func (*APIS3StorageCostConfig) ToService

func (a *APIS3StorageCostConfig) ToService() (any, error)

type APIS3UploadCostConfig

type APIS3UploadCostConfig struct {
	UploadCostDiscount float64 `json:"upload_cost_discount"`
}

func (*APIS3UploadCostConfig) BuildFromService

func (a *APIS3UploadCostConfig) BuildFromService(h any) error

func (*APIS3UploadCostConfig) ToService

func (a *APIS3UploadCostConfig) ToService() (any, error)

type APISESConfig

type APISESConfig struct {
	SenderAddress *string `json:"sender_address"`
}

func (*APISESConfig) BuildFromService

func (a *APISESConfig) BuildFromService(h any) error

func (*APISESConfig) ToService

func (a *APISESConfig) ToService() (any, error)

type APISSHConfig

type APISSHConfig struct {
	TaskHostKey  APISSHKeyPair `json:"task_host_key"`
	SpawnHostKey APISSHKeyPair `json:"spawn_host_key"`
}

func (*APISSHConfig) BuildFromService

func (a *APISSHConfig) BuildFromService(h any) error

func (*APISSHConfig) ToService

func (a *APISSHConfig) ToService() (any, error)

type APISSHKeyPair

type APISSHKeyPair struct {
	Name      *string `json:"name"`
	SecretARN *string `json:"secret_arn"`
}

func (*APISSHKeyPair) BuildFromService

func (a *APISSHKeyPair) BuildFromService(h any) error

func (*APISSHKeyPair) ToService

func (a *APISSHKeyPair) ToService() (any, error)

type APISageConfig

type APISageConfig struct {
	BaseURL *string `json:"base_url"`
}

APISageConfig is the API model for the Sage configuration.

func (*APISageConfig) BuildFromService

func (a *APISageConfig) BuildFromService(h any) error

func (*APISageConfig) ToService

func (a *APISageConfig) ToService() (any, error)

type APISchedulerConfig

type APISchedulerConfig struct {
	TaskFinder                       *string `json:"task_finder"`
	HostAllocator                    *string `json:"host_allocator"`
	HostAllocatorRoundingRule        *string `json:"host_allocator_rounding_rule"`
	HostAllocatorFeedbackRule        *string `json:"host_allocator_feedback_rule"`
	HostsOverallocatedRule           *string `json:"hosts_overallocated_rule"`
	FutureHostFraction               float64 `json:"free_host_fraction"`
	CacheDurationSeconds             int     `json:"cache_duration_seconds"`
	TargetTimeSeconds                int     `json:"target_time_seconds"`
	MergeQueueTargetTimeSeconds      int     `json:"merge_queue_target_time_seconds"`
	AcceptableHostIdleTimeSeconds    int     `json:"acceptable_host_idle_time_seconds"`
	GroupVersions                    bool    `json:"group_versions"`
	PatchFactor                      int64   `json:"patch_factor"`
	PatchTimeInQueueFactor           int64   `json:"patch_time_in_queue_factor"`
	CommitQueueFactor                int64   `json:"commit_queue_factor"`
	MainlineTimeInQueueFactor        int64   `json:"mainline_time_in_queue_factor"`
	ExpectedRuntimeFactor            int64   `json:"expected_runtime_factor"`
	GenerateTaskFactor               int64   `json:"generate_task_factor"`
	NumDependentsFactor              float64 `json:"num_dependents_factor"`
	StepbackTaskFactor               int64   `json:"stepback_task_factor"`
	TranslateProjectConcurrencyLimit int     `json:"translate_project_concurrency_limit"`
	TranslateProjectCacheBytesLimit  int64   `json:"translate_project_cache_bytes_limit"`
	TranslateProjectCacheTTLSeconds  int64   `json:"translate_project_cache_ttl_seconds"`
}

func (*APISchedulerConfig) BuildFromService

func (a *APISchedulerConfig) BuildFromService(h any) error

func (*APISchedulerConfig) ToService

func (a *APISchedulerConfig) ToService() (any, error)

type APISelector

type APISelector struct {
	Type *string `json:"type" extensions:"!x-nullable"`
	Data *string `json:"data" extensions:"!x-nullable"`
}

func (*APISelector) BuildFromService

func (s *APISelector) BuildFromService(selector event.Selector)

func (*APISelector) ToService

func (s *APISelector) ToService() event.Selector

type APIServiceFlags

type APIServiceFlags struct {
	TaskDispatchDisabled               bool `json:"task_dispatch_disabled"`
	HostInitDisabled                   bool `json:"host_init_disabled"`
	LargeParserProjectsDisabled        bool `json:"large_parser_projects_disabled"`
	MonitorDisabled                    bool `json:"monitor_disabled"`
	MergeQueueRecoveryEnabled          bool `json:"merge_queue_recovery_enabled"`
	AlertsDisabled                     bool `json:"alerts_disabled"`
	AgentStartDisabled                 bool `json:"agent_start_disabled"`
	RepotrackerDisabled                bool `json:"repotracker_disabled"`
	SchedulerDisabled                  bool `json:"scheduler_disabled"`
	CheckBlockedTasksDisabled          bool `json:"check_blocked_tasks_disabled"`
	GithubPRTestingDisabled            bool `json:"github_pr_testing_disabled"`
	CLIUpdatesDisabled                 bool `json:"cli_updates_disabled"`
	BackgroundStatsDisabled            bool `json:"background_stats_disabled"`
	TaskLoggingDisabled                bool `json:"task_logging_disabled"`
	CacheStatsJobDisabled              bool `json:"cache_stats_job_disabled"`
	CacheStatsEndpointDisabled         bool `json:"cache_stats_endpoint_disabled"`
	TaskReliabilityDisabled            bool `json:"task_reliability_disabled"`
	HostAllocatorDisabled              bool `json:"host_allocator_disabled"`
	BackgroundReauthDisabled           bool `json:"background_reauth_disabled"`
	CloudCleanupDisabled               bool `json:"cloud_cleanup_disabled"`
	SleepScheduleDisabled              bool `json:"sleep_schedule_disabled"`
	SystemFailedTaskRestartDisabled    bool `json:"system_failed_task_restart_disabled"`
	DegradedModeDisabled               bool `json:"cpu_degraded_mode_disabled"`
	ElasticIPsDisabled                 bool `json:"elastic_ips_disabled"`
	ReleaseModeDisabled                bool `json:"release_mode_disabled"`
	LegacyUIAdminPageDisabled          bool `json:"legacy_ui_admin_page_disabled"`
	DebugSpawnHostDisabled             bool `json:"debug_spawn_host_disabled"`
	S3LifecycleSyncDisabled            bool `json:"s3_lifecycle_sync_disabled"`
	UseMergeQueuePathFilteringDisabled bool `json:"use_merge_queue_path_filtering_disabled"`
	PSLoggingDisabled                  bool `json:"ps_logging_disabled"`
	PodDiagnosticsDisabled             bool `json:"pod_diagnostics_disabled"`
	RetryFailedLogMoveEnabled          bool `json:"retry_failed_log_move_enabled"`
	ProjectTranslationCacheEnabled     bool `json:"project_translation_cache_enabled"`
	ContainerIsolationEnabled          bool `json:"container_isolation_enabled"`
	SourceCacheAllProjectsEnabled      bool `json:"source_cache_all_projects_enabled"`
	LiveArtifactCredentialsDisabled    bool `json:"live_artifact_credentials_disabled"`

	// Notifications Flags
	EventProcessingDisabled      bool `json:"event_processing_disabled"`
	JIRANotificationsDisabled    bool `json:"jira_notifications_disabled"`
	SlackNotificationsDisabled   bool `json:"slack_notifications_disabled"`
	EmailNotificationsDisabled   bool `json:"email_notifications_disabled"`
	WebhookNotificationsDisabled bool `json:"webhook_notifications_disabled"`
	GithubStatusAPIDisabled      bool `json:"github_status_api_disabled"`
	SecondaryReadsDisabled       bool `json:"secondary_reads_disabled"`

	// Rate Limiting Flags
	APIRateLimiterDisabled               bool `json:"api_rate_limiter_disabled"`
	GraphQLComplexityLimiterDisabled     bool `json:"graphql_complexity_limiter_disabled"`
	GraphQLComplexityRateLimiterDisabled bool `json:"graphql_complexity_rate_limiter_disabled"`

	TaskQueueAutoUnscheduleDisabled bool `json:"task_queue_auto_unschedule_disabled"`
	VirtualTasksDisabled            bool `json:"virtual_tasks_disabled"`
}

APIServiceFlags is a public structure representing the admin service flags

func (*APIServiceFlags) BuildFromService

func (as *APIServiceFlags) BuildFromService(h any) error

BuildFromService builds a model from the service layer

func (*APIServiceFlags) ToService

func (as *APIServiceFlags) ToService() (any, error)

ToService returns a service model from an API model

type APIServiceFlagsResponse

type APIServiceFlagsResponse struct {
	DebugSpawnHostDisabled bool `json:"debug_spawn_host_disabled"`
}

APIServiceFlagsResponse contains service flags used by Evergreen clients.

type APISingleTaskDistroConfig

type APISingleTaskDistroConfig struct {
	ProjectTasksPairs []APIProjectTasksPair `json:"project_tasks_pair"`
}

func (*APISingleTaskDistroConfig) BuildFromService

func (a *APISingleTaskDistroConfig) BuildFromService(h any) error

func (*APISingleTaskDistroConfig) ToService

func (a *APISingleTaskDistroConfig) ToService() (any, error)

type APISlack

type APISlack struct {
	Target      *string              `json:"target"`
	Msg         *string              `json:"msg"`
	Attachments []APISlackAttachment `json:"attachments"`
}

type APISlackAttachment

type APISlackAttachment struct {
	Color      *string                   `json:"color"`
	Fallback   *string                   `json:"fallback"`
	AuthorName *string                   `json:"author_name"`
	AuthorIcon *string                   `json:"author_icon"`
	Title      *string                   `json:"title"`
	TitleLink  *string                   `json:"title_link"`
	Text       *string                   `json:"text"`
	Fields     []APISlackAttachmentField `json:"fields"`
	MarkdownIn []string                  `json:"mrkdwn_in"`
	Footer     *string                   `json:"footer"`
}

func (*APISlackAttachment) BuildFromService

func (a *APISlackAttachment) BuildFromService(attachment message.SlackAttachment)

BuildFromService converts from service level message.SlackAttachment to APISlackAttachment.

func (*APISlackAttachment) ToService

ToService returns a service layer message.SlackAttachment using the data from APISlackAttachment.

type APISlackAttachmentField

type APISlackAttachmentField struct {
	Title *string `json:"title"`
	Value *string `json:"value"`
	Short bool    `json:"short"`
}

func (*APISlackAttachmentField) BuildFromService

func (f *APISlackAttachmentField) BuildFromService(field message.SlackAttachmentField)

BuildFromService converts from service level message.SlackAttachmentField to an APISlackAttachmentField.

func (*APISlackAttachmentField) ToService

ToService returns a service layer message.SlackAttachmentField using the data from APISlackAttachmentField.

type APISlackConfig

type APISlackConfig struct {
	Options *APISlackOptions `json:"options"`
	Token   *string          `json:"token"`
	Level   *string          `json:"level"`
	Name    *string          `json:"name"`
}

func (*APISlackConfig) BuildFromService

func (a *APISlackConfig) BuildFromService(h any) error

func (*APISlackConfig) ToService

func (a *APISlackConfig) ToService() (any, error)

type APISlackOptions

type APISlackOptions struct {
	Channel       *string         `json:"channel"`
	Hostname      *string         `json:"hostname"`
	Name          *string         `json:"name"`
	Username      *string         `json:"username"`
	BasicMetadata bool            `json:"add_basic_metadata"`
	Fields        bool            `json:"use_fields"`
	AllFields     bool            `json:"all_fields"`
	FieldsSet     map[string]bool `json:"fields"`
}

func (*APISlackOptions) BuildFromService

func (a *APISlackOptions) BuildFromService(h any) error

func (*APISlackOptions) ToService

func (a *APISlackOptions) ToService() (any, error)

type APISleepScheduleConfig

type APISleepScheduleConfig struct {
	PermanentlyExemptHosts []string `json:"permanently_exempt_hosts"`
}

func (*APISleepScheduleConfig) BuildFromService

func (a *APISleepScheduleConfig) BuildFromService(h any) error

func (*APISleepScheduleConfig) ToService

func (a *APISleepScheduleConfig) ToService() (any, error)

type APISource

type APISource struct {
	// The author of the edit
	Author *string `bson:"author,omitempty" json:"author,omitempty"`
	// The time of the edit
	Time *time.Time `bson:"time,omitempty" json:"time,omitempty"`
	// The source of the request (api or ui)
	Requester *string `bson:"requester,omitempty" json:"requester,omitempty"`
}

func APISourceBuildFromService

func APISourceBuildFromService(t *annotations.Source) *APISource

APISourceBuildFromService takes the annotations.Source DB struct and returns the REST struct *APISource with the corresponding fields populated

type APISpawnHostConfig

type APISpawnHostConfig struct {
	UnexpirableHostsPerUser   *int `json:"unexpirable_hosts_per_user"`
	UnexpirableVolumesPerUser *int `json:"unexpirable_volumes_per_user"`
	SpawnHostsPerUser         *int `json:"spawn_hosts_per_user"`
}

func (*APISpawnHostConfig) BuildFromService

func (c *APISpawnHostConfig) BuildFromService(h any) error

func (*APISpawnHostConfig) ToService

func (c *APISpawnHostConfig) ToService() (any, error)

type APISpawnHostModify

type APISpawnHostModify struct {
	Action       *string    `json:"action"`
	HostID       *string    `json:"host_id"`
	VolumeID     *string    `json:"volume_id"`
	RDPPwd       *string    `json:"rdp_pwd"`
	AddHours     *string    `json:"add_hours"`
	Expiration   *time.Time `json:"expiration"`
	InstanceType *string    `json:"instance_type"`
	AddTags      []*string  `json:"tags_to_add"`
	DeleteTags   []*string  `json:"tags_to_delete"`
	NewName      *string    `json:"new_name"`
}

type APISplunkConfig

type APISplunkConfig struct {
	SplunkConnectionInfo *APISplunkConnectionInfo `json:"splunk_connection_info"`
}

func (*APISplunkConfig) BuildFromService

func (a *APISplunkConfig) BuildFromService(h any) error

func (*APISplunkConfig) ToService

func (a *APISplunkConfig) ToService() (any, error)

type APISplunkConnectionInfo

type APISplunkConnectionInfo struct {
	ServerURL *string `json:"url"`
	Token     *string `json:"token"`
	Channel   *string `json:"channel"`
}

func (*APISplunkConnectionInfo) BuildFromService

func (a *APISplunkConnectionInfo) BuildFromService(s send.SplunkConnectionInfo)

func (*APISplunkConnectionInfo) ToService

type APIStat

type APIStat struct {
	Name  *string `json:"name"`
	Count int     `json:"count"`
}

type APIStatList

type APIStatList []APIStat

func (*APIStatList) BuildFromService

func (s *APIStatList) BuildFromService(tasks []task.Stat)

type APIStepbackInfo

type APIStepbackInfo struct {
	LastFailingStepbackTaskId string `json:"last_failing_stepback_task_id"`
	LastPassingStepbackTaskId string `json:"last_passing_stepback_task_id"`
	NextStepbackTaskId        string `json:"next_stepback_task_id"`
	PreviousStepbackTaskId    string `json:"previous_stepback_task_id"`
}

type APISubnet

type APISubnet struct {
	AZ       *string `json:"az"`
	SubnetID *string `json:"subnet_id"`
}

func (*APISubnet) BuildFromService

func (a *APISubnet) BuildFromService(h any) error

func (*APISubnet) ToService

func (a *APISubnet) ToService() (any, error)

type APISubscriber

type APISubscriber struct {
	Type *string `json:"type" extensions:"!x-nullable"`
	// Target can be either a slice or a string. However, since swaggo does not
	// support the OpenAPI `oneOf` keyword, we set `swaggerignore` and document
	// the field manually in the "Fetch all projects" endpoint.
	Target              any                     `json:"target" swaggerignore:"true"`
	WebhookSubscriber   *APIWebhookSubscriber   `json:"-"`
	JiraIssueSubscriber *APIJIRAIssueSubscriber `json:"-"`
}

func (*APISubscriber) BuildFromService

func (s *APISubscriber) BuildFromService(in event.Subscriber) error

BuildFromService for APISubscriber needs to return an error so that we can validate the target interface type.

func (*APISubscriber) ToService

func (s *APISubscriber) ToService() (event.Subscriber, error)

type APISubscription

type APISubscription struct {
	// Identifier for the subscription.
	ID *string `json:"id" extensions:"!x-nullable"`
	// Type of resource to subscribe to.
	ResourceType *string `json:"resource_type" extensions:"!x-nullable"`
	// Type of trigger for the subscription.
	Trigger *string `json:"trigger" extensions:"!x-nullable"`
	// List of resource selectors.
	Selectors []APISelector `json:"selectors" extensions:"!x-nullable"`
	// List of resource regex selectors.
	RegexSelectors []APISelector `json:"regex_selectors" extensions:"!x-nullable"`
	// Options for the subscriber.
	Subscriber APISubscriber `json:"subscriber"`
	// Type of subscription owner.
	OwnerType *string `json:"owner_type" extensions:"!x-nullable"`
	// The subscription owner.
	Owner *string `json:"owner" extensions:"!x-nullable"`
	// Data for the particular condition that triggers the subscription.
	TriggerData map[string]string `json:"trigger_data,omitempty"`
}

func DbProjectSubscriptionsToRestModel

func DbProjectSubscriptionsToRestModel(subscriptions []event.Subscription) ([]APISubscription, error)

func (*APISubscription) BuildFromService

func (s *APISubscription) BuildFromService(sub event.Subscription) error

func (*APISubscription) ToService

func (s *APISubscription) ToService() (event.Subscription, error)

type APITask

type APITask struct {
	// Unique identifier of this task
	Id                *string `json:"task_id" extensions:"!x-nullable"`
	ProjectId         *string `json:"project_id" extensions:"!x-nullable"`
	ProjectIdentifier *string `json:"project_identifier" extensions:"x-nullable"`
	// Time that this task was first created
	CreateTime *time.Time `json:"create_time" extensions:"x-nullable"`
	// Time that this time was dispatched
	DispatchTime *time.Time `json:"dispatch_time" extensions:"x-nullable"`
	// Time that this task is scheduled to begin
	ScheduledTime *time.Time `json:"scheduled_time" extensions:"x-nullable"`
	// Time that this task began execution
	StartTime *time.Time `json:"start_time" extensions:"x-nullable"`
	// Time that this task finished execution
	FinishTime    *time.Time `json:"finish_time" extensions:"x-nullable"`
	IngestTime    *time.Time `json:"ingest_time" extensions:"x-nullable"`
	ActivatedTime *time.Time `json:"activated_time" extensions:"x-nullable"`
	// An identifier of this task by its project and commit hash
	Version *string `json:"version_id" extensions:"!x-nullable"`
	// The version control identifier associated with this task
	Revision *string `json:"revision" extensions:"!x-nullable"`
	// The priority of this task to be run
	Priority int64 `json:"priority"`
	// Whether the task is currently active
	Activated bool `json:"activated"`
	// The information, if any, about stepback
	StepbackInfo *APIStepbackInfo `json:"stepback_info" extensions:"x-nullable"`
	// Identifier of the process or user that activated this task
	ActivatedBy *string `json:"activated_by" extensions:"!x-nullable"`
	// Identifier of the build that this task is part of
	BuildId *string `json:"build_id" extensions:"!x-nullable"`
	// Identifier of the distro that this task runs on
	DistroId *string `json:"distro_id" extensions:"!x-nullable"`
	// Name of the buildvariant that this task runs on
	BuildVariant            *string `json:"build_variant" extensions:"!x-nullable"`
	BuildVariantDisplayName *string `json:"build_variant_display_name" extensions:"!x-nullable"`
	// List of task_ids of task that this task depends on before beginning
	DependsOn []APIDependency `json:"depends_on" extensions:"x-nullable"`
	// Name of this task displayed in the UI
	DisplayName *string `json:"display_name" extensions:"!x-nullable"`
	// The ID of the host this task ran or is running on
	HostId *string `json:"host_id" extensions:"!x-nullable"`
	// The number of the execution of this particular task
	Execution int `json:"execution"`
	// The execution environment that the task ran in (possible values are
	// "host" and "container"). Empty is treated as "host" for tasks that
	// predate this field.
	ExecutionPlatform *string `json:"execution_platform" extensions:"!x-nullable"`
	// For mainline commits, represents the position in the commit history of
	// commit this task is associated with. For patches, this represents the
	// number of total patches submitted by the user.
	Order int `json:"order"`
	// The current status of this task (possible values are "undispatched",
	// "dispatched", "started", "success", and "failed")
	Status *string `json:"status" extensions:"!x-nullable"`
	// The status of this task that is displayed in the UI (possible values are
	// "will-run", "unscheduled", "blocked", "dispatched", "started", "success",
	// "failed", "aborted", "system-failed", "system-unresponsive",
	// "system-timed-out", "task-timed-out", "known-issue").
	// Populated from the task's DisplayStatusCache field in the DB. The BSON field
	// name differs (display_status_cache vs display_status) to avoid breaking existing
	// workflows; do not change the BSON tag.
	DisplayStatus *string `json:"display_status" extensions:"!x-nullable"`
	// Object containing additional information about the status
	Details ApiTaskEndDetail `json:"status_details"`
	// Object containing raw and event logs for this task
	Logs LogLinks `json:"logs"`
	// Object containing parsley logs for this task
	ParsleyLogs LogLinks `json:"parsley_logs"`
	// Number of milliseconds this task took during execution
	TimeTaken APIDuration `json:"time_taken_ms"`
	// Cost breakdown for running this task
	TaskCost *cost.Cost `json:"task_cost,omitempty"`
	// Predicted cost breakdown based on historical task costs
	PredictedTaskCost *cost.Cost `json:"predicted_task_cost,omitempty"`
	// S3 API usage metrics for this task
	S3Usage *s3usage.S3Usage `json:"s3_usage,omitempty"`
	// Number of milliseconds expected for this task to execute
	ExpectedDuration APIDuration `json:"expected_duration_ms"`
	EstimatedStart   APIDuration `json:"est_wait_to_start_ms"`
	// Contains previous executions of the task if they were requested, and
	// available. May be empty
	PreviousExecutions []APITask `json:"previous_executions,omitempty"`
	GenerateTask       bool      `json:"generate_task"`
	GeneratedBy        string    `json:"generated_by"`
	// The list of artifacts associated with the task.
	Artifacts   []APIFile `json:"artifacts" extensions:"x-nullable"`
	DisplayOnly bool      `json:"display_only"`
	// The ID of the task's parent display task, if requested and available
	ParentTaskId   string    `json:"parent_task_id"`
	ExecutionTasks []*string `json:"execution_tasks,omitempty"`
	// List of tags defined for the task, if any
	Tags              []*string `json:"tags,omitempty"`
	Mainline          bool      `json:"mainline"`
	TaskGroup         string    `json:"task_group,omitempty"`
	TaskGroupMaxHosts int       `json:"task_group_max_hosts,omitempty"`
	Blocked           bool      `json:"blocked"`
	// Version created by one of patch_request", "github_pull_request",
	// "gitter_request" (caused by git commit, aka the repotracker requester),
	// "trigger_request" (Project Trigger versions) , "merge_test" (commit queue
	// patches), "ad_hoc" (periodic builds)
	Requester            *string         `json:"requester" extensions:"!x-nullable"`
	TestResults          []APITest       `json:"test_results" extensions:"x-nullable"`
	Aborted              bool            `json:"aborted"`
	AbortInfo            APIAbortInfo    `json:"abort_info"`
	AMI                  *string         `json:"ami" extensions:"x-nullable"`
	MustHaveResults      bool            `json:"must_have_test_results"`
	BaseTask             APIBaseTaskInfo `json:"base_task"`
	ResetWhenFinished    bool            `json:"reset_when_finished"`
	HasAnnotations       bool            `json:"has_annotations"`
	IsAutomaticRestart   bool            `json:"is_automatic_restart"`
	TestSelectionEnabled bool            `json:"test_selection_enabled"`
	IsVirtual            bool            `json:"is_virtual"`
	CompletedBy          *string         `json:"completed_by,omitempty"`
	// These fields are used by graphql gen, but do not need to be exposed
	// via Evergreen's user-facing API.
	OverrideDependencies         bool `json:"-"`
	Archived                     bool `json:"archived"`
	HasTestResults               bool `json:"-"`
	ResultsFailed                bool `json:"-"`
	QuarantinedTestsSkippedCount int  `json:"-"`
}

APITask is the model to be returned by the API whenever tasks are fetched.

func (*APITask) BuildFromService

func (at *APITask) BuildFromService(ctx context.Context, t *task.Task, args *APITaskArgs) error

BuildFromService converts from a service level task by loading the data into the appropriate fields of the APITask. It takes optional arguments to populate additional fields.

func (*APITask) BuildPreviousExecutions

func (at *APITask) BuildPreviousExecutions(ctx context.Context, tasks []task.Task, args *APITaskArgs) error

BuildPreviousExecutions adds the given previous executions to the given API task. The args are applied to every execution, so a caller with prefetched data can avoid querying per execution.

func (*APITask) GetAMI

func (at *APITask) GetAMI(ctx context.Context) error

func (*APITask) GetProjectIdentifier

func (at *APITask) GetProjectIdentifier(ctx context.Context)

func (*APITask) ToService

func (at *APITask) ToService() (*task.Task, error)

ToService returns a service layer task using the data from the APITask. Wraps ToServiceTask to maintain the model interface.

type APITaskAnnotation

type APITaskAnnotation struct {
	Id *string `bson:"_id" json:"id" extensions:"!x-nullable"`
	// Identifier of the task that this annotation is for
	TaskId *string `bson:"task_id" json:"task_id" extensions:"!x-nullable"`
	// The number of the execution of the task that the annotation is for
	TaskExecution *int `bson:"task_execution" json:"task_execution" extensions:"!x-nullable"`
	// Structured data about the task. Since this is user-given json data, the structure can differ between annotations
	Metadata *birch.Document `bson:"metadata,omitempty" json:"metadata,omitempty" swaggertype:"object"`
	// Comment about the task failure
	Note *APINote `bson:"note,omitempty" json:"note,omitempty"`
	// Links to tickets definitely related
	Issues []APIIssueLink `bson:"issues,omitempty" json:"issues,omitempty"`
	// Links to tickets possibly related
	SuspectedIssues []APIIssueLink `bson:"suspected_issues,omitempty" json:"suspected_issues,omitempty"`
	CreatedIssues   []APIIssueLink `bson:"created_issues,omitempty" json:"created_issues,omitempty"`
	// List of links associated with a task, to be displayed in the task metadata sidebar, currently limited to 1
	MetadataLinks []APIMetadataLink `bson:"metadata_links,omitempty" json:"metadata_links,omitempty"`
}

func APITaskAnnotationBuildFromService

func APITaskAnnotationBuildFromService(t annotations.TaskAnnotation) *APITaskAnnotation

APITaskAnnotationBuildFromService takes the annotations.TaskAnnotation DB struct and returns the REST struct *APITaskAnnotation with the corresponding fields populated

type APITaskAnnotationSettings

type APITaskAnnotationSettings struct {
	// Options for webhooks.
	FileTicketWebhook APIWebHook `bson:"web_hook" json:"web_hook"`
}

func (*APITaskAnnotationSettings) BuildFromService

func (ta *APITaskAnnotationSettings) BuildFromService(config evergreen.AnnotationsSettings)

func (*APITaskAnnotationSettings) RedactSecrets

func (ta *APITaskAnnotationSettings) RedactSecrets()

RedactSecrets replaces configured secrets with the standard redacted value.

func (*APITaskAnnotationSettings) ToService

type APITaskArgs

type APITaskArgs struct {
	IncludeProjectIdentifier bool
	IncludeAMI               bool
	IncludeArtifacts         bool
	LogURL                   string
	ParsleyLogURL            string
	ArtifactsCache           map[artifact.TaskIDAndExecution][]artifact.Entry
	LazyPresignArtifacts     bool
}

type APITaskCache

type APITaskCache struct {
	Id              string                  `json:"id"`
	DisplayName     string                  `json:"display_name"`
	Status          string                  `json:"status"`
	StatusDetails   apimodels.TaskEndDetail `json:"task_end_details"`
	StartTime       *time.Time              `json:"start_time" extensions:"x-nullable"`
	TimeTaken       time.Duration           `json:"time_taken" swaggertype:"primitive,integer"`
	TimeTakenMS     APIDuration             `json:"time_taken_ms"`
	Activated       bool                    `json:"activated"`
	FailedTestNames []string                `json:"failed_test_names,omitempty"`
}

type APITaskHostOverrides

type APITaskHostOverrides struct {
	ProviderAccount              *string  `json:"provider_account" extensions:"!x-nullable"`
	IAMInstanceProfileARN        *string  `json:"iam_instance_profile_arn" extensions:"!x-nullable"`
	SecurityGroupIDs             []string `json:"security_group_ids" extensions:"x-nullable"`
	SubnetID                     *string  `json:"subnet_id" extensions:"!x-nullable"`
	DoNotAssignPublicIPv4Address bool     `json:"do_not_assign_public_ipv4_address"`
}

APITaskHostOverrides is the API model for distro.TaskHostOverrides.

func (*APITaskHostOverrides) BuildFromService

func (a *APITaskHostOverrides) BuildFromService(o distro.TaskHostOverrides)

func (*APITaskHostOverrides) ToService

type APITaskLimitsConfig

type APITaskLimitsConfig struct {
	// MaxTasksPerVersion is the maximum number of tasks that a single version
	// can have.
	MaxTasksPerVersion *int `json:"max_tasks_per_version" extensions:"!x-nullable"`
	// MaxIncludesPerVersion is the maximum number of includes that a single
	// version can have.
	MaxIncludesPerVersion *int `json:"max_includes_per_version" extensions:"!x-nullable"`
	// MaxHourlyPatchTasks is the maximum number of patch tasks a single user can
	// schedule per hour.
	MaxHourlyPatchTasks *int `json:"max_hourly_patch_tasks" extensions:"!x-nullable"`
	// MaxPendingGeneratedTasks is the maximum number of tasks that can be created
	// by all generated task at once.
	MaxPendingGeneratedTasks *int `json:"max_pending_generated_tasks" extensions:"!x-nullable"`
	// MaxGenerateTaskJSONSize is the maximum size of a JSON file in MB that can be specified in the GenerateTasks command.
	MaxGenerateTaskJSONSize *int `json:"max_generate_task_json_size" extensions:"!x-nullable"`
	// MaxConcurrentLargeParserProjectTasks is the maximum number of tasks with parser projects stored in S3 that can be running at once.
	MaxConcurrentLargeParserProjectTasks *int `json:"max_concurrent_large_parser_project_tasks" extensions:"!x-nullable"`
	// MaxDegradedModeConcurrentLargeParserProjectTasks is the maximum number of tasks with parser projects stored in S3 that can be running at once during CPU degraded mode.
	MaxDegradedModeConcurrentLargeParserProjectTasks *int `json:"max_degraded_mode_concurrent_large_parser_project_tasks" extensions:"!x-nullable"`
	// MaxDegradedModeParserProjectSize is the maximum parser project size in MB during CPU degraded mode.
	MaxDegradedModeParserProjectSize *int `json:"max_degraded_mode_parser_project_size" extensions:"!x-nullable"`
	// MaxParserProjectSize is the maximum allowed size in MB for parser projects that are stored in S3.
	MaxParserProjectSize *int `json:"max_parser_project_size" extensions:"!x-nullable"`
	// MaxExecTimeoutSecs is the maximum number of seconds a task can run and set their timeout to.
	MaxExecTimeoutSecs *int `json:"max_exec_timeout_secs" extensions:"!x-nullable"`
	// MaxTaskExecution is the maximum task (zero based) execution number.
	MaxTaskExecution *int `json:"max_task_execution" extensions:"!x-nullable"`
	// MaxDailyAutomaticRestarts is the maximum number of times a project can automatically restart a task within a 24-hour period.
	MaxDailyAutomaticRestarts *int `json:"max_daily_automatic_restarts" extensions:"!x-nullable"`
	// MaxScheduledTasksPerDistro is the cap for the number of max tasks materialized into a distro's queue doc per pass.
	MaxScheduledTasksPerDistro *int `json:"max_scheduled_tasks_per_distro" extensions:"!x-nullable"`
	// TaskQueueAutoUnscheduleThreshold is the planned distro queue length at which the scheduler unschedules every patch task in the queue.
	TaskQueueAutoUnscheduleThreshold *int `json:"task_queue_auto_unschedule_threshold" extensions:"!x-nullable"`
	// HourlyPatchTaskOverrides sets a separate hourly patch task scheduling limit for individual projects or repos.
	HourlyPatchTaskOverrides []APIHourlyPatchTaskOverride `json:"hourly_patch_task_overrides" extensions:"!x-nullable"`
}

func (*APITaskLimitsConfig) BuildFromService

func (c *APITaskLimitsConfig) BuildFromService(h any) error

func (*APITaskLimitsConfig) ToService

func (c *APITaskLimitsConfig) ToService() (any, error)

type APITaskOwnershipSettings

type APITaskOwnershipSettings struct {
	// DefaultMothraTeam is the default Mothra team for tasks in this project.
	DefaultMothraTeam *string `json:"default_mothra_team,omitempty"`
	// DefaultMothraTeamForBreakingCommit is the default Mothra team for breaking commit tasks.
	DefaultMothraTeamForBreakingCommit *string `json:"default_mothra_team_for_breaking_commit,omitempty"`
	// GeneratedTaskValidationPrefix is the required prefix for generated task
	// tags. Only one of the task's tags needs to have this prefix.
	GeneratedTaskValidationPrefix *string `json:"generated_task_validation_prefix,omitempty"`
	// TrackGeneratedTaskTagValidation enables tracking generated tasks that
	// don't have the GeneratedTaskValidationPrefix.
	TrackGeneratedTaskTagValidation *bool `json:"track_generated_task_tag_validation,omitzero" extensions:"x-nullable"`
	// BlockTaskGenerationOnTagValidation enables failing generate.tasks if any
	// task it generates doesn't have GeneratedTaskValidationPrefix.
	BlockTaskGenerationOnTagValidation *bool `json:"block_task_generation_on_tag_validation,omitzero" extensions:"x-nullable"`
}

func (*APITaskOwnershipSettings) BuildFromService

func (to *APITaskOwnershipSettings) BuildFromService(settings model.TaskOwnershipSettings)

func (*APITaskOwnershipSettings) ToService

type APITaskQuarantineEntry

type APITaskQuarantineEntry struct {
	TaskName *string                  `json:"task_name" extensions:"!x-nullable"`
	Tests    []APITestQuarantineEntry `json:"tests" extensions:"!x-nullable"`
}

APITaskQuarantineEntry is the per-task quarantine view within a build variant.

type APITaskQueueItem

type APITaskQueueItem struct {
	Id                  *string     `json:"id"`
	DisplayName         *string     `json:"display_name"`
	BuildVariant        *string     `json:"build_variant"`
	RevisionOrderNumber int         `json:"order"`
	Requester           *string     `json:"requester"`
	Revision            *string     `json:"gitspec"`
	Project             *string     `json:"project"`
	ProjectIdentifier   *string     `json:"project_identifier,omitempty"`
	Version             *string     `json:"version"`
	Build               *string     `json:"build"`
	ExpectedDuration    APIDuration `json:"exp_dur"`
	Priority            int64       `json:"priority"`
	ActivatedBy         *string     `json:"activated_by"`
}

func (*APITaskQueueItem) BuildFromService

func (s *APITaskQueueItem) BuildFromService(tqi model.TaskQueueItem)

type APITaskReliability

type APITaskReliability struct {
	TaskName     *string `json:"task_name"`
	BuildVariant *string `json:"variant,omitempty"`
	Distro       *string `json:"distro,omitempty"`
	Date         *string `json:"date"`

	NumSuccess         int     `json:"num_success"`
	NumFailed          int     `json:"num_failed"`
	NumTotal           int     `json:"num_total"`
	NumTimeout         int     `json:"num_timeout"`
	NumTestFailed      int     `json:"num_test_failed"`
	NumSystemFailed    int     `json:"num_system_failed"`
	NumSetupFailed     int     `json:"num_setup_failed"`
	AvgDurationSuccess float64 `json:"avg_duration_success"`
	SuccessRate        float64 `json:"success_rate"`
}

APITaskReliability is the model to be returned by the API when querying task execution statistics

func (*APITaskReliability) BuildFromService

func (tr *APITaskReliability) BuildFromService(in reliability.TaskReliability)

BuildFromService converts a service level struct to an API level struct

func (*APITaskReliability) StartAtKey

func (tr *APITaskReliability) StartAtKey() string

StartAtKey returns the start_at key parameter that can be used to paginate and start at this element.

type APITaskSpecifier

type APITaskSpecifier struct {
	// Patch alias to run.
	PatchAlias *string `json:"patch_alias,omitempty"`
	// Regex matching tasks to run.
	TaskRegex *string `json:"task_regex,omitempty"`
	// Regex matching build variants to run.
	VariantRegex *string `json:"variant_regex,omitempty"`
}

func (*APITaskSpecifier) BuildFromService

func (ts *APITaskSpecifier) BuildFromService(def patch.TaskSpecifier)

func (*APITaskSpecifier) ToService

func (t *APITaskSpecifier) ToService() patch.TaskSpecifier

type APITaskStats

type APITaskStats struct {
	TaskName     *string `json:"task_name"`
	BuildVariant *string `json:"variant,omitempty"`
	Distro       *string `json:"distro,omitempty"`
	Date         *string `json:"date"`

	NumSuccess         int     `json:"num_success"`
	NumFailed          int     `json:"num_failed"`
	NumTotal           int     `json:"num_total"`
	NumTimeout         int     `json:"num_timeout"`
	NumTestFailed      int     `json:"num_test_failed"`
	NumSystemFailed    int     `json:"num_system_failed"`
	NumSetupFailed     int     `json:"num_setup_failed"`
	AvgDurationSuccess float64 `json:"avg_duration_success"`
}

APITaskStats is the model to be returned by the API when querying task execution statistics

func (*APITaskStats) BuildFromService

func (ts *APITaskStats) BuildFromService(v taskstats.TaskStats)

BuildFromService converts a service level struct to an API level struct.

func (*APITaskStats) StartAtKey

func (ts *APITaskStats) StartAtKey() string

StartAtKey returns the start_at key parameter that can be used to paginate and start at this element.

type APITest

type APITest struct {
	ID *string `json:"test_id" extensions:"!x-nullable"`
	// Identifier of the task this test is a part of
	TaskID    *string `json:"task_id" extensions:"!x-nullable"`
	Execution int     `json:"execution"`
	// Execution status of the test
	Status     *string `json:"status" extensions:"!x-nullable"`
	BaseStatus *string `json:"base_status,omitempty"`
	// Name of the test file that this test was run in
	TestFile *string `json:"test_file" extensions:"!x-nullable"`
	GroupID  *string `json:"group_id,omitempty"`
	// Object containing information about the logs for this test
	Logs TestLogs `json:"logs"`
	// Time that this test began execution
	StartTime *time.Time `json:"start_time" extensions:"!x-nullable"`
	// Time that this test stopped execution
	EndTime  *time.Time `json:"end_time" extensions:"!x-nullable"`
	Duration float64    `json:"duration"`
	// The exit code of the process that ran this test
	ExitCode int `json:"-"`
	// Whether this test is currently manually quarantined in the test selection service.
	IsManuallyQuarantined bool `json:"is_manually_quarantined"`
}

APITest contains the data to be returned whenever a test is used in the API.

func (*APITest) BuildFromService

func (at *APITest) BuildFromService(st any, args *APITestArgs) error

func (*APITest) ToService

func (at *APITest) ToService() (any, error)

type APITestArgs

type APITestArgs struct {
	EvergreenBaseURL string
	ParsleyLogURL    string
}

APITestArgs contains values used to populate generated test log links.

type APITestQuarantineEntry

type APITestQuarantineEntry struct {
	TestName              *string `json:"test_name" extensions:"!x-nullable"`
	IsManuallyQuarantined bool    `json:"is_manually_quarantined"`
}

APITestQuarantineEntry is the per-test quarantine view within a task.

type APITestSelectionConfig

type APITestSelectionConfig struct {
	URL *string `json:"url"`
}

func (*APITestSelectionConfig) BuildFromService

func (c *APITestSelectionConfig) BuildFromService(h any) error

func (*APITestSelectionConfig) ToService

func (c *APITestSelectionConfig) ToService() (any, error)

type APITestSelectionSettings

type APITestSelectionSettings struct {
	// Whether or not test selection features can be used.
	Allowed *bool `json:"allowed,omitzero" extensions:"x-nullable"`
	// Whether or not test selection is enabled by default for patch tasks.
	DefaultEnabled *bool `json:"default_enabled,omitzero" extensions:"x-nullable"`
	// Whether or not test selection is enabled by default for mainline commit
	// tasks.
	MainlineDefaultEnabled *bool `json:"mainline_default_enabled,omitzero" extensions:"x-nullable"`
	// Whether or not users must link at least one Jira ticket when manually
	// quarantining a test.
	QuarantineJiraTicketsRequired *bool `json:"quarantine_jira_tickets_required,omitzero" extensions:"x-nullable"`
}

func (*APITestSelectionSettings) BuildFromService

func (ts *APITestSelectionSettings) BuildFromService(settings model.TestSelectionSettings)

func (*APITestSelectionSettings) ToService

type APIToolchain

type APIToolchain struct {
	Name    *string `json:"name"`
	Path    *string `json:"path"`
	Version *string `json:"version"`
}

APIToolchain is the model to be returned by the API whenever toolchains are fetched.

func (*APIToolchain) BuildFromService

func (apiToolchain *APIToolchain) BuildFromService(toolchain thirdparty.Toolchain)

BuildFromService converts from service level thirdparty.Toolchain to an APIToolchain.

func (*APIToolchain) ToService

func (apiToolchain *APIToolchain) ToService() *thirdparty.Toolchain

ToService returns a service layer toolchain using the data from APIToolchain.

type APITracerSettings

type APITracerSettings struct {
	Enabled                   *bool   `json:"enabled"`
	CollectorEndpoint         *string `json:"collector_endpoint"`
	CollectorInternalEndpoint *string `json:"collector_internal_endpoint"`
	CollectorAPIKey           *string `json:"collector_api_key"`
	TraceURLTemplate          *string `json:"trace_url_template"`
}

func (*APITracerSettings) BuildFromService

func (c *APITracerSettings) BuildFromService(h any) error

func (*APITracerSettings) ToService

func (c *APITracerSettings) ToService() (any, error)

type APITriggerConfig

type APITriggerConfig struct {
	GenerateTaskDistro *string `json:"generate_distro"`
}

func (*APITriggerConfig) BuildFromService

func (c *APITriggerConfig) BuildFromService(h any) error

func (*APITriggerConfig) ToService

func (c *APITriggerConfig) ToService() (any, error)

type APITriggerDefinition

type APITriggerDefinition struct {
	// Identifier of project to watch.
	Project *string `json:"project" extensions:"!x-nullable"`
	// Trigger on build, task, or push.
	Level *string `json:"level" extensions:"!x-nullable"`
	// Identifier for the definition.
	DefinitionID *string `json:"definition_id" extensions:"!x-nullable"`
	// Build variant regex to match.
	BuildVariantRegex *string `json:"variant_regex" extensions:"!x-nullable"`
	// Task regex to match.
	TaskRegex *string `json:"task_regex" extensions:"!x-nullable"`
	// Task status to trigger for (or "*" for all).
	Status *string `json:"status" extensions:"!x-nullable"`
	// Number of days after commit when the trigger cannot run.
	DateCutoff *int `json:"date_cutoff" extensions:"x-nullable"`
	// Project configuration file for the trigger.
	ConfigFile *string `json:"config_file" extensions:"!x-nullable"`
	// Alias to run for the trigger.
	Alias *string `json:"alias" extensions:"!x-nullable"`
	// Deactivate downstream versions created by this trigger.
	UnscheduleDownstreamVersions *bool `json:"unschedule_downstream_versions" extensions:"!x-nullable"`
}

func (*APITriggerDefinition) BuildFromService

func (t *APITriggerDefinition) BuildFromService(triggerDef model.TriggerDefinition)

func (*APITriggerDefinition) ToService

type APITriggerModule

type APITriggerModule struct {
	Name     *string `json:"name" extensions:"!x-nullable"`
	Owner    *string `json:"owner" extensions:"!x-nullable"`
	Repo     *string `json:"repo" extensions:"!x-nullable"`
	Branch   *string `json:"branch" extensions:"!x-nullable"`
	Revision *string `json:"revision" extensions:"!x-nullable"`
}

type APIUIConfig

type APIUIConfig struct {
	Url                       *string         `json:"url"`
	UIv2Url                   *string         `json:"uiv2_url"`
	ParsleyUrl                *string         `json:"parsley_url"`
	LogUrl                    *string         `json:"log_url"`
	HttpListenAddr            *string         `json:"http_listen_addr"`
	Secret                    *string         `json:"secret"`
	DefaultProject            *string         `json:"default_project"`
	CacheTemplates            bool            `json:"cache_templates"`
	CsrfKey                   *string         `json:"csrf_key"`
	CORSOrigins               []string        `json:"cors_origins"`
	FileStreamingContentTypes []string        `json:"file_streaming_content_types"`
	LoginDomain               *string         `json:"login_domain"`
	UserVoice                 *string         `json:"userVoice"`
	BetaFeatures              APIBetaFeatures `json:"beta_features"`
	StagingEnvironment        *string         `json:"staging_environment"`
}

func (*APIUIConfig) BuildFromService

func (a *APIUIConfig) BuildFromService(h any) error

func (*APIUIConfig) ToService

func (a *APIUIConfig) ToService() (any, error)

type APIUiV2URL

type APIUiV2URL struct {
	UIv2Url *string `json:"uiv2_url"`
}

APIUiV2URL is a public structure representing the new UI url (e.g. Spruce)

type APIUseSpruceOptions

type APIUseSpruceOptions struct {
	SpruceV1 *bool `json:"spruce_v1" bson:"spruce_v1,omitempty" extensions:"!x-nullable"`
}

type APIUserProjectPermissions

type APIUserProjectPermissions struct {
	UserID               string                         `json:"user_id"`
	AvailablePermissions *APIAvailablePermissions       `json:"available_permissions,omitempty"`
	Projects             *[]APIProjectPermissionSummary `json:"projects,omitempty"`
	Distros              *[]APIDistroPermissionSummary  `json:"distros,omitempty"`
}

APIUserProjectPermissions is the response for GET /users/{user_id}/permission-details.

type APIUserSettings

type APIUserSettings struct {
	Timezone         *string                     `json:"timezone" extensions:"!x-nullable"`
	Region           *string                     `json:"region" extensions:"!x-nullable"`
	UseSpruceOptions *APIUseSpruceOptions        `json:"use_spruce_options" extensions:"!x-nullable"`
	GithubUser       *APIGithubUser              `json:"github_user" extensions:"!x-nullable"`
	SlackUsername    *string                     `json:"slack_username" extensions:"!x-nullable"`
	SlackMemberId    *string                     `json:"slack_member_id" extensions:"!x-nullable"`
	Notifications    *APINotificationPreferences `json:"notifications" extensions:"!x-nullable"`
	SpruceFeedback   *APIFeedbackSubmission      `json:"spruce_feedback" extensions:"x-nullable"`
	DateFormat       *string                     `json:"date_format" extensions:"!x-nullable"`
	TimeFormat       *string                     `json:"time_format" extensions:"!x-nullable"`
}

func (*APIUserSettings) BuildFromService

func (s *APIUserSettings) BuildFromService(settings user.UserSettings)

func (*APIUserSettings) ToService

func (s *APIUserSettings) ToService() (user.UserSettings, error)

type APIVariantQuarantineStatus

type APIVariantQuarantineStatus struct {
	ProjectIdentifier *string                  `json:"project_identifier" extensions:"!x-nullable"`
	BuildVariant      *string                  `json:"build_variant" extensions:"!x-nullable"`
	Tasks             []APITaskQuarantineEntry `json:"tasks" extensions:"!x-nullable"`
}

APIVariantQuarantineStatus represents the manual-quarantine status for every known test of every known task in a build variant.

func (*APIVariantQuarantineStatus) BuildFromService

BuildFromService populates the variant quarantine status from the given args. Tasks and tests are sorted alphabetically so output is stable.

type APIVariantTasks

type APIVariantTasks struct {
	Variant      *string          `extensions:"!x-nullable"`
	Tasks        []string         `extensions:"x-nullable"`
	DisplayTasks []APIDisplayTask `extensions:"x-nullable"`
}

func APIVariantTasksBuildFromService

func APIVariantTasksBuildFromService(v patch.VariantTasks) APIVariantTasks

type APIVersion

type APIVersion struct {
	Id *string `json:"version_id" extensions:"!x-nullable"`
	// Time that the version was first created
	CreateTime *time.Time `json:"create_time" extensions:"x-nullable"`
	// Time at which the version document was persisted in Evergreen. Will be null for versions created before this field was added.
	IngestTime *time.Time `json:"ingest_time,omitempty"`
	// Time at which tasks associated with this version started running
	StartTime *time.Time `json:"start_time" extensions:"x-nullable"`
	// Time at which tasks associated with this version finished running
	FinishTime *time.Time `json:"finish_time" extensions:"x-nullable"`
	// The version control identifier
	Revision          *string `json:"revision" extensions:"!x-nullable"`
	Order             int     `json:"order"`
	Project           *string `json:"project" extensions:"!x-nullable"`
	ProjectIdentifier *string `json:"project_identifier" extensions:"x-nullable"`
	// Author of the version
	Author *string `json:"author" extensions:"!x-nullable"`
	// Author ID is the Evergreen user ID associated with the version.
	AuthorID *string `json:"author_id" extensions:"!x-nullable"`
	// Email of the author of the version
	AuthorEmail *string `json:"author_email" extensions:"!x-nullable"`
	// Message left with the commit
	Message *string `json:"message" extensions:"!x-nullable"`
	// The status of the version (possible values are "created", "started", "success", or "failed")
	Status *string `json:"status" extensions:"!x-nullable"`
	// The github repository where the commit was made
	Repo *string `json:"repo" extensions:"!x-nullable"`
	// The version control branch where the commit was made
	Branch     *string        `json:"branch" extensions:"!x-nullable"`
	Parameters []APIParameter `json:"parameters" extensions:"x-nullable"`
	// List of documents of the associated build variant and the build id
	BuildVariantStatus []buildDetail `json:"build_variants_status" extensions:"x-nullable"`
	// Version created by one of "patch_request", "github_pull_request",
	// "gitter_request" (caused by git commit, aka the repotracker requester),
	// "trigger_request" (Project Trigger versions) , "github_merge_request" (GitHub merge queue), "ad_hoc" (periodic builds)
	Requester *string   `json:"requester" extensions:"!x-nullable"`
	Errors    []*string `json:"errors" extensions:"x-nullable"`
	// Will be null for versions created before this field was added.
	Activated *bool `json:"activated" extensions:"x-nullable"`
	Aborted   *bool `json:"aborted" extensions:"!x-nullable"`
	// The git tag that triggered this version, if any.
	TriggeredGitTag *APIGitTag `json:"triggered_by_git_tag" extensions:"x-nullable"`
	// Git tags that were pushed to this version.
	GitTags []APIGitTag `json:"git_tags" extensions:"x-nullable"`
	// The module commit that triggered this version. Only set for push level project triggers.
	TriggerModule *APITriggerModule `json:"trigger_module" extensions:"x-nullable"`
	// Indicates if the version was ignored due to only making changes to ignored files.
	Ignored *bool `json:"ignored" extensions:"!x-nullable"`
	// Aggregated actual cost of all tasks in the version
	Cost *cost.Cost `json:"cost,omitempty"`
	// Aggregated predicted cost of all tasks in the version
	PredictedCost *cost.Cost `json:"predicted_cost,omitempty"`
	// Aggregated S3 upload metrics across all tasks in the version
	S3Usage *APIVersionS3Usage `json:"s3_usage,omitempty"`
}

APIVersion is the model to be returned by the API whenever versions are fetched.

func (*APIVersion) BuildFromService

func (apiVersion *APIVersion) BuildFromService(ctx context.Context, v model.Version)

BuildFromService converts from service level structs to an APIVersion.

func (*APIVersion) IsPatchRequester

func (apiVersion *APIVersion) IsPatchRequester() bool

type APIVersionS3LogUsage

type APIVersionS3LogUsage struct {
	PutRequests int   `json:"put_requests,omitempty"`
	UploadBytes int64 `json:"upload_bytes,omitempty"`
}

APIVersionS3LogUsage holds aggregated S3 log upload metrics for a version.

type APIVersionS3Usage

type APIVersionS3Usage struct {
	Artifacts s3usage.ArtifactMetrics `json:"artifacts,omitempty"`
	Logs      APIVersionS3LogUsage    `json:"logs,omitempty"`
}

APIVersionS3Usage holds aggregated S3 upload metrics for a version. Logs only exposes puts and bytes since per-type breakdown is not aggregated at version level.

type APIVersions

type APIVersions struct {
	// whether or not the version element actually consists of multiple inactive
	// versions rolled up into one
	RolledUp bool `json:"rolled_up"`

	Versions []APIVersion `json:"versions"`
}

type APIVolume

type APIVolume struct {
	ID               *string    `json:"volume_id"`
	DisplayName      *string    `json:"display_name"`
	CreatedBy        *string    `json:"created_by"`
	Type             *string    `json:"type"`
	AvailabilityZone *string    `json:"zone"`
	Size             int        `json:"size"`
	Expiration       *time.Time `json:"expiration"`
	DeviceName       *string    `json:"device_name"`
	HostID           *string    `json:"host_id"`
	NoExpiration     bool       `json:"no_expiration"`
	HomeVolume       bool       `json:"home_volume"`
	CreationTime     *time.Time `json:"creation_time"`
	Migrating        bool       `json:"migrating"`
}

func (*APIVolume) BuildFromService

func (apiVolume *APIVolume) BuildFromService(v host.Volume)

func (*APIVolume) ToService

func (apiVolume *APIVolume) ToService() (host.Volume, error)

type APIVolumeModify

type APIVolumeModify struct {
	Action     *string    `json:"action"`
	HostID     *string    `json:"host_id"`
	Expiration *time.Time `json:"expiration"`
	NewName    *string    `json:"new_name"`
}

type APIWebHook

type APIWebHook struct {
	// Webhook endpoint
	Endpoint *string `bson:"endpoint" json:"endpoint" extensions:"x-nullable"`
	// Webhook secret
	Secret *string `bson:"secret" json:"secret" extensions:"x-nullable"`
}

type APIWebhookHeader

type APIWebhookHeader struct {
	Key   *string `json:"key" mapstructure:"key"`
	Value *string `json:"value" mapstructure:"value"`
}

func (*APIWebhookHeader) BuildFromService

func (s *APIWebhookHeader) BuildFromService(h event.WebhookHeader)

func (*APIWebhookHeader) ToService

func (s *APIWebhookHeader) ToService() event.WebhookHeader

type APIWebhookSubscriber

type APIWebhookSubscriber struct {
	URL        *string            `json:"url" mapstructure:"url"`
	Secret     *string            `json:"secret" mapstructure:"secret"`
	Retries    int                `json:"retries" mapstructure:"retries"`
	MinDelayMS int                `json:"min_delay_ms" mapstructure:"min_delay_ms"`
	TimeoutMS  int                `json:"timeout_ms" mapstructure:"timeout_ms"`
	Headers    []APIWebhookHeader `json:"headers" mapstructure:"headers"`
}

func (*APIWebhookSubscriber) BuildFromService

func (s *APIWebhookSubscriber) BuildFromService(h any) error

func (*APIWebhookSubscriber) ToService

type APIWorkstationConfig

type APIWorkstationConfig struct {
	// List of setup commands to run.
	SetupCommands []APIWorkstationSetupCommand `bson:"setup_commands" json:"setup_commands" extensions:"x-nullable"`
	// Git clone the project in the workstation.
	GitClone *bool `bson:"git_clone" json:"git_clone" extensions:"x-nullable"`
}

func (*APIWorkstationConfig) BuildFromService

func (c *APIWorkstationConfig) BuildFromService(config model.WorkstationConfig)

func (*APIWorkstationConfig) ToService

type APIWorkstationSetupCommand

type APIWorkstationSetupCommand struct {
	// Command to run in the workstation.
	Command *string `bson:"command" json:"command" extensions:"!x-nullable"`
	// Directory where the command runs.
	Directory *string `bson:"directory" json:"directory" extensions:"!x-nullable"`
}

type APIapiConfig

type APIapiConfig struct {
	HttpListenAddr *string `json:"http_listen_addr"`
	URL            *string `json:"url"`
	CorpURL        *string `json:"corp_url"`
}

func (*APIapiConfig) BuildFromService

func (a *APIapiConfig) BuildFromService(h any) error

func (*APIapiConfig) ToService

func (a *APIapiConfig) ToService() (any, error)

type AliasedType

type AliasedType string

type ApiTaskEndDetail

type ApiTaskEndDetail struct {
	// The status of the completed task.
	Status *string `json:"status" extensions:"!x-nullable"`
	// The method by which the task failed.
	Type *string `json:"type" extensions:"!x-nullable"`
	// Description of the final status of this task.
	Description *string `json:"desc" extensions:"!x-nullable"`
	// Command which indiciates the task failure.
	FailingCommand *string `json:"failing_command" extensions:"!x-nullable"`
	// PostErrored is true when the post command errored.
	PostErrored bool `json:"post_errored"`
	// FailureMetadataTags contains the metadata tags associated with the
	// command that caused the task to fail. These are not set if the task
	// succeeded.
	FailureMetadataTags []string `json:"failure_metadata_tags" extensions:"x-nullable"`
	// OtherFailingCommands contain information about commands that failed but
	// did not cause the task to fail.
	OtherFailingCommands []APIFailingCommand `json:"other_failing_commands,omitempty"`
	// Whether this task ended in a timeout.
	TimedOut            bool                      `json:"timed_out"`
	TimeoutType         *string                   `json:"timeout_type" extensions:"!x-nullable"`
	OOMTracker          APIOomTrackerInfo         `json:"oom_tracker_info"`
	TraceID             *string                   `json:"trace_id" extensions:"!x-nullable"`
	DiskDevices         []string                  `json:"disk_devices" extensions:"x-nullable"`
	ResourceConstraints APIResourceConstraintInfo `json:"resource_constraints"`
	// SystemFailureReason is a human-readable explanation of why the task's
	// host or agent was lost. It is only set for system failures.
	SystemFailureReason *string `json:"system_failure_reason" extensions:"x-nullable"`
}

func (*ApiTaskEndDetail) BuildFromService

func (at *ApiTaskEndDetail) BuildFromService(t apimodels.TaskEndDetail) error

func (*ApiTaskEndDetail) ToService

func (ad *ApiTaskEndDetail) ToService() apimodels.TaskEndDetail

type BuildList

type BuildList struct {
	BuildVariant string              `json:"build_variant"`
	Builds       map[string]APIBuild `json:"builds"`
}

type ChildPatch

type ChildPatch struct {
	Project *string `json:"project"`
	PatchID *string `json:"patch_id"`
	Status  *string `json:"status"`
}

type CopyDistroOpts

type CopyDistroOpts struct {
	DistroIdToCopy string
	NewDistroId    string
}

CopyDistroOpts is input for the data.CopyDistro function. It includes the ID

of the distro to be copied and the new distro's ID. This options struct doesn't really belong in this package according to Evergreen's conventions, and should instead go in rest/data. Unfortunately, it has to be here as a necessary hack for the GraphQL generated models. gqlgen introduced a breaking change in v0.17.50 that codegenerates ambiguous code that initializes a zero value variable called data, and that variable declaration shadows the rest/data import package name.

type CopyProjectOpts

type CopyProjectOpts struct {
	ProjectIdToCopy      string
	NewProjectIdentifier string
	NewProjectId         string
}

CopyProjectOpts is input for the data.CopyProject function.

This options struct doesn't really belong in this package according to Evergreen's conventions, and should instead go in rest/data. Unfortunately, it has to be here as a necessary hack for the GraphQL generated models. gqlgen introduced a breaking change in v0.17.50 that codegenerates ambiguous code that initializes a zero value variable called data, and that variable declaration shadows the rest/data import package name.

type DefinitionInfo

type DefinitionInfo struct {
	// The cron defined for the variant, if provided, as defined in the project settings
	CronBatchTime *string `json:"cron,omitempty"`
	// The batchtime defined for the variant, if provided, as defined in the project settings
	BatchTime *int `json:"batchtime,omitempty"`
}

type DistroInfo

type DistroInfo struct {
	// Unique Identifier of this distro. Can be used to fetch more informaiton about this distro
	Id *string `json:"distro_id" extensions:"!x-nullable"`
	// The service which provides this type of machine
	Provider             *string `json:"provider" extensions:"!x-nullable"`
	ImageId              *string `json:"image_id" extensions:"!x-nullable"`
	WorkDir              *string `json:"work_dir" extensions:"!x-nullable"`
	IsVirtualWorkstation bool    `json:"is_virtual_workstation"`
	User                 *string `json:"user" extensions:"!x-nullable"`
	IsWindows            bool    `json:"is_windows"`
	BootstrapMethod      *string `json:"bootstrap_method" extensions:"!x-nullable"`
}

type DownstreamTasks

type DownstreamTasks struct {
	Project      *string       `json:"project" extensions:"!x-nullable"`
	Tasks        []*string     `json:"tasks" extensions:"x-nullable"`
	VariantTasks []VariantTask `json:"variant_tasks" extensions:"!x-nullable"`
}

type GetProjectTaskExecutionReq

type GetProjectTaskExecutionReq struct {
	TaskName     string   `json:"task_name"`
	BuildVariant string   `json:"build_variant"`
	Requesters   []string `json:"requesters"`

	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

type GetProjectTasksOpts

type GetProjectTasksOpts struct {
	Limit        int      `json:"num_versions"`
	BuildVariant string   `json:"build_variant"`
	StartAt      int      `json:"start_at"`
	Requesters   []string `json:"requesters"`
}

type HostAPIEventData

type HostAPIEventData struct {
	AgentRevision      *string     `bson:"a_rev,omitempty" json:"agent_revision,omitempty"`
	AgentBuild         *string     `bson:"a_build,omitempty" json:"agent_build,omitempty"`
	JasperRevision     *string     `bson:"j_rev,omitempty" json:"jasper_revision,omitempty"`
	OldStatus          *string     `bson:"o_s,omitempty" json:"old_status,omitempty"`
	NewStatus          *string     `bson:"n_s,omitempty" json:"new_status,omitempty"`
	Logs               *string     `bson:"log,omitempty" json:"logs,omitempty"`
	Hostname           *string     `bson:"hn,omitempty" json:"hostname,omitempty"`
	ProvisioningMethod *string     `bson:"prov_method" json:"provisioning_method,omitempty"`
	TaskId             *string     `bson:"t_id,omitempty" json:"task_id,omitempty"`
	TaskPid            *string     `bson:"t_pid,omitempty" json:"task_pid,omitempty"`
	TaskStatus         *string     `bson:"t_st,omitempty" json:"task_status,omitempty"`
	Execution          *string     `bson:"execution,omitempty" json:"execution,omitempty"`
	MonitorOp          *string     `bson:"monitor_op,omitempty" json:"monitor,omitempty"`
	User               *string     `bson:"usr" json:"user,omitempty"`
	Successful         bool        `bson:"successful,omitempty" json:"successful"`
	Duration           APIDuration `bson:"duration,omitempty" json:"duration"`
}

func (*HostAPIEventData) BuildFromService

func (el *HostAPIEventData) BuildFromService(v *event.HostEventData)

type HostAPIEventLogEntry

type HostAPIEventLogEntry struct {
	ID           *string           `bson:"_id" json:"-"`
	ResourceType *string           `bson:"r_type,omitempty" json:"resource_type,omitempty"`
	ProcessedAt  *time.Time        `bson:"processed_at" json:"processed_at"`
	Timestamp    *time.Time        `bson:"ts" json:"timestamp"`
	ResourceId   *string           `bson:"r_id" json:"resource_id"`
	EventType    *string           `bson:"e_type" json:"event_type"`
	Data         *HostAPIEventData `bson:"data" json:"data"`
}

func (*HostAPIEventLogEntry) BuildFromService

func (el *HostAPIEventLogEntry) BuildFromService(entry event.EventLogEntry) error

type HostListResults

type HostListResults struct {
	Hosts   []APICreateHost
	Details []APIHostCreateDetail
}

type HostRequestOptions

type HostRequestOptions struct {
	DistroID              string     `json:"distro" yaml:"distro"`
	TaskID                string     `json:"task" yaml:"task"`
	Region                string     `json:"region" yaml:"region"`
	KeyName               string     `json:"keyname" yaml:"key"`
	UserData              string     `json:"userdata" yaml:"userdata_file"`
	SetupScript           string     `json:"setup_script" yaml:"setup_file"`
	UseProjectSetupScript bool       `json:"use_setup_script_path" yaml:"use_setup_script_path"`
	Tag                   string     `yaml:"tag"`
	InstanceTags          []host.Tag `json:"instance_tags" yaml:"instance_tags"`
	InstanceType          string     `json:"instance_type" yaml:"type"`
	NoExpiration          bool       `json:"no_expiration" yaml:"no-expire"`
	host.SleepScheduleOptions
	IsVirtualWorkstation bool       `json:"is_virtual_workstation" yaml:"is_virtual_workstation"`
	IsCluster            bool       `json:"is_cluster" yaml:"is_cluster"`
	HomeVolumeSize       int        `json:"home_volume_size" yaml:"home_volume_size"`
	HomeVolumeID         string     `json:"home_volume_id" yaml:"home_volume_id"`
	Expiration           *time.Time `json:"expiration" yaml:"expiration"`
	IsDebug              bool       `json:"is_debug" yaml:"is_debug"`
	SetupStepNumber      string     `json:"setup_step_number,omitempty" yaml:"setup_step_number,omitempty"`
}

HostRequestOptions is a struct that holds the format of a POST request to /hosts the yaml tags are used by hostCreate() when parsing the params from a file.

type LogLinks struct {
	// Link to logs containing merged copy of all other logs
	AllLogLink *string `json:"all_log" extensions:"x-nullable"`
	// Link to logs created by the task execution
	TaskLogLink *string `json:"task_log" extensions:"x-nullable"`
	// Link to logs created by the agent process
	AgentLogLink *string `json:"agent_log" extensions:"x-nullable"`
	// Link to logs created by the machine running the task
	SystemLogLink *string `json:"system_log" extensions:"x-nullable"`
}

type MockEmbedded

type MockEmbedded struct {
	One MockLayerOne
}

type MockLayerOne

type MockLayerOne struct {
	Two MockLayerTwo
}

type MockLayerTwo

type MockLayerTwo struct {
	SomeField *string
}

type MockModel

type MockModel struct {
	FieldId   string
	FieldInt1 int
	FieldInt2 int
	FieldMap  map[string]string

	FieldStruct *MockSubStruct
}

func (*MockModel) BuildFromService

func (m *MockModel) BuildFromService(in any) error

func (*MockModel) ToService

func (m *MockModel) ToService() (any, error)

type MockScalars

type MockScalars struct {
	TimeType time.Time
	MapType  map[string]any
	AnyType  any
}

type MockSubStruct

type MockSubStruct struct {
	SubInt int
}

type MockTypes

type MockTypes struct {
	BoolType       bool
	BoolPtrType    *bool
	IntType        int
	IntPtrType     *int
	StringType     string
	StringPtrType  *string
	Uint64Type     uint64
	Uint64PtrType  *uint64
	Float64Type    float64
	Float64PtrType *float64
	RuneType       rune
	RunePtrType    *rune
}

type Model

type Model interface {
	BuildFromService(any) error
	ToService() (any, error)
}

Model defines how an API resource which will be both taken from requests and turned into service layer models and taken from service layer models and turned into API models to be returned. Unless there's a specific need to implement it, in general it is neither necessary nor recommended to implement this model due to its reliance on interface{}; instead, pass in and return the actual service model that corresponds to the REST model.

func AdminDbToRestModel

func AdminDbToRestModel(in evergreen.ConfigSection) (Model, error)

type PanicReport

type PanicReport struct {
	Version                 string
	VersionAsNumber         int64
	AgentVersion            string
	BuildRevision           string
	CurrentWorkingDirectory string
	ExecutablePath          string
	Arguments               []string
	OperatingSystem         string
	Architecture            string
	ConfigFilePath          string
	ConfigAbsFilePath       string
	StartTime, EndTime      time.Time
	User                    string
	Project                 string

	Panic any
}

type ProjectTaskExecutionResp

type ProjectTaskExecutionResp struct {
	NumCompleted int `json:"num_completed"`
}

type RestartResponse

type RestartResponse struct {
	ItemsRestarted []string `json:"items_restarted"`
	ItemsErrored   []string `json:"items_errored"`
}

RestartTasksResponse is the response model returned from the /admin/restart route

func (*RestartResponse) BuildFromService

func (rtr *RestartResponse) BuildFromService(h any) error

BuildFromService builds a model from the service layer

func (*RestartResponse) ToService

func (rtr *RestartResponse) ToService() (any, error)

ToService is not implemented for /admin/restart

type SelectTestsRequest

type SelectTestsRequest struct {
	// Project is the project identifier.
	Project string `json:"project_id"`
	// Requester is the Evergreen requester type.
	Requester string `json:"requester"`
	// BuildVariant is the Evergreen build variant.
	BuildVariant string `json:"build_variant"`
	// TaskID is the Evergreen task ID.
	TaskID string `json:"task_id"`
	// TaskName is the Evergreen task name.
	TaskName string `json:"task_name"`
	// DisplayTaskName is the display task's name when the task is an execution
	// task of a display task. It is optional.
	DisplayTaskName string `json:"display_task_name,omitempty"`
	// Tests is a list of test names.
	Tests []string `json:"tests" extensions:"x-nullable"`
	// Strategies is the optional list of test selection strategies to use.
	Strategies []string `json:"strategies" extensions:"x-nullable"`
}

SelectTestsRequest represents a request to return a filtered set of tests to run. It deliberately includes information that could be looked up in the database in order to bypass database lookups. This allows Evergreen to pass this information directly to the test selector.

func (*SelectTestsRequest) UnmarshalJSON

func (s *SelectTestsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts either "project_id" (preferred) or "project" (legacy) for the Project field. evergreen.py <=3.15.0 sends "project" on the wire, and resmoke pins that library, so we need to keep accepting it until those callers migrate.

type StartAtKey

type StartAtKey struct {
	// contains filtered or unexported fields
}

StartAtKey is a struct used to build the start_at key parameter for pagination.

func (StartAtKey) String

func (s StartAtKey) String() string

type StructWithAliased

type StructWithAliased struct {
	Foo AliasedType
	Bar string
}

type TaskAPIEventLogEntry

type TaskAPIEventLogEntry struct {
	ID           *string        `bson:"_id" json:"-"`
	ResourceType *string        `bson:"r_type,omitempty" json:"resource_type,omitempty"`
	ProcessedAt  *time.Time     `bson:"processed_at" json:"processed_at"`
	Timestamp    *time.Time     `bson:"ts" json:"timestamp"`
	ResourceId   *string        `bson:"r_id" json:"resource_id"`
	EventType    *string        `bson:"e_type" json:"event_type"`
	Data         *TaskEventData `bson:"data" json:"data"`
}

func (*TaskAPIEventLogEntry) BuildFromService

func (el *TaskAPIEventLogEntry) BuildFromService(ctx context.Context, v event.EventLogEntry) error

type TaskEventData

type TaskEventData struct {
	Execution int        `bson:"execution" json:"execution"`
	HostId    *string    `bson:"h_id,omitempty" json:"host_id,omitempty"`
	UserId    *string    `bson:"u_id,omitempty" json:"user_id,omitempty"`
	Status    *string    `bson:"s,omitempty" json:"status,omitempty"`
	JiraIssue *string    `bson:"jira,omitempty" json:"jira,omitempty"`
	JiraLink  *string    `bson:"jira_link,omitempty" json:"jira_link,omitempty"`
	BlockedOn *string    `bson:"blocked_on,omitempty" json:"blocked_on,omitempty"`
	Timestamp *time.Time `bson:"ts,omitempty" json:"timestamp,omitempty"`
	Priority  int64      `bson:"pri,omitempty" json:"priority,omitempty"`
}

func (*TaskEventData) BuildFromService

func (el *TaskEventData) BuildFromService(ctx context.Context, v *event.TaskEventData) error

type TaskInfo

type TaskInfo struct {
	// Unique Identifier of this task. Can be used to fetch more informaiton about this task
	Id *string `json:"task_id" extensions:"x-nullable"`
	// The name of this task
	Name *string `json:"name" extensions:"x-nullable"`
	// Time that this task was dispatched to this host
	DispatchTime *time.Time `json:"dispatch_time" extensions:"x-nullable"`
	// Unique identifier for the version of the project that this task is run as part of
	VersionId *string `json:"version_id" extensions:"x-nullable"`
	// Unique identifier for the build of the project that this task is run as part of
	BuildId   *string    `json:"build_id" extensions:"x-nullable"`
	StartTime *time.Time `json:"start_time" extensions:"x-nullable"`
}

type TestLogs

type TestLogs struct {
	// URL where the log can be fetched
	URL *string `json:"url" extensions:"!x-nullable"`
	// URL of the unprocessed version of the logs file for this test
	URLRaw     *string `json:"url_raw" extensions:"!x-nullable"`
	URLParsley *string `json:"url_parsley,omitempty"`
	// Line number in the log file corresponding to information about this test
	LineNum int `json:"line_num"`
	// Test name as represented in the logging backend
	TestName      *string `json:"log_test_name" extensions:"!x-nullable"`
	RenderingType *string `json:"rendering_type" extensions:"x-nullable"`
	Version       int32   `json:"version"`
	// Logs to merge (used for resmoke test results that have multiple log files).
	LogsToMerge []string `json:"logs_to_merge,omitempty"`
}

TestLogs is a struct for storing the information about logs that will be written out as part of an APITest.

type UIProjectFields

type UIProjectFields struct {
	Id          string `json:"id"`
	Identifier  string `json:"identifier"`
	DisplayName string `json:"display_name"`
	Repo        string `json:"repo_name"`
	Owner       string `json:"owner_name"`
}

publicProjectFields are the fields needed by the UI on base_angular and the menu

type VariantQuarantineStatusBuildArgs

type VariantQuarantineStatusBuildArgs struct {
	ProjectIdentifier string
	BuildVariant      string
	Tasks             map[string]map[string]bool
}

type VariantTask

type VariantTask struct {
	// Name of build variant
	Name *string `json:"name" extensions:"!x-nullable"`
	// All tasks available to run on this build variant
	Tasks []*string `json:"tasks" extensions:"!x-nullable"`
}

type VersionVariantData

type VersionVariantData struct {
	Rows          map[string]BuildList `json:"rows"`
	Versions      []APIVersions        `json:"versions"`
	BuildVariants []string             `json:"build_variants"`
}

type VolumeModifyOptions

type VolumeModifyOptions struct {
	NewName       string    `json:"new_name"`
	Size          int32     `json:"size"`
	Expiration    time.Time `json:"expiration"`
	NoExpiration  bool      `json:"no_expiration"`
	HasExpiration bool      `json:"has_expiration"`
}

type VolumePostRequest

type VolumePostRequest struct {
	Type             string `json:"type"`
	Size             int    `json:"size"`
	AvailabilityZone string `json:"zone"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址