Skip to content

Enable polyglot package tagging for hosting integrations - #1574

Open
sebastienros wants to merge 2 commits into
mainfrom
sebros/add-polyglot-package-tags
Open

Enable polyglot package tagging for hosting integrations#1574
sebastienros wants to merge 2 commits into
mainfrom
sebros/add-polyglot-package-tags

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Fixes: #1573

Polyglot AppHosts only discover NuGet integrations marked with the polyglot tag. Community Toolkit hosting integrations already expose [AspireExport] APIs, but their packages do not currently advertise that compatibility.

This enables the bundled Aspire integration analyzer for CommunityToolkit.Aspire.Hosting.* projects and applies its opt-out contract to package metadata. Compatible projects receive polyglot unless they set IsAspirePolyglotCompatible to false; projects without export coverage fail with ASPIREEXPORT017. The redundant explicit analyzer package reference is removed because Aspire.Hosting supplies the analyzer when EnableAspireIntegrationAnalyzers is enabled.

PR Checklist

  • Created a feature/dev branch in the repository (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration (N/A)
    • Docs are written (N/A)
    • Added description of major feature to project description for NuGet package (N/A)
  • Tests for the changes have been added (N/A: shared build metadata was validated by building and packing all source projects)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs (N/A: no APIs added)
  • Code follows all style conventions

Other information

The full solution builds with .NET SDK 10.0.400 with zero ASPIREEXPORT diagnostics. A negative test using an unsupported Encoding? export parameter produced ASPIREEXPORT004 for each target framework. All 78 source projects were packed and their .nuspec metadata inspected: 62 compatible packages contain polyglot, while the other 16 do not.

Packages that receive the polyglot tag (62)
  • CommunityToolkit.Aspire.Hosting.ActiveMQ
  • CommunityToolkit.Aspire.Hosting.Adminer
  • CommunityToolkit.Aspire.Hosting.Azure.Dapr
  • CommunityToolkit.Aspire.Hosting.Azure.Dapr.Redis
  • CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder
  • CommunityToolkit.Aspire.Hosting.Azure.Extensions
  • CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager
  • CommunityToolkit.Aspire.Hosting.Bun
  • CommunityToolkit.Aspire.Hosting.Dapr
  • CommunityToolkit.Aspire.Hosting.DbGate
  • CommunityToolkit.Aspire.Hosting.Dbx
  • CommunityToolkit.Aspire.Hosting.Deno
  • CommunityToolkit.Aspire.Hosting.DuckDB
  • CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions
  • CommunityToolkit.Aspire.Hosting.Flagd
  • CommunityToolkit.Aspire.Hosting.Floci
  • CommunityToolkit.Aspire.Hosting.Flyway
  • CommunityToolkit.Aspire.Hosting.GoFeatureFlag
  • CommunityToolkit.Aspire.Hosting.Golang
  • CommunityToolkit.Aspire.Hosting.Java
  • CommunityToolkit.Aspire.Hosting.JavaScript.Extensions
  • CommunityToolkit.Aspire.Hosting.K3s
  • CommunityToolkit.Aspire.Hosting.Keycloak.Extensions
  • CommunityToolkit.Aspire.Hosting.Kind
  • CommunityToolkit.Aspire.Hosting.KurrentDB
  • CommunityToolkit.Aspire.Hosting.LavinMQ
  • CommunityToolkit.Aspire.Hosting.Listmonk
  • CommunityToolkit.Aspire.Hosting.Logto
  • CommunityToolkit.Aspire.Hosting.MailPit
  • CommunityToolkit.Aspire.Hosting.McpInspector
  • CommunityToolkit.Aspire.Hosting.Meilisearch
  • CommunityToolkit.Aspire.Hosting.Minio
  • CommunityToolkit.Aspire.Hosting.MongoDB.Extensions
  • CommunityToolkit.Aspire.Hosting.Mosquitto
  • CommunityToolkit.Aspire.Hosting.MySql.Extensions
  • CommunityToolkit.Aspire.Hosting.Ngrok
  • CommunityToolkit.Aspire.Hosting.Ollama
  • CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector
  • CommunityToolkit.Aspire.Hosting.PapercutSmtp
  • CommunityToolkit.Aspire.Hosting.Perl
  • CommunityToolkit.Aspire.Hosting.Posta
  • CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions
  • CommunityToolkit.Aspire.Hosting.PowerShell
  • CommunityToolkit.Aspire.Hosting.Python.Extensions
  • CommunityToolkit.Aspire.Hosting.RavenDB
  • CommunityToolkit.Aspire.Hosting.RedPanda
  • CommunityToolkit.Aspire.Hosting.Redis.Extensions
  • CommunityToolkit.Aspire.Hosting.Rust
  • CommunityToolkit.Aspire.Hosting.RustFs
  • CommunityToolkit.Aspire.Hosting.SeaweedFS
  • CommunityToolkit.Aspire.Hosting.Sftp
  • CommunityToolkit.Aspire.Hosting.Solr
  • CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects
  • CommunityToolkit.Aspire.Hosting.SqlServer.Extensions
  • CommunityToolkit.Aspire.Hosting.Sqlite
  • CommunityToolkit.Aspire.Hosting.Squad
  • CommunityToolkit.Aspire.Hosting.StableDiffusionCpp
  • CommunityToolkit.Aspire.Hosting.Stripe
  • CommunityToolkit.Aspire.Hosting.SurrealDb
  • CommunityToolkit.Aspire.Hosting.Umami
  • CommunityToolkit.Aspire.Hosting.Zitadel
  • CommunityToolkit.Aspire.Hosting.k6
Packages that do not receive the polyglot tag (16)
  • CommunityToolkit.Aspire.Bitwarden.SecretManager
  • CommunityToolkit.Aspire.DuckDB.NET.Data
  • CommunityToolkit.Aspire.GoFeatureFlag
  • CommunityToolkit.Aspire.KurrentDB
  • CommunityToolkit.Aspire.Logto.Client
  • CommunityToolkit.Aspire.MassTransit.RabbitMQ
  • CommunityToolkit.Aspire.Meilisearch
  • CommunityToolkit.Aspire.Microsoft.Data.Sqlite
  • CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite
  • CommunityToolkit.Aspire.Minio.Client
  • CommunityToolkit.Aspire.OllamaSharp
  • CommunityToolkit.Aspire.Posta
  • CommunityToolkit.Aspire.RavenDB.Client
  • CommunityToolkit.Aspire.SeaweedFS.Client
  • CommunityToolkit.Aspire.Sftp
  • CommunityToolkit.Aspire.SurrealDb

Enable the bundled Aspire integration analyzer for hosting packages and apply the analyzer's polyglot opt-out contract to NuGet package metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 21:32
Clarify that Aspire.Hosting supplies the enabled analyzer through build-transitive assets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sebastienros

Copy link
Copy Markdown
Contributor Author

Implementation detail: Aspire.Hosting 13.5.0 already bundles Aspire.Hosting.Integration.Analyzers.dll alongside its buildTransitive/Aspire.Hosting.targets. Setting EnableAspireIntegrationAnalyzers to true causes that target to add the bundled DLL as an MSBuild Analyzer item, so a separate Aspire.Hosting.Integration.Analyzers package reference is unnecessary and would load the analyzer twice.

This was verified on CommunityToolkit.Aspire.Hosting.ActiveMQ: the evaluated analyzer path resolves to ~/.nuget/packages/aspire.hosting/13.5.0/buildTransitive/net8.0/Aspire.Hosting.Integration.Analyzers.dll, and an intentionally unsupported exported parameter triggered ASPIREEXPORT004.

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.

🟡 Changes recommended

polyglot tagging can be applied even when the analyzer may not actually be present for projects lacking a direct Aspire.Hosting reference, risking incorrect package metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates shared build metadata so CommunityToolkit.Aspire.Hosting.* NuGet packages can be discovered by Polyglot AppHosts by advertising the polyglot package tag when the Aspire integration analyzers are enabled and the project hasn’t opted out.

Changes:

  • Enables EnableAspireIntegrationAnalyzers by default for CommunityToolkit.Aspire.Hosting.* projects under src/.
  • Appends polyglot to PackageTags when analyzers are enabled and IsAspirePolyglotCompatible is not false.
  • Removes the central package version entry for Aspire.Hosting.Integration.Analyzers (and its now-removed explicit reference).
File summaries
File Description
src/Directory.Build.targets Conditionally appends the polyglot tag to package metadata for compatible hosting integrations.
src/Directory.Build.props Automatically enables Aspire integration analyzers for hosting integration projects and removes the explicit analyzer package reference.
Directory.Packages.props Removes the central package version entry for the analyzer package that is no longer explicitly referenced.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Directory.Build.targets
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.

Add the polyglot tag to compatible nuget packages

2 participants