Skip to content

Publish Aspire.Hosting.Integration.Analyzers as preview package#17276

Merged
sebastienros merged 8 commits into
mainfrom
sebastienros/sebros-experimentally-publish-integratio
May 20, 2026
Merged

Publish Aspire.Hosting.Integration.Analyzers as preview package#17276
sebastienros merged 8 commits into
mainfrom
sebastienros/sebros-experimentally-publish-integratio

Conversation

@sebastienros
Copy link
Copy Markdown
Contributor

Description

This starts publishing Aspire.Hosting.Integration.Analyzers as a standalone preview NuGet package so out-of-repo integration authors can use the same ATS/polyglot analyzer guidance used in-repo.

It makes the analyzer project packable with preview package settings, adds a package README, and documents how third-party authors can reference the package. It also adds MSBuild tests that validate the nupkg layout (analyzers/dotnet/cs plus README, no dependency payload) and local-feed consumption in a sample project.

For docs links, there is not an equivalent aspire.dev page for third-party ATS attributes today, so the README points to repo docs/specs for now.

Fixes: #17264

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros requested a review from mitchdenny as a code owner May 19, 2026 21:31
Copilot AI review requested due to automatic review settings May 19, 2026 21:31
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

This PR enables publishing Aspire.Hosting.Integration.Analyzers as a standalone preview NuGet package so out-of-repo hosting integration authors can use the same ATS/polyglot authoring analyzers as in-repo integrations.

Changes:

  • Makes Aspire.Hosting.Integration.Analyzers packable and configures its NuGet package metadata and analyzer asset layout.
  • Adds package documentation (package README + guidance in existing ATS attribute docs).
  • Adds MSBuild-based tests to validate the produced nupkg contents and local-feed consumption.

Reviewed changes

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

File Description
tests/Aspire.Hosting.Tests/MSBuildTests.cs Adds pack/build helpers and tests validating analyzer nupkg layout + local consumption.
src/Aspire.Hosting/Ats/ThirdPartyAtsAttributes.md Documents how third-party integrations can reference the analyzer package.
src/Aspire.Hosting.Integration.Analyzers/README.md Adds package README content intended to ship in the nupkg.
src/Aspire.Hosting.Integration.Analyzers/Aspire.Hosting.Integration.Analyzers.csproj Makes the analyzer project packable and packs the analyzer assembly under analyzers/dotnet/cs.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 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 -- 17276

Or

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

sebastienros and others added 2 commits May 19, 2026 15:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid loading the integration analyzer project into generated ATS scanner builds and exclude it from ATS workflow project discovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/Aspire.Hosting.Integration.Analyzers/README.md
@IEvangelist
Copy link
Copy Markdown
Member

PR Testing Complete

Result: ✅ PR #17276’s package-focused changes verified successfully. The new Aspire.Hosting.Integration.Analyzers package is present in the PR hive with the expected analyzer layout and can be consumed from a temp out-of-repo project.

PR Information

Scenarios Executed

Scenario Status Notes
PR CLI install/version verification ✅ Passed Dogfood CLI installed locally and matched PR head.
Analyzer package layout validation ✅ Passed Nupkg contains analyzers/dotnet/cs/Aspire.Hosting.Integration.Analyzers.dll, includes README.md, has no lib/ payload, and no nuspec dependencies.
Out-of-repo analyzer consumption ✅ Passed Temp project consumed Aspire.Hosting + Aspire.Hosting.Integration.Analyzers from PR hive. Analyzer loaded, emitted ASPIREEXPORT010/011, and no CS8032 occurred. Suppressed expected ASPIREATS001 preview-attribute diagnostic.
CLI smoke with PR packages ✅ Passed with setup adjustment aspire new aspire-empty succeeded; aspire start, describe, and stop succeeded after using generated apphost.cs and removing generated package source mapping.

Observation

The first aspire start attempt for the smoke app failed because the template generated a single-file apphost.cs but I initially used a .csproj path. After switching to apphost.cs, startup still failed because the generated nuget.config package source mapping caused the SDK resolver to not consider the PR hive/nuget.org sources for Aspire.AppHost.Sdk. Replacing that config with the same sources without package source mapping let aspire start succeed.

That looks like a dogfood/template-source setup issue rather than part of this analyzer-packaging PR.

Cleanup

The local temp workspace and captured artifacts were removed:

C:\Users\dapine\AppData\Local\Temp\aspire-pr-test-2b8c6d3c09bb47ebb499c83ba8def3d2


Posted by GitHub Copilot CLI.

Co-authored-by: David Pine <david.pine@microsoft.com>
Comment thread src/Aspire.Hosting.Integration.Analyzers/README.md Outdated
sebastienros and others added 4 commits May 20, 2026 14:04
Make the analyzer type internal and remove the generated public API baseline from source control.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use versionless package-reference examples for the integration analyzer package documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove redundant dependency suppression and avoid exact package versions in analyzer docs while keeping analyzer-only package metadata explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros merged commit 1929dfe into main May 20, 2026
600 of 603 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.4 milestone May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

CLI E2E Tests unknown — 96 passed, 0 failed, 2 unknown (commit 8f850cc)

View all recordings
Status Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View recording
AddPackageWhileAppHostRunningDetached ▶️ View recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View recording
AgentInitCommand_DefaultSelection_InstallsDefaultSkills ▶️ View recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View recording
AllPublishMethodsBuildDockerImages ▶️ View recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View recording
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost ▶️ View recording
AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles ▶️ View recording
AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive ▶️ View recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View recording
AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent ▶️ View recording
Banner_DisplayedOnFirstRun ▶️ View recording
Banner_DisplayedWithExplicitFlag ▶️ View recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View recording
CertificatesClean_RemovesCertificates ▶️ View recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View recording
CreateAndRunAspireStarterProject ▶️ View recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View recording
CreateAndRunEmptyAppHostProject ▶️ View recording
CreateAndRunJavaEmptyAppHostProject ▶️ View recording
CreateAndRunJsReactProject ▶️ View recording
CreateAndRunPythonReactProject ▶️ View recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View recording
CreateAndRunTypeScriptStarterProject ▶️ View recording
CreateJavaAppHostWithViteApp ▶️ View recording
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ▶️ View recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View recording
DeployK8sBasicApiService ▶️ View recording
DeployK8sWithExternalHelmChart ▶️ View recording
DeployK8sWithGarnet ▶️ View recording
DeployK8sWithMongoDB ▶️ View recording
DeployK8sWithMySql ▶️ View recording
DeployK8sWithPostgres ▶️ View recording
DeployK8sWithRabbitMQ ▶️ View recording
DeployK8sWithRedis ▶️ View recording
DeployK8sWithSqlServer ▶️ View recording
DeployK8sWithValkey ▶️ View recording
DeployTypeScriptAppToKubernetes ▶️ View recording
DescribeCommandResolvesReplicaNames ▶️ View recording
DescribeCommandShowsRunningResources ▶️ View recording
DetachFormatJsonProducesValidJson ▶️ View recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View recording
DoListStepsShowsPipelineSteps ▶️ View recording
DocsCommand_RendersInteractiveMarkdownFromLocalSource ▶️ View recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View recording
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ▶️ View recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View recording
GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain ▶️ View recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View recording
GlobalMigration_PreservesAllValueTypes ▶️ View recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View recording
InteractiveCSharpInitCreatesExpectedFiles ▶️ View recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View recording
JavaScriptHostingApisRunFromTypeScriptAppHost ▶️ View recording
LatestCliCanStartStableChannelAppHost ▶️ View recording
LatestCliCanStartStableChannelTypeScriptAppHost ▶️ View recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View recording
LogLevelTrace_ProducesTraceEntriesInCliLogFile ▶️ View recording
LogsCommandShowsResourceLogs ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterAppIsolated ▶️ View recording
PsCommandListsRunningAppHost ▶️ View recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View recording
PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts ▶️ View recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View recording
ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries ▶️ View recording
ResourceCommand_FailsWhenInteractionServiceIsRequired ▶️ View recording
ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput ▶️ View recording
RestoreGeneratesSdkFiles ▶️ View recording
RestoreGeneratesSdkFiles_WithConfiguredToolchain ▶️ View recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View recording
RunPublishFailureScenarioAsync ▶️ View recording
RunReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
RunReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
SecretCrudOnDotNetAppHost ▶️ View recording
SecretCrudOnTypeScriptAppHost ▶️ View recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View recording
StartReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
StartReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
StopAllAppHostsFromAppHostDirectory ▶️ View recording
StopJavaPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopNonInteractiveSingleAppHost ▶️ View recording
StopTypeScriptPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View recording
UpdateProjectChannelToStable_TypeScript_PicksUpStablePackages ▶️ View recording

📹 Recordings uploaded automatically from CI run #26190714938

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.

Experimentally publish Aspire.Hosting.Integration.Analyzers for integration developers

4 participants