Fix multi-arch container label parsing#55414
Merged
baronfel merged 1 commit intoJul 23, 2026
Merged
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes parsing of multi-architecture container labels that are serialized as key:value when passed to inner builds. The existing MSBuild target split on all colons and truncated label values containing colons (e.g., https://... URLs and RFC 3339 timestamps), producing incorrect OCI label metadata.
Changes:
- Update
_ParseItemsForPublishingSingleContainerto split label entries only on the first colon (Split(':', 2)), preserving the remainder of the value. - Add an integration regression test ensuring multi-arch label values containing colons (URL + timestamp) round-trip correctly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs | Adds regression coverage validating that multi-arch label parsing preserves colons in values. |
| src/Containers/packaging/build/Microsoft.NET.Build.Containers.targets | Fixes label parsing by limiting the split to two parts (key + remainder value). |
Contributor
Author
|
@dotnet-policy-service agree |
Member
|
/backport to release/11.0.1xx-preview7 |
Contributor
|
Started backporting to |
Member
|
@jetersen this will be in RC1 in September for sure, but am backporting to the p7 branch so you can hopefully see it in p7 too! |
Contributor
Author
|
@baronfel yes! That's sounds great 👏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Multi-architecture inner builds receive labels serialized as
key:value._ParseItemsForPublishingSingleContainerused an unrestrictedSplit(':')and selected element 1, truncating everything after the next colon.Fixes #52732.
Validation
containers.slnfbuilds successfully with zero warnings or errors_ParseItemsForPublishingSingleContainerpreserves both URL and RFC 3339 valuesThe repository test runner requires a built redist SDK; the attempted redist build was blocked by an unrelated missing
project.assets.jsonin the Static Web Assets tool chain.