Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimchelly committed Sep 27, 2024
1 parent 819d2a1 commit d64b670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions model/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,6 @@ func createTasksForBuild(ctx context.Context, creationInfo TaskCreationInfo) (ta
taskMap := make(map[string]*task.Task)
for _, t := range tasksToCreate {
id := execTable.GetId(creationInfo.Build.BuildVariant, t.Name)
if id == "" {
return nil, errors.Errorf("could not find task ID for task '%s' in build variant '%s'", t.Name, creationInfo.Build.BuildVariant)
}
newTask, err := createOneTask(ctx, id, creationInfo, t)
if err != nil {
return nil, errors.Wrapf(err, "creating task '%s'", id)
Expand Down Expand Up @@ -1127,6 +1124,10 @@ func getTaskCreateTime(creationInfo TaskCreationInfo) (time.Time, error) {

// createOneTask is a helper to create a single task.
func createOneTask(ctx context.Context, id string, creationInfo TaskCreationInfo, buildVarTask BuildVariantTaskUnit) (*task.Task, error) {
if id == "" {
return nil, errors.Errorf("cannot create task '%s' in build variant '%s' for project '%s' with an empty task ID", creationInfo.ProjectRef.Id, buildVarTask.Name, creationInfo.Build.BuildVariant)
}

activateTask := creationInfo.Build.Activated && !creationInfo.ActivationInfo.taskHasSpecificActivation(creationInfo.Build.BuildVariant, buildVarTask.Name)

// If stepback is enabled, check if the task should be activated via stepback.
Expand Down
2 changes: 1 addition & 1 deletion repotracker/repotracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ tasks:

tasks, err := task.Find(task.ByVersion(v.Id))
s.NoError(err)
s.Require().Len(tasks, 2)
s.Len(tasks, 2)

var foundTask1, foundTask2 bool
var task1DepID, task2ID string
Expand Down

0 comments on commit d64b670

Please sign in to comment.