Documentation ¶
Overview ¶
Package validator checks that project configuration files and distro settings are correct.
Index ¶
- Constants
- func CheckProjectConfigurationIsValid(ctx context.Context, settings *evergreen.Settings, project *model.Project, ...) error
- func ValidationErrorsToString(ves ValidationErrors) string
- type ValidationError
- type ValidationErrorLevel
- type ValidationErrors
- func CheckAliasWarnings(project *model.Project, aliases model.ProjectAliases) ValidationErrors
- func CheckDistro(ctx context.Context, d *distro.Distro, s *evergreen.Settings, newDistro bool) (ValidationErrors, error)
- func CheckPatchedProjectConfigErrors(patchedProjectConfig string) ValidationErrors
- func CheckProject(ctx context.Context, project *model.Project, config *model.ProjectConfig, ...) ValidationErrors
- func CheckProjectConfigErrors(projectConfig *model.ProjectConfig) ValidationErrors
- func CheckProjectErrors(ctx context.Context, project *model.Project, includeLong bool) ValidationErrors
- func CheckProjectSettings(ctx context.Context, settings *evergreen.Settings, p *model.Project, ...) ValidationErrors
- func CheckProjectWarnings(project *model.Project) ValidationErrors
- func (v ValidationErrors) Annotate(key string, value interface{}) error
- func (v ValidationErrors) AtLevel(level ValidationErrorLevel) ValidationErrors
- func (v ValidationErrors) Has(level ValidationErrorLevel) bool
- func (v ValidationErrors) Loggable() bool
- func (v ValidationErrors) Priority() level.Priority
- func (v ValidationErrors) Raw() interface{}
- func (v ValidationErrors) SetPriority(_ level.Priority) error
- func (v ValidationErrors) String() string
- type ValidationInput
Constants ¶
const ( Error ValidationErrorLevel = iota Warning Notice EC2HostCreateTotalLimit = 1000 DockerHostCreateTotalLimit = 200 HostCreateLimitPerTask = 3 )
Variables ¶
This section is empty.
Functions ¶
func CheckProjectConfigurationIsValid ¶
func CheckProjectConfigurationIsValid(ctx context.Context, settings *evergreen.Settings, project *model.Project, pref *model.ProjectRef) error
CheckProjectConfigurationIsValid checks if the project configuration has errors
func ValidationErrorsToString ¶
func ValidationErrorsToString(ves ValidationErrors) string
Types ¶
type ValidationError ¶
type ValidationError struct { Level ValidationErrorLevel `json:"level"` Message string `json:"message"` }
func (ValidationError) Error ¶
func (vr ValidationError) Error() string
type ValidationErrorLevel ¶
type ValidationErrorLevel int64
func (ValidationErrorLevel) String ¶
func (vel ValidationErrorLevel) String() string
type ValidationErrors ¶
type ValidationErrors []ValidationError
func CheckAliasWarnings ¶
func CheckAliasWarnings(project *model.Project, aliases model.ProjectAliases) ValidationErrors
CheckAliasWarnings returns warnings related to the definition of tasks/variants matching the given aliases.
func CheckDistro ¶
func CheckDistro(ctx context.Context, d *distro.Distro, s *evergreen.Settings, newDistro bool) (ValidationErrors, error)
CheckDistro checks if the distro configuration syntax is valid. Returns a slice of any validation errors found.
func CheckPatchedProjectConfigErrors ¶
func CheckPatchedProjectConfigErrors(patchedProjectConfig string) ValidationErrors
CheckPatchedProjectConfigErrors returns validation errors for the given patched project config.
func CheckProject ¶
func CheckProject(ctx context.Context, project *model.Project, config *model.ProjectConfig, ref *model.ProjectRef, includeLong bool, projectRefId string, projectRefErr error) ValidationErrors
CheckProject calls the validating logic for a Project's configuration. That is, ProjectErrors, ProjectWarnings, ProjectConfigErrors, ProjectSettings, and AliasWarnings. If a respective item is nil, it will not check it (e.g. if the config is nil, it does not check the config). projectRefId is used to determine if there is a project specified and projectRefErr is used to determine if there was a problem retrieving the ref; both output different warnings for the project.
func CheckProjectConfigErrors ¶
func CheckProjectConfigErrors(projectConfig *model.ProjectConfig) ValidationErrors
CheckProjectConfigErrors verifies that the project configuration syntax is valid
func CheckProjectErrors ¶
func CheckProjectErrors(ctx context.Context, project *model.Project, includeLong bool) ValidationErrors
CheckProjectErrors returns errors about the project configuration syntax
func CheckProjectSettings ¶
func CheckProjectSettings(ctx context.Context, settings *evergreen.Settings, p *model.Project, ref *model.ProjectRef, isConfigDefined bool) ValidationErrors
CheckProjectSettings checks the project configuration against the project settings.
func CheckProjectWarnings ¶
func CheckProjectWarnings(project *model.Project) ValidationErrors
CheckProjectWarnings returns warnings about the project configuration semantics
func (ValidationErrors) Annotate ¶
func (v ValidationErrors) Annotate(key string, value interface{}) error
func (ValidationErrors) AtLevel ¶
func (v ValidationErrors) AtLevel(level ValidationErrorLevel) ValidationErrors
AtLevel returns all validation errors that match the given level.
func (ValidationErrors) Has ¶
func (v ValidationErrors) Has(level ValidationErrorLevel) bool
Has returns if any of the errors are at the given level.
func (ValidationErrors) Loggable ¶
func (v ValidationErrors) Loggable() bool
func (ValidationErrors) Priority ¶
func (v ValidationErrors) Priority() level.Priority
func (ValidationErrors) Raw ¶
func (v ValidationErrors) Raw() interface{}
func (ValidationErrors) SetPriority ¶
func (v ValidationErrors) SetPriority(_ level.Priority) error
func (ValidationErrors) String ¶
func (v ValidationErrors) String() string