Skip to content

Add platform validation for multi-arch manifests in Post_Build stage#2126

Open
dagood wants to merge 2 commits into
dotnet:mainfrom
dagood:dev/dagood/verify-manifest-all-platforms
Open

Add platform validation for multi-arch manifests in Post_Build stage#2126
dagood wants to merge 2 commits into
dotnet:mainfrom
dagood:dev/dagood/verify-manifest-all-platforms

Conversation

@dagood
Copy link
Copy Markdown
Member

@dagood dagood commented May 26, 2026

Change createManifestList to validate the list of platforms in the manifest list against the expectations in manifest.json. More information in doc changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional platform-completeness validation step for multi-arch manifest list generation in ImageBuilder and wires it through AzDO Post_Build templates (plus docs) so builds can fail early if a manifest list tag would omit manifest-defined platforms.

Changes:

  • Add manifest list platform validation APIs to ManifestListHelper and expose a --validate-manifest-list-platforms CLI switch for createManifestList.
  • Update CreateManifestListCommand to run validation (when enabled) before pushing/creating manifest lists.
  • Plumb a validateManifestListPlatforms boolean parameter through AzDO templates and document the behavior in DEV-GUIDE/CHANGELOG.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ImageBuilder/ManifestListHelper.cs Adds platform validation logic and supporting types/helpers for manifest list generation.
src/ImageBuilder/Commands/CreateManifestListOptions.cs Introduces --validate-manifest-list-platforms CLI option and binds it to options.
src/ImageBuilder/Commands/CreateManifestListCommand.cs Executes platform validation (when enabled) before creating/pushing manifest lists.
src/ImageBuilder.Tests/ManifestListHelperTests.cs Adds unit tests covering validation issues and successful validation.
src/ImageBuilder.Tests/CreateManifestListCommandTests.cs Adds end-to-end command test verifying validation prevents partial manifest list creation.
eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml Adds validateManifestListPlatforms parameter pass-through for the repo pipeline template.
eng/docker-tools/templates/stages/dotnet/build-and-test.yml Adds validateManifestListPlatforms parameter pass-through for dotnet build-and-test stage template.
eng/docker-tools/templates/stages/build-and-test.yml Wires validateManifestListPlatforms into Post_Build stage invocation.
eng/docker-tools/templates/jobs/post-build.yml Conditionally appends --validate-manifest-list-platforms to createManifestList args.
eng/docker-tools/DEV-GUIDE.md Documents Post_Build creating manifests and the new validation toggle guidance.
eng/docker-tools/CHANGELOG.md Adds changelog entry describing the new validation parameter and recommended usage.

Comment thread src/ImageBuilder/ManifestListHelper.cs
Comment thread src/ImageBuilder/ManifestListHelper.cs
@dagood
Copy link
Copy Markdown
Member Author

dagood commented May 27, 2026

This is an implementation by Copilot for:

The doc and test changes look reasonable to me, but I would need more time to understand everything happening in src/ImageBuilder/ManifestListHelper.cs. I can't tell at first glance if Copilot's self-criticism is valid, for example.

@dagood dagood marked this pull request as ready for review May 27, 2026 00:29
@dagood dagood requested a review from a team as a code owner May 27, 2026 00:29
Description = "Path to the image info file to read and update with manifest list digests"
};

private static readonly Option<bool> ValidateManifestListPlatformsOption = new("--validate-manifest-list-platforms")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why have an option at all? I would think this should just be the default, and only, behavior.

Copy link
Copy Markdown
Member

@lbussell lbussell May 27, 2026

Choose a reason for hiding this comment

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

+1, even in the "dev" scenario mentioned in #2127, you would want to simulate the real publishing behavior, I think. It will likely require #2128 to function without this option, however.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I imagined that someone might want to be able to run a filtered dev build that produces a manifest tag that only includes the outputs from that specific build, to tinker with.

With harvesting existing images to put in the manifest, maybe someone could end up being confused about which of the images pointed to by the manifest came from the dev build vs. some other build?

For me/Go, it doesn't matter either way, just trying to imagine odd dev cases and keep this change low-impact so it can be merged ASAP. (We're holding off on automated builds until validation is in.)

I'll push another commit that makes it the only behavior to see how that looks.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread src/ImageBuilder/Commands/CreateManifestListCommand.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants