dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
125 stars 47 forks source link

publishManifest command should skip unchanged tags #1510

Open mthalman opened 7 hours ago

mthalman commented 7 hours ago

The publishManifest command is processing shared tags that don't necessarily need to be updated.

For example, the build (internal link) that ran for https://github.com/dotnet/dotnet-docker/pull/6086 had no path filter set. The PR only updated 9.0 Dockerfiles. So all the .NET versions were cached, resulting in unchanged images for those versions. That was correctly indicated, via the isUnchanged field, in the image info file that was produced. But when publishManifest ran, it ignored that data and processed all shared tags, such as 6.0. This was unnecessary processing since the 6.0 manifest list remained identical to the current version. It also was problematic because it relied on those associated images existing within the ACR in order to produce the manifest list. In this scenario, those images didn't actually exist anymore because they were EOL and had been removed from the ACR but the Dockerfiles hadn't yet been removed. So that actually broke the build because of this behavior, which was worked around.

The solution to this is for publishManifest to look at the isUnchanged field of the images associated with the shared tag. If all those images have isUnchanged set to true, then the shared tag should be skipped.

dotnet-issue-labeler[bot] commented 7 hours 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.

dotnet-issue-labeler[bot] commented 7 hours 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.