Fix bug where unrelated jobs were linked as dependencies #15610
+44
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
This used a wrong variable in a loop, where
dependencies
was a cumulative list for everytask
seen in the loop, butjob_deps
were the dependencies for the one task being looked at. The point was to simply save the job's dependencies, but using the global variable, we kind of saved every dependency seen by that single run as a dependency of the job. This was seen adding an inventory update as a dependency of itself... logically because a priortask
in the loop had the inventory update as a dependency, and the inventory update, itself, later in the loop, produced a project update dependency. So it added the 2 dependencies, the inventory update, a dependency for some other random job, and the project update, to the dependency list of the inventory update.Test failure without code change:
Important to note the 1st entry,
1
, which means the firsttask
to be processed got the correct dependencies linked.It is only the later items in the loop, the 2nd item here, which gets linked to its own deps and erroneous deps of prior tasks processed. Giving
2
, having added its own dep to the 1 before. This is not good, both examples in the test are simple cases, totally isolated from each other, that only produce1
dependency.ISSUE TYPE
COMPONENT NAME