-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEVPROD-10420: do not link patch_optional dependencies for alias versions #8348
DEVPROD-10420: do not link patch_optional dependencies for alias versions #8348
Conversation
Remove TODOs and debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
repotracker/repotracker_test.go
Outdated
|
||
tasks, err := task.Find(task.ByVersion(v.Id)) | ||
s.NoError(err) | ||
s.Require().Len(tasks, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't need require here since we don't index the slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to assert.
model/lifecycle.go
Outdated
@@ -742,6 +742,9 @@ 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 == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we move this into createOneTask
for empty id protection against potential future uses of it?
DEVPROD-10420
Description
The tasks that have hit the task dependencies alert are tasks that have a dependency on a nonexistent task. They get stuck in the task queue because they're waiting to run on the nonexistent task.
This happens because of
patch_optional
dependencies in non-commit waterfall versions. For example, let's say there's ataskA
and it has apatch_optional
dependency ontaskB
. The expected behavior ofpatch_optional
is that the dependency will never be created automatically in the version, so the dependency link should only be created if bothtaskA
andtaskB
are created together. Furthermore, let's assume there's a periodic build that has an alias that selects onlytaskA
to run. In this case,taskA
should be created andtaskB
shouldn't (and we do see this happen, which is correct). However, even thoughtaskB
wasn't created,taskA
nonetheless has adepends_on
link to the nonexistenttaskB
(this shouldn't happen).The cause of the bug is that, when creating a waterfall version, we have to make a pre-generated table of task IDs. Currently, the pre-generated task ID table creates task IDs for all possible variant-tasks, even those that might not be created upon version creation. This logic will skip the
patch_optional
dependency so the dependent task is not automatically created (correct), but this logic will still create the dependency link to the (nonexistent) task because the pre-generated task ID exists (not correct). To fix this, I filtered tasks from the task ID table so that for versions like periodic builds that create a subset of all possible tasks, they only generate task IDs for tasks that will actually be created.Testing
patch_optional
dependency was ignored.Documentation
Clarified in documentation that, despite the name of the field,
patch_optional
means the dependency is optional in all versions, not just patches. The docs already say this explicitly, but I thought it was worth clarifying that the name of the field doesn't correspond to what you'd expect it to do.