Documentation ¶
Index ¶
- Variables
- func LoadSettings(opts *Options) (*model.CLISettings, error)
- func WriteSettings(s *model.CLISettings, opts *Options) error
- func WriteToFile(body io.ReadCloser, filepath string) error
- type APIClient
- func (ac *APIClient) CancelPatch(patchId string) error
- func (ac *APIClient) CheckUpdates() (*evergreen.ClientConfig, error)
- func (ac *APIClient) DeletePatchModule(patchId, module string) error
- func (ac *APIClient) FinalizePatch(patchId string) error
- func (ac *APIClient) GetAverageSchedulerStats(granularity, daysBack int, distroId string, csv bool) (io.ReadCloser, error)
- func (ac *APIClient) GetConfig(versionId string) (*model.Project, error)
- func (ac *APIClient) GetHostUtilizationStats(granularity, daysBack int, csv bool) (io.ReadCloser, error)
- func (ac *APIClient) GetLastGreen(project string, variants []string) (*version.Version, error)
- func (ac *APIClient) GetOptimalMakespans(numberBuilds int, csv bool) (io.ReadCloser, error)
- func (ac *APIClient) GetPatch(patchId string) (*service.RestPatch, error)
- func (ac *APIClient) GetPatchModules(patchId, projectId string) ([]string, error)
- func (ac *APIClient) GetPatchedConfig(patchId string) (*model.Project, error)
- func (ac *APIClient) GetPatches(n int) ([]patch.Patch, error)
- func (ac *APIClient) GetProjectRef(projectId string) (*model.ProjectRef, error)
- func (ac *APIClient) GetTask(taskId string) (*service.RestTask, error)
- func (ac *APIClient) GetTestHistory(project, queryParams string, isCSV bool) (io.ReadCloser, error)
- func (ac *APIClient) ListProjects() ([]model.ProjectRef, error)
- func (ac *APIClient) ListTasks(project string) ([]model.ProjectTask, error)
- func (ac *APIClient) ListVariants(project string) ([]model.BuildVariant, error)
- func (ac *APIClient) PutPatch(incomingPatch patchSubmission) (*patch.Patch, error)
- func (ac *APIClient) UpdatePatchModule(patchId, module, patch, base string) error
- func (ac *APIClient) ValidateLocalConfig(data []byte) ([]validator.ValidationError, error)
- type APIError
- type CancelPatchCommand
- type EvaluateCommand
- type ExportCommand
- type FetchCommand
- type FinalizePatchCommand
- type GetUpdateCommand
- type LastGreenCommand
- type ListCommand
- type ListPatchesCommand
- type Options
- type PatchCommand
- type PatchCommandParams
- type PatchFileCommand
- type RemoveModuleCommand
- type SetModuleCommand
- type TestHistoryCommand
- type ValidateCommand
- type VersionCommand
Constants ¶
This section is empty.
Variables ¶
var ( GranularityDays = "day" GranularityMinutes = "minute" GranularitySeconds = "second" GranularityHours = "hour" HostUtilizationStat = "host" AverageScheduledToStart = "avg" OptimalMakespanStat = "makespan" )
Functions ¶
func LoadSettings ¶
func LoadSettings(opts *Options) (*model.CLISettings, error)
LoadSettings attempts to load the settings file
func WriteSettings ¶
func WriteSettings(s *model.CLISettings, opts *Options) error
func WriteToFile ¶
func WriteToFile(body io.ReadCloser, filepath string) error
WriteToFile takes in a body and filepath and writes out the data in the body
Types ¶
type APIClient ¶
type APIClient struct { APIRoot string User string APIKey string // contains filtered or unexported fields }
APIClient manages requests to the API server endpoints, and unmarshaling the results into usable structures.
func (*APIClient) CancelPatch ¶
func (*APIClient) CheckUpdates ¶
func (ac *APIClient) CheckUpdates() (*evergreen.ClientConfig, error)
CheckUpdates fetches information about available updates to client binaries from the server.
func (*APIClient) DeletePatchModule ¶
DeletePatchModule makes a request to the API server to delete the given module from a patch
func (*APIClient) FinalizePatch ¶
func (*APIClient) GetAverageSchedulerStats ¶
func (ac *APIClient) GetAverageSchedulerStats(granularity, daysBack int, distroId string, csv bool) (io.ReadCloser, error)
GetAverageSchedulerStats takes in an integer granularity, which is in seconds, the number of days back, and a distro id and makes a REST API call to get host utilization statistics.
func (*APIClient) GetConfig ¶
GetVersionConfig fetches the config requests project details from the API server for a given project ID.
func (*APIClient) GetHostUtilizationStats ¶
func (ac *APIClient) GetHostUtilizationStats(granularity, daysBack int, csv bool) (io.ReadCloser, error)
GetHostUtilizationStats takes in an integer granularity, which is in seconds, and the number of days back and makes a REST API call to get host utilization statistics.
func (*APIClient) GetLastGreen ¶
GetLastGreen returns the most recent successful version for the given project and variants.
func (*APIClient) GetOptimalMakespans ¶
GetOptimalMakespan takes in an integer granularity, which is in seconds, and the number of days back and makes a REST API call to get the optimal and actual makespan for builds going back however many days.
func (*APIClient) GetPatchModules ¶
GetPatchModules retrieves a list of modules available for a given patch.
func (*APIClient) GetPatchedConfig ¶
GetPatchedConfig takes in patch id and returns the patched project config.
func (*APIClient) GetPatches ¶
GetPatches requests a list of the user's patches from the API and returns them as a list
func (*APIClient) GetProjectRef ¶
func (ac *APIClient) GetProjectRef(projectId string) (*model.ProjectRef, error)
GetProjectRef requests project details from the API server for a given project ID.
func (*APIClient) GetTestHistory ¶
GetTestHistory takes in a project identifier, the url query parameter string, and a csv flag and returns the body of the response of the test_history api endpoint.
func (*APIClient) ListProjects ¶
func (ac *APIClient) ListProjects() ([]model.ProjectRef, error)
func (*APIClient) ListTasks ¶
func (ac *APIClient) ListTasks(project string) ([]model.ProjectTask, error)
func (*APIClient) ListVariants ¶
func (ac *APIClient) ListVariants(project string) ([]model.BuildVariant, error)
func (*APIClient) PutPatch ¶
PutPatch submits a new patch for the given project to the API server. If successful, returns the patch object itself.
func (*APIClient) UpdatePatchModule ¶
UpdatePatchModule makes a request to the API server to set a module patch on the given patch ID.
func (*APIClient) ValidateLocalConfig ¶
func (ac *APIClient) ValidateLocalConfig(data []byte) ([]validator.ValidationError, error)
ValidateLocalConfig validates the local project config with the server
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError is an implementation of error for reporting unexpected results from API calls.
func NewAPIError ¶
NewAPIError creates an APIError by reading the body of the response and its status code.
type CancelPatchCommand ¶
type CancelPatchCommand struct { GlobalOpts *Options `no-flag:"true"` PatchId string `short:"i" description:"id of the patch to modify" required:"true"` }
CancelPatchCommand is used to cancel a patch.
func (*CancelPatchCommand) Execute ¶
func (cpc *CancelPatchCommand) Execute(_ []string) error
type EvaluateCommand ¶
type EvaluateCommand struct { Tasks bool `short:"t" long:"tasks" description:"only show task and function definitions"` Variants bool `short:"v" long:"variants" description:"only show variant definitions"` }
EvaluateCommand reads in a project config, expanding tags and matrix definitions, then prints the expanded definitions back out as yaml.
func (*EvaluateCommand) Execute ¶
func (ec *EvaluateCommand) Execute(args []string) error
type ExportCommand ¶
type ExportCommand struct { GlobalOpts *Options `no-flag:"true"` JSON bool `long:"json" description:"set the format to export to json"` Granularity string `long:"granularity" description:"set the granularity, default hour, options are 'second', 'minute', 'hour'"` Days int `long:"days" description:"set the number of days, default 1, max of 30 days back"` StatsType string `` /* 172-byte string literal not displayed */ DistroId string `long:"distro" description:"distro id - required for average scheduled to start times"` Number int `long:"number" description:"set the number of revisions (for getting build makespan), default 100"` Filepath string `long:"filepath" description:"path to directory where csv file is to be saved"` }
ExportCommand is used to export statistics
func (*ExportCommand) Execute ¶
func (ec *ExportCommand) Execute(_ []string) error
type FetchCommand ¶
type FetchCommand struct { GlobalOpts *Options `no-flag:"true"` Source bool `long:"source" description:"clones the source for the given task"` Artifacts bool `long:"artifacts" description:"fetch artifacts for the task and all its recursive dependents"` Shallow bool `long:"shallow" description:"don't recursively download artifacts from dependency tasks"` NoPatch bool `long:"no-patch" description:"when using --source with a patch task, skip applying the patch"` Dir string `long:"dir" description:"root directory to fetch artifacts into. defaults to current working directory"` TaskId string `short:"t" long:"task" description:"task associated with the data to fetch" required:"true"` }
FetchCommand is used to fetch the source or artifacts associated with a task.
func (*FetchCommand) Execute ¶
func (fc *FetchCommand) Execute(_ []string) error
FetchCommand allows the user to download the artifacts for a task (and optionally its dependencies), clone the source that a task was derived from, or both.
type FinalizePatchCommand ¶
type FinalizePatchCommand struct { GlobalOpts *Options `no-flag:"true"` PatchId string `short:"i" description:"id of the patch to modify" required:"true"` }
FinalizePatchCommand is used to finalize a patch, allowing it to be scheduled.
func (*FinalizePatchCommand) Execute ¶
func (fpc *FinalizePatchCommand) Execute(_ []string) error
type GetUpdateCommand ¶
type GetUpdateCommand struct { GlobalOpts *Options `no-flag:"true"` Install bool `long:"install" description:"after downloading update, overwrite old binary with new one"` }
GetUpdateCommand attempts to fetch the latest version of the client binary and install it over the current one.
func (*GetUpdateCommand) Execute ¶
func (uc *GetUpdateCommand) Execute(_ []string) error
type LastGreenCommand ¶
type LastGreenCommand struct { GlobalOpts *Options `no-flag:"true"` Project string `short:"p" long:"project" description:"project to search" required:"true"` Variants []string `short:"v" long:"variants" description:"variant that must be passing" required:"true"` }
LastGreenCommand contains parameters for the finding a project's most recent passing version.
func (*LastGreenCommand) Execute ¶
func (lgc *LastGreenCommand) Execute(_ []string) error
type ListCommand ¶
type ListCommand struct { GlobalOpts *Options `no-flag:"true"` Project string `short:"p" long:"project" description:"project whose variants or tasks should be listed (use with --variants/--tasks)"` File string `` /* 126-byte string literal not displayed */ Projects bool `long:"projects" description:"list all available projects"` Variants bool `long:"variants" description:"list all variants for a project"` Tasks bool `long:"tasks" description:"list all tasks for a project"` }
func (*ListCommand) Execute ¶
func (lc *ListCommand) Execute(_ []string) error
type ListPatchesCommand ¶
type ListPatchesCommand struct { GlobalOpts *Options `no-flag:"true"` Variants []string `short:"v" long:"variants" description:"variants to run the patch on. may be specified multiple times, or use the value 'all'"` PatchId string `short:"i" description:"show details for only the patch with this ID"` ShowSummary bool `short:"s" long:"show-summary" description:"show a summary of the diff for each patch"` Number *int `short:"n" long:"number" description:"number of patches to show (0 for all patches)"` }
ListPatchesCommand is used to list a user's existing patches.
func (*ListPatchesCommand) Execute ¶
func (lpc *ListPatchesCommand) Execute(_ []string) error
type Options ¶
type Options struct {
ConfFile string `short:"c" long:"config" description:"path to config file (defaults to ~/.evergreen.yml)"`
}
type PatchCommand ¶
type PatchCommand struct {
PatchCommandParams
}
PatchCommand is used to submit a new patch to the API server.
func (*PatchCommand) Execute ¶
func (pc *PatchCommand) Execute(args []string) error
type PatchCommandParams ¶
type PatchCommandParams struct { GlobalOpts *Options `no-flag:"true"` Project string `short:"p" long:"project" description:"project to submit patch for"` Variants []string `short:"v" long:"variants"` Tasks []string `short:"t" long:"tasks"` SkipConfirm bool `short:"y" long:"yes" description:"skip confirmation text"` Description string `short:"d" long:"description" description:"description of patch (optional)"` Finalize bool `short:"f" long:"finalize" description:"schedule tasks immediately"` Large bool `long:"large" description:"enable submitting larger patches (>16MB)"` }
PatchCommandParams contains parameters common to PatchCommand and PatchFileCommand
type PatchFileCommand ¶
type PatchFileCommand struct { PatchCommandParams DiffFile string `long:"diff-file" description:"file containing the diff for the patch"` Base string `short:"b" long:"base" description:"githash of base"` }
PatchFileCommand is used to submit a new patch to the API server using a diff file.
func (*PatchFileCommand) Execute ¶
func (pfc *PatchFileCommand) Execute(_ []string) error
type RemoveModuleCommand ¶
type RemoveModuleCommand struct { GlobalOpts *Options `no-flag:"true"` Module string `short:"m" long:"module" description:"name of the module to remove from patch" required:"true" ` PatchId string `short:"i" description:"name of the module to remove from patch" required:"true" ` }
RemoveModuleCommand removes module information from an existing patch.
func (*RemoveModuleCommand) Execute ¶
func (rmc *RemoveModuleCommand) Execute(_ []string) error
type SetModuleCommand ¶
type SetModuleCommand struct { GlobalOpts *Options `no-flag:"true"` Module string `short:"m" long:"module" description:"name of the module to set patch for"` PatchId string `short:"i" description:"id of the patch to modify" required:"true" ` Project string `short:"p" long:"project" description:"project name"` SkipConfirm bool `short:"y" long:"yes" description:"skip confirmation text"` Large bool `long:"large" description:"enable submitting larger patches (>16MB)"` }
SetModuleCommand adds or updates a module in an existing patch.
func (*SetModuleCommand) Execute ¶
func (smc *SetModuleCommand) Execute(args []string) error
type TestHistoryCommand ¶
type TestHistoryCommand struct { GlobalOpts *Options `no-flag:"true"` Project string `long:"project" short:"p" description:"project identifier, defaults to user's default project"` Tasks []string `long:"task" description:"task name"` Tests []string `long:"test" description:"test name"` Variants []string `long:"variant" short:"v" description:"variant name"` TaskStatuses []string `long:"task-status" description:"task status, either fail, pass, sysfail, or timeout "` TestStatuses []string `long:"test-status" description:"test status, either fail, silentfail, pass, skip, or timeout "` BeforeRevision string `long:"before-revision" description:"find tests that finished before a full revision hash (40 characters) (inclusive)"` AfterRevision string `long:"after-revision" description:"find tests that finished after a full revision hash (40 characters) (exclusive)"` // TODO EVG-1540 for user specific timezones. BeforeDate string `long:"before-date" description:"find tests that finished before a date in format YYYY-MM-DDTHH:MM:SS in UTC"` AfterDate string `long:"after-date" description:"find tests that finish after a date in format YYYY-MM-DDTHH:MM:SS in UTC"` Earliest bool `long:"earliest" description:"sort test history from the earliest revisions to latest"` Filepath string `long:"filepath" description:"path to directory where file is to be saved, only used with json or csv format"` Format string `long:"format" description:"format to export test history, options are 'json', 'csv', 'pretty', default pretty to stdout"` Limit int `` /* 151-byte string literal not displayed */ }
TestHistoryCommand represents the test-history command in the CLI
func (*TestHistoryCommand) Execute ¶
func (thc *TestHistoryCommand) Execute(_ []string) error
Execute transfers the fields from a TestHistoryCommand to a TestHistoryParameter and validates them. It then gets the test history from the api endpoint
type ValidateCommand ¶
type ValidateCommand struct { GlobalOpts *Options `no-flag:"true"` Positional struct { FileName string `positional-arg-name:"filename" description:"path to an evergreen project file"` } `positional-args:"1" required:"yes"` }
ValidateCommand is used to verify that a config file is valid.
func (*ValidateCommand) Execute ¶
func (vc *ValidateCommand) Execute(_ []string) error
type VersionCommand ¶
type VersionCommand struct{}
VersionCommand prints the revision that the CLI binary was built with. Is used by auto-update to verify the new version.
func (*VersionCommand) Execute ¶
func (vc *VersionCommand) Execute(_ []string) error