mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 14:58:19 +00:00
* Moved CommandContext and CommandResult to models (#193) * Moved CommandContext and CommandResult to models * move from models to command rename CommandContext -> Context rename CommandResult -> Result * moved command related helpers into command package * move ProjectCommandContext and ProjectResult to command/project package * move project command context and project result * revert unrelated code * move tests * fix left over * fix linting * fix tests * remove unused import * fix project context dependencies * fix depenedecies * fix typo
27 lines
693 B
Go
27 lines
693 B
Go
package command
|
|
|
|
// Result is the result of running a Command.
|
|
type Result struct {
|
|
Error error
|
|
Failure string
|
|
ProjectResults []ProjectResult
|
|
// PlansDeleted is true if all plans created during this command were
|
|
// deleted. This happens if automerging is enabled and one project has an
|
|
// error since automerging requires all plans to succeed.
|
|
PlansDeleted bool
|
|
}
|
|
|
|
// HasErrors returns true if there were any errors during the execution,
|
|
// even if it was only in one project.
|
|
func (c Result) HasErrors() bool {
|
|
if c.Error != nil || c.Failure != "" {
|
|
return true
|
|
}
|
|
for _, r := range c.ProjectResults {
|
|
if !r.IsSuccessful() {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|