Skip to content
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

Schema Tag Tests #5878

Open
wants to merge 6 commits into
base: nightly
Choose a base branch
from
Open

Conversation

ellahathaway
Copy link
Member

@ellahathaway ellahathaway commented Sep 11, 2024

Closes #5838

Introduces schema tag tests (the second half of the static tag tests). I have introduced three new types of tests in this PR:

  1. Product Tag Tests- tests that each dockerfile has a tag in the expected format (<major.minor.patch>-<os>-<arch>, <major.minor.patch>-<os>, etc)
  2. Alpine Tag Tests - tests that alpine floating tags exist on the expected alpine dockerfiles
  3. Version Tag Tests - tests that version tags with floating distros and arches exist and are on the expected dockerfiles

These tests use a dictionary of dockerfiles to tags, so this PR also introduces that logic in ManifestHelper.cs.

@ellahathaway ellahathaway marked this pull request as ready for review September 11, 2024 22:58
@ellahathaway ellahathaway requested a review from a team as a code owner September 11, 2024 22:58
tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
Comment on lines 61 to 65
if (!repo.Name.Contains("monitor"))
{
// Monitor repos don't have these tags
testObjects.Add(GetTagTestInput(testType, repo, 1, false, true, IsApplianceVersionUsingOldSchema)); // <Major>-<architecture>
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbussell - Is this intentional? Why isn't this consistent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - IIRC .NET Monitor wants to explicitly make moving between minor versions intentional.

/cc @jander-msft

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aspire on the other hand has only one major.minor version supported at a time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specifically related to the <major>-<arch> pattern. Monitor already has a 9 tag but no 9-amd64 tag. But Aspire has both 8 and 8-amd64.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like dotnet/monitor and dotnet/monitor-base is missing the following tag patterns:

  • <major>.<minor>-<arch> (for everything before 9)
  • <major>-<arch> (for all versions)

I think it makes sense to have these added, at least from a consistency standpoint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, the introduction of the <major>.<minor>-<arch> and <major>-<arch> tag schemes was largely only done for the Aspire dashboard. Take the dotnet/runtime repo as an example; while it doesn't contain major-only tags, there are no <major>.<minor>-<arch> tags. However, there are <major>.<minor>-<distro>-<arch> tags. The .NET Monitor images are, by-in-large, consistent with these tag schemes in the base .NET images whereas the Aspire images have introduced a new pattern.

We'll have to investigate the reasoning as to why the <major>.<minor>-<arch> were never added to the base .NET images and see if the same reasoning should apply to the appliance-style images. I'll open an issue to document the inconsistency and allow discussion separate from this PR on what should be done to rectify the inconsistency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open an issue to document the inconsistency and allow discussion separate from this PR on what should be done to rectify the inconsistency.

This is a great path forward. Thank you for filing the issue and starting this discussion.

I spoke with the team offline, and the decision is to go ahead with merging the changes in this PR. These tests can then be adjusted later given the future discussion on the issue.

I'll leave this comment thread open as well.

tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants