Exemple #1
0
// doStepBack performs a stepback on the task if there is a previous task and if not it returns nothing.
func doStepback(t *task.Task, caller string, detail *apimodels.TaskEndDetail, deactivatePrevious bool) error {
	//See if there is a prior success for this particular task.
	//If there isn't, we should not activate the previous task because
	//it could trigger stepping backwards ad infinitum.
	prevTask, err := t.PreviousCompletedTask(t.Project, []string{evergreen.TaskSucceeded})
	if prevTask == nil {
		return nil
	}
	if err != nil {
		return fmt.Errorf("Error locating previous successful task: %v", err)
	}

	// activate the previous task to pinpoint regression
	return ActivatePreviousTask(t.Id, caller)
}