dotnet / dotnet/sdk-container-builds

Normalized ContainerImageName depends on the case

Open Beginner friendly
#652 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
197
Forks
53
PR merge metrics
No merged PRs in 30d

Description

As a follow-up of https://github.com/dotnet/sdk-container-builds/issues/387.

Just to let you know, that uppercase not only freeze with long name, but also change the way the image name is normalized

Lowering the image name make `IsValidImageName` return true and the image name is return as-is. Meaning dot are not replaced with dash.

My image name `MyCompany.MyProject.Api` (a fairly common project name in the dotnet space) used to be renamed to `mycompany-myproject-api`. Now that I set it to `mycompany.myproject.api`, it stays as is. This is a real annoying issue especially because there is no easy way to get the final imageName as an output. So everything after in the CI is convention based, and conventions are not stable (should dot be replaced or not ?).

If the test for IsValidRepositoryName
https://github.com/dotnet/sdk/blob/8dee7bac7bcf987e84c35658ad4caebf5e1bc48f/test/Microsoft.NET.Build.Containers.UnitTests/ContainerHelpersTests.cs#L87

had the following test, it would fail.

```
[DataRow("My.Api", "my.api", "NormalizedContainerName", null)] // expected is "my-api"
[DataRow("my.api", "my.api", null, null)]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test/Microsoft.NET.Build.Containers.UnitTests/ContainerHelpersTests.cs at the IsValidRepositoryName test referenced in the issue, and reproduce the two My.Api and my.api cases. Trace the normalization path from that test to confirm case-dependent behavior; done means the tests agree on the expected normalized name and cover both inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.