Skip to content

Move in-vertical manifest merging to new arcade package #47881

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

Closed

Conversation

mmitche
Copy link
Member

@mmitche mmitche commented Mar 25, 2025

Depends on dotnet/arcade#15661 Removes the custom manifest handling in MergeAssetManifests, moving it to use the new manifest package produced by arcade. This reduces code duplication and means more complete manifests out of the each vertical. Add tests for the merging, based on manifests coming out of the build.

Depends on dotnet/arcade#15661
Removes the custom manifest handling in MergeAssetManifests, moving it to use the new manifest package produced by arcade. This reduces code duplication and means more complete manifests out of the each vertical.
Add tests for the merging, based on manifests coming out of the build.
@Copilot Copilot AI review requested due to automatic review settings March 25, 2025 21:47
@mmitche mmitche requested review from a team as code owners March 25, 2025 21:47
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Mar 25, 2025
@mmitche mmitche requested a review from jkoritzinsky March 25, 2025 21:47
Copy link
Contributor

@Copilot 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

This PR migrates custom manifest merging for in-vertical builds to the new Arcade manifest package, reducing code duplication and improving manifest completeness.

  • Added tests (MergeAssetManifestsTests and MockBuildEngine) to validate manifest merging.
  • Updated BuildComparer to use the new Arcade package.
  • Refactored MergeAssetManifests to leverage dependency injection and new manifest model APIs.

Reviewed Changes

Copilot reviewed 53 out of 68 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/SourceBuild/content/test/Microsoft.DotNet.Tests/MergeAssetManifestsTests.cs Added new tests for merged manifest validation
src/SourceBuild/content/test/Microsoft.DotNet.Tests/MockBuildEngine.cs Introduced a mock build engine for testing purposes
src/SourceBuild/content/eng/tools/BuildComparer/Program.cs Updated using directive to reference the new Arcade manifest package
src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/MergeAssetManifests.cs Refactored manifest merging to use dependency injection and new Arcade APIs
src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/GetKnownArtifactsFromAssetManifests.cs Changed base class inheritance to align with new task patterns
Files not reviewed (15)
  • src/SourceBuild/content/Directory.Packages.props: Language not supported
  • src/SourceBuild/content/eng/Version.Details.xml: Language not supported
  • src/SourceBuild/content/eng/Versions.props: Language not supported
  • src/SourceBuild/content/eng/merge-asset-manifests.proj: Language not supported
  • src/SourceBuild/content/eng/tools/BuildComparer/BuildComparer.csproj: Language not supported
  • src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/Microsoft.DotNet.Tests.csproj: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests1/expected.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests1/fsharp.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests1/xdt.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests2/arcade.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests2/aspire.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests2/aspnetcore.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests2/cecil.xml: Language not supported
  • src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/MergeAssetManifestsTests/manifests2/command-line-api.xml: Language not supported
Comments suppressed due to low confidence (2)

src/SourceBuild/content/test/Microsoft.DotNet.Tests/MergeAssetManifestsTests.cs:21

  • [nitpick] Consider renaming 'manifestsBasePath' to 'ManifestsBasePath' for consistency with C# naming conventions.
private const string manifestsBasePath = "MergeAssetManifestsTests";

src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/MergeAssetManifests.cs:52

  • Ensure that 'Log' is registered with an explicit service type if required, to avoid potential misconfigurations during dependency injection.
collection.TryAddSingleton(Log);

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

I had an alternative implementation of this idea in #47076, where we can use Arcade's Publish logic to avoid even having our own MergeAssetManifests task.

Would you prefer going with this model or do we want to do the model in #47076 eventually?

@mmitche
Copy link
Member Author

mmitche commented Mar 25, 2025

I had an alternative implementation of this idea in #47076, where we can use Arcade's Publish logic to avoid even having our own MergeAssetManifests task.

Would you prefer going with this model or do we want to do the model in #47076 eventually?

Probably #47076 is better

@mmitche
Copy link
Member Author

mmitche commented Mar 25, 2025

It also depends on timeline. We do need this for p4. Is anything aside from re-bootstrap blocking #47076?

@jkoritzinsky
Copy link
Member

I believe only bootstrap, but there might be a little more work follow up work from resolving failures and the like from a full VMR run. I'm also fine getting this in first as it's a move in the right direction.

I'll do a full review pass tomorrow.

@@ -19,11 +19,10 @@
</ItemGroup>

<ItemGroup>
<Content Include="assets\**" CopyToOutputDirectory="PreserveNewest" />
<Content Include="assets\**" CopyToOutputDirectory="Always" />
Copy link
Member

Choose a reason for hiding this comment

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

Why can't this be PreserveNewest?

@@ -11,6 +11,8 @@
<PackageReference Include="NuGet.Protocol" IncludeAssets="compile" />
<PackageReference Include="NuGet.ProjectModel" IncludeAssets="compile" />
<PackageReference Include="Newtonsoft.Json" IncludeAssets="compile" />
<PackageReference Include="Microsoft.DotNet.Build.Manifest" />
<PackageReference Include="Microsoft.Arcade.Common" />
Copy link
Member

Choose a reason for hiding this comment

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

nit: indentation

Suggested change
<PackageReference Include="Microsoft.Arcade.Common" />
<PackageReference Include="Microsoft.Arcade.Common" />

@mmitche
Copy link
Member Author

mmitche commented Apr 1, 2025

Holding off on this unless @jkoritzinsky thinks #47076 is not viable

@ViktorHofer
Copy link
Member

I think we should take this one as #47076 isn't ready yet. The other PR can then rebase on top of these changes.

@jkoritzinsky
Copy link
Member

I agree with @ViktorHofer. Let's take this one first and I'll finish up mine afterwards.

@mmitche
Copy link
Member Author

mmitche commented Apr 1, 2025

@jkoritzinsky @ViktorHofer Alright, dotnet/arcade#15661 needs to go in first then.

@mmitche
Copy link
Member Author

mmitche commented Apr 11, 2025

Failing because command-line-api builds with IsReleaseOnlyPackageVersion=true, and the manifest merge is more strict on this front.

Copy link
Contributor

@kasperk81 kasperk81 left a comment

Choose a reason for hiding this comment

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

tabs to space

Comment on lines +4 to +5
<TargetFramework>$(NetCurrent)</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<TargetFramework>$(NetCurrent)</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFramework>$(NetCurrent)</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Comment on lines +17 to +21
<!-- These are actual dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Manifest" />
<PackageReference Include="Microsoft.Arcade.Common" />
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<!-- These are actual dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Manifest" />
<PackageReference Include="Microsoft.Arcade.Common" />
</ItemGroup>
<!-- These are actual dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Manifest" />
<PackageReference Include="Microsoft.Arcade.Common" />
</ItemGroup>

@mmitche mmitche closed this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants