Skip to content

Add analyzer for duplicate polyglot instance method names#16163

Draft
IEvangelist wants to merge 2 commits intomicrosoft:mainfrom
IEvangelist:dapine/issue-15120-yarp-polyglot
Draft

Add analyzer for duplicate polyglot instance method names#16163
IEvangelist wants to merge 2 commits intomicrosoft:mainfrom
IEvangelist:dapine/issue-15120-yarp-polyglot

Conversation

@IEvangelist
Copy link
Copy Markdown
Member

Fixes #15120.

Summary

  • add ASPIREEXPORT013 for exported instance methods that collapse to the same polyglot method name
  • match the check to the generated TypeScript surface rather than raw export IDs
  • cover the YARP-style addCluster overload case plus the ignore and unique-id escape hatches

Testing

  • $env:DOTNET_ROLL_FORWARD='Major'; dotnet test tests\Aspire.Hosting.Analyzers.Tests\Aspire.Hosting.Analyzers.Tests.csproj -- --filter-class "*.AspireExportAnalyzerTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Warn when exported instance overloads collapse to the same generated polyglot method name, and cover the YARP-style addCluster case with focused analyzer tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16163

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16163"

Hide the colliding auto-exposed HelmChartOptions overloads from ATS and replace them with union-backed exported helpers so Kubernetes keeps a single usable polyglot surface. Add a scanner test that pins the exported union helpers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Yarp addCluster(EndpointReference) doesn't work in polyglot

1 participant