Closed lbussell closed 1 year ago
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.
I accidentally created an sdk->sdk cycle in the manifest defined in the test. Fixed that. Glad it wasn't an issue with the actual code - we should never have cycles in our actual Dockerfiles/manifests.
Fixes https://github.com/dotnet/docker-tools/issues/1141
I did not test https://github.com/dotnet/docker-tools/pull/1142 enough and it turns out it was still an issue in some cases. In this case, the PlatformVersionedOS matrix graph generation would create multiple legs for the same OS when we needed to build images with a shared cached parent that were not direct siblings. For example, generating a matrix when we have built both
aspnet
andaspnet-composite
would end up creating two separate test graphs - one with[runtime-deps, aspnet-composite]
and the other with[runtime, aspnet, sdk]
(that's before we filter the images down in a later step).The issue is that the
CreateNodeList
method didn't include parents-of-parents in its calculation. I changed it to be recursive. We don't need to dig deeper into children becauseour Dockerfiles don't branch beneath runtime-deps, no children have multiple descendants. However I could be convinced to add walking the children graph tobecause parent images that aren't cached imply all their children will also be not cached.CreateNodeList
.I also added some extra testing to cover this case. I added SDK to the test graph to make it more representative of the actual build but I don't think it makes a difference.