Closed lbussell closed 2 weeks ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I have concerns of doing this because it can mask issues in the matrix generation that cause Dockerfiles to be combined into the same leg that we may not want to be combined. Here's an example of such an issue: https://github.com/dotnet/docker-tools/pull/890. As illustrated in the issue, the correct output should have multiple legs, but with unique leg names. If we ended up getting rid of the validation and combining duplicate legs, it wouldn't end up catching a bug like that. In this scenario, it would lead to bad performance in the pipeline since its serializing more of the work that could be done in parallel. That's one thing. But I also wonder whether there are other scenarios that could cause real functional bugs in the output of what we produce.
[Triage] We should spend our time fixing #1178 itself rather than working on band-aid fixes like this. Closing in favor of #1178.
Oftentimes when changing the manifest in repos, the build matrix generation may fail with the following error:
This should be addressed by https://github.com/dotnet/docker-tools/issues/1178 which would hopefully eliminate the possibility of duplicate legs being created.
In the meantime, as a mitigation for the above matrix generation issues, I propose that whenever we have duplicate leg names found, we simply combine them so that the build still functions.
In the GenerateBuildMatrix command, that would just mean adding some additional logic here instead of throwing an error:
https://github.com/dotnet/docker-tools/blob/1d6ecd5db81ddce03b88c670750804397122b111/src/Microsoft.DotNet.ImageBuilder/src/Commands/GenerateBuildMatrixCommand.cs#L533-L548