Skip to content

Migrate UpdateStaticWebAssetEndpoints - #55001

Merged
jankratochvilcz merged 1 commit into
dotnet:mainfrom
AlesProkop:migrate-update-static-web-asset-endpoints
Jun 30, 2026
Merged

jankratochvilcz merged 1 commit into
dotnet:mainfrom
AlesProkop:migrate-update-static-web-asset-endpoints

Conversation

@AlesProkop

Copy link
Copy Markdown
Member

Fixes dotnet/msbuild#14168

Context

Migrates the UpdateStaticWebAssetEndpoints MSBuild task to the multithreaded execution model. The task does pure in-memory work (it rewrites endpoint metadata from its ITaskItem inputs), so it touches no process-global state and needs only the capability attribute — not TaskEnvironment.

Changes Made

  • Added [MSBuildMultiThreadableTask] to the UpdateStaticWebAssetEndpoints class.
  • Left IMultiThreadableTask unimplemented intentionally: Execute() and its call chain (StaticWebAssetEndpoint.FromItemGroup/FromTaskItem/ToTaskItems, StaticWebAssetEndpointOperation.FromTaskItem, and the operation helpers) perform only dictionary/list/array manipulation — no File/Directory/Environment/Process/Console calls and no static mutable state — so no path absolutization or TaskEnvironment plumbing is required.

Testing

  • Built Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj (net11.0 and net472) with the dotnet/msbuild Microsoft.Build.TaskAuthoring.Analyzer injected; UpdateStaticWebAssetEndpoints.cs compiles clean and the analyzer reported 0 MSBuildTask0001–0005 diagnostics for it across both target frameworks.
  • No unit test added: per the MT migration guidance, an attribute-only migration with no file/env/process/static-state interaction has nothing to assert (a decoy-CWD test would pass with or without the attribute).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates the UpdateStaticWebAssetEndpoints MSBuild task to MSBuild’s multithreaded execution model by marking it as safe for concurrent execution. This aligns Static Web Assets task execution with the SDK’s broader multi-threading migration work and addresses the linked MSBuild issue by enabling the task to run under the multithreaded scheduler.

Changes:

  • Marked UpdateStaticWebAssetEndpoints as multithread-capable by adding the [MSBuildMultiThreadableTask] attribute.

@jankratochvilcz jankratochvilcz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merge time!

@jankratochvilcz
jankratochvilcz enabled auto-merge (squash) June 30, 2026 10:16
@jankratochvilcz
jankratochvilcz merged commit 13b17f1 into dotnet:main Jun 30, 2026
26 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 1, 2026
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.

[Multithreaded] Migrate UpdateStaticWebAssetEndpoints in SDK

4 participants