Skip to content

Record default hosting packages when scaffolding a guest AppHost - #21191

Merged
David Pine (IEvangelist) merged 10 commits into
mainfrom
ievangelist-init-default-language-packages
Nov 4, 2026
Merged

David Pine (IEvangelist) merged 10 commits into
mainfrom
ievangelist-init-default-language-packages

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

aspire init --language <lang> scaffolded an AppHost with only the code generation package, so users had to run aspire add before they could use the resource APIs their language almost always needs (for example AddViteApp from Aspire.Hosting.JavaScript). Only a TypeScript AppHost next to an existing package.json got Aspire.Hosting.JavaScript pre-added.

This adds LanguageInfo.DefaultHostingPackages as the single language-to-package mapping. ScaffoldingService writes those packages to the AppHost aspire.config.json before it collects the integrations, so they are restored and code generated together with the code generation package. It replaces the brownfield-only TypeScript pre-add.

Language Default hosting packages
TypeScript Aspire.Hosting.JavaScript
Python Aspire.Hosting.Python
Go Aspire.Hosting.Go
Java, Rust none yet: Aspire.Hosting.Java and Aspire.Hosting.Rust are still preview packages
C# none: #:package directives from CliTemplateFactory.GetCSharpAppHostDirectives, already shared by aspire new and aspire init
  • The version is the SDK version, the same fallback aspire add and the starter templates use. An existing entry in the config is kept.
  • A language lists a default only when its hosting package ships stable. A package marked SuppressFinalPackageVersion publishes only X.Y.Z-preview.* versions, which never satisfy the stable CLI version X.Y.Z that the scaffolder pins, so restoring it would fail. Two guard tests enforce the rule (see Validation).
  • Go joins because Aspire.Hosting.Go ships stable as part of the Go AppHost GA. Its project drops SuppressFinalPackageVersion and sets DisablePackageBaselineValidation instead, because no stable Aspire.Hosting.Go exists to validate against. Aspire.Hosting.Docker ([release/13.2] Stabilize Aspire.Hosting.Docker package #15377) and Aspire.Microsoft.Azure.StackExchangeRedis (Stablize Aspire.Microsoft.Azure.StackExchangeRedis #16005) made the same swap for their first stable release. The package's .NET public API becomes a stable contract.
  • The experimentalPolyglot* feature flag gating of Python, Go, Java and Rust is unchanged.
  • An empty AppHost from aspire new goes through the same scaffolder, so it gets the same defaults as the starter templates.
  • A starter template test keeps the static aspire.config.json of the TypeScript, Python and Go starters listing the default packages of their AppHost language.
  • docs/specs/polyglot-apphost.md documents the defaults.
  • One path_rules entry in eng/github-ci/test-trigger-map.yml routes the three hosting project files that DefaultHostingPackagesTests reads to Aspire.Cli.Tests, because MSBuild does not see that read. A row per project in TestTriggerMapTests guards it.

Part of #21045

Not in this PR

  • Default hosting packages for Java and Rust. Each language joins DefaultHostingPackages once its hosting package ships stable. When one joins, its project path also goes in the trigger-map rule above.
  • Brownfield Go (go.mod) and Rust (Cargo.toml) repositories still scaffold the AppHost at the repository root and report ProjectAlreadyExists. This is unchanged.

Validation

Commands ran on Windows from the worktree root, on top of upstream/main 5ea175ce62 at head 8d17e59bc5, with the repo-local SDK.

Command Exit Result
dotnet build src\Aspire.Cli\Aspire.Cli.csproj -m:2 --no-restore 0 0 warnings, 0 errors
dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.DefaultHostingPackagesTests" --filter-class "*.DefaultLanguageDiscoveryTests" --filter-class "*.InitCommandTests" --filter-class "*.ChannelReseedTests" --filter-class "*.ScaffoldingServiceTests" --filter-class "*.PackageJsonMergerTests" --filter-class "*.NewCommandTemplateConfigPersistenceTests" --filter-class "*.NewCommandTests" --filter-class "*.NewCommandChannelResolutionTests" --filter-class "*.JavaAppHostTemplateTests" --filter-class "*.JavaStarterScaffoldTests" --filter-class "*.AppHostServerSessionTests" --filter-class "*.GuestAppHostProjectTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" 0 481 passed, 0 failed, 0 skipped
dotnet build tests\Infrastructure.Tests\Infrastructure.Tests.csproj -m:2 --no-restore 0 0 warnings, 0 errors
dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.TestTriggerMapTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" 0 179 passed, 0 failed, 0 skipped
dotnet pack src\Aspire.Hosting.Go\Aspire.Hosting.Go.csproj -p:StabilizePackageVersion=true -p:SkipNativeBuild=true -o <temp dir> 0 Aspire.Hosting.Go.17.0.0.nupkg: stable version, and its only Aspire dependency is Aspire.Hosting 17.0.0, so no NU5104
The same pack with -p:DisablePackageBaselineValidation=false (control) 1 restore fails with NU1102: Unable to find package Aspire.Hosting.Go with version (= 13.6.1), so the new property is required

The Aspire.Cli.Tests classes cover the new mapping, the scaffolder, aspire init and aspire new, and the guest AppHost restore path that consumes the written config. The two guard tests are DefaultHostingPackages_AreStablePackagesBuiltByThisRepository (every default package is built from src/ and does not set SuppressFinalPackageVersion) and AllLanguages_LanguageWithAPreviewHostingPackageHasNoDefaultHostingPackages (Java and Rust have no default).

Trigger-map guard check: with only the Go path removed from the path_rules entry, the Go row of DefaultHostingPackageProjectsSelectCliStablePackageGuard failed with Not found: "Aspire.Cli.Tests" and the other two rows passed. With the path restored, all three rows passed.

Not run:

  • A real aspire init --language <lang> end to end. It needs packed dev packages to restore the hosting packages.
  • The CLI E2E tests, the rest of Aspire.Cli.Tests, and Linux/macOS.
  • The repo-wide stabilized pack and aspire init smoke that the CI Stabilization Check job runs. Only Aspire.Hosting.Go was packed this way.
  • .\restore.cmd on the final head. No dependency manifest changed since the last restore, and both builds used --no-restore.

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

aspire init --language <lang> scaffolded an AppHost without the hosting package its language almost always needs, so users had to run aspire add before they could use resource APIs such as AddViteApp. Only a TypeScript AppHost next to an existing package.json got Aspire.Hosting.JavaScript.

Add LanguageInfo.DefaultHostingPackages as the single language to package mapping and have the scaffolder write those packages to aspire.config.json before it collects the integrations, so they are restored and code generated together with the code generation package. TypeScript maps to Aspire.Hosting.JavaScript and Python to Aspire.Hosting.Python. Go, Java and Rust have no default yet: their hosting packages set SuppressFinalPackageVersion, so a stable CLI has only X.Y.Z-preview.* versions and pinning one to the CLI version fails to restore. A language gets a default once its hosting package ships stable. C# is unchanged: it declares packages as #:package directives. An existing entry for a package is kept, and the version is the SDK version, like the starter templates and aspire add.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Cover the TypeScript and Python mappings (restored with the code generation package and recorded in aspire.config.json at the SDK version), the CLI SDK version fallback, brownfield TypeScript, an existing package entry, a language without defaults, and the aspire init --language typescript command. Pin Go, Java and Rust to no defaults, and require every default package to be built from src and not to set SuppressFinalPackageVersion, so a preview-only package cannot become a default. A starter template test keeps the static aspire.config.json files listing the default packages of their AppHost language. FakeSucceedingAppHostServerProject now records the integrations it was prepared with.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Describe in the polyglot AppHost spec that aspire init and empty AppHost templates record the language default hosting packages in aspire.config.json, with the language to package table and the rule that a language gets a default once its hosting package ships stable.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
DefaultHostingPackagesTests reads the project file of each default hosting package, which MSBuild does not see. Route those project files to the Aspire.Cli.Tests target with a path rule and guard the routing in the trigger map tests.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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 -- 21191

Or

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

@github-actions

This comment has been minimized.

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

Case-sensitive package lookup can duplicate existing dependencies instead of preserving their configured versions or project references.

1 open issue
What changed in this PR

Adds language-specific hosting defaults to guest AppHost scaffolding, making resource APIs available without a separate aspire add.

Changes:

  • Defines TypeScript and Python defaults and adds them before restore and code generation.
  • Adds scaffolding, command, package-stability, and CI-routing tests.
  • Documents defaults and preview-package exclusions.
File Description
tests/​Infrastructure.Tests/​TestTriggerMap/​TestTriggerMapTests.cs Verifies hosting-project changes select CLI tests.
tests/​Aspire.Cli.Tests/​TestServices/​FakeSucceedingAppHostServerProject.cs Captures integrations for assertions.
tests/​Aspire.Cli.Tests/​Scaffolding/​DefaultHostingPackagesTests.cs Tests defaults, preservation, templates, and package stability.
tests/​Aspire.Cli.Tests/​Projects/​DefaultLanguageDiscoveryTests.cs Checks languages without defaults.
tests/​Aspire.Cli.Tests/​Commands/​InitCommandTests.cs Tests TypeScript defaults through init.
src/​Aspire.Cli/​Scaffolding/​ScaffoldingService.cs Adds language defaults before collecting integrations.
src/​Aspire.Cli/​Projects/​ILanguageDiscovery.cs Defines default hosting-package metadata.
src/​Aspire.Cli/​Projects/​DefaultLanguageDiscovery.cs Maps TypeScript and Python hosting packages.
eng/​github-ci/​test-trigger-map.yml Routes package-project inputs to CLI tests.
docs/​specs/​polyglot-apphost.md Documents default packages and exclusions.

Review effort: Balanced

The scaffolder compares the packages already in aspire.config.json with its default hosting packages ignoring case, because NuGet package ids are case-insensitive. A hand-edited lower-case entry is kept as is and no second entry is added for the same package.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@github-actions

This comment has been minimized.

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.

🟢 Approval recommended

The scoped changes preserve existing configuration and have focused regression coverage, with no unresolved blocking issues identified.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Scaffolding a Go AppHost now records Aspire.Hosting.Go in aspire.config.json,
like TypeScript and Python. The package is part of the Go AppHost GA, so it
ships a stable version: SuppressFinalPackageVersion is replaced with
DisablePackageBaselineValidation, because no stable Aspire.Hosting.Go exists
yet to validate against.

Part of #21045

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

First-time Go package stabilization needs human sign-off, and immediate use of generated default-package APIs lacks end-to-end regression coverage.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add CLI regression for clean TypeScript AppHost addViteApp type-checking

src/​Aspire.Cli/​Scaffolding/​ScaffoldingService.cs:126

Please add a CLI end-to-end regression that initializes a clean TypeScript AppHost and type-checks an addViteApp call before any aspire add, aspire restore, or aspire run. The new unit tests verify the config and integration list, but fake package preparation and code generation, so they do not verify that initialization produces usable default-package APIs. TypeScriptPolyglotTests.CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain adds the JavaScript package and runs restore before type-checking, which masks this gap. Add a focused scenario or an assertion before those steps.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

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.

🔵 Needs a closer look

Go stabilization establishes a supported API contract, and the default-package workflow still lacks end-to-end regression coverage without aspire add.

1 open issue

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

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.

Thanks, David. The scaffolding change looks correct to me: the default packages are written before the integrations are collected, so they're both persisted and restored. Existing entries are kept, and the old brownfield TypeScript pre-add is fully covered by the new mapping. The focused Aspire.Cli.Tests classes and TestTriggerMapTests pass locally on macOS.

To resolve before approval: this PR depends on shipping Aspire.Hosting.Go as a stable package (dropping SuppressFinalPackageVersion). That makes its .NET API a stable contract in the next release, while the Go AppHost language is still behind experimentalPolyglot:go. Could you confirm that release owners have signed off on stabilizing it in this release? If they haven't yet, consider splitting the stabilization into its own PR, with Go joining DefaultHostingPackages once it lands.

Other points:

  • The stable-package guard test matches raw csproj text (inline suggestion below).
  • Nothing exercises a stabilized non-C# aspire init restore today. eng/scripts/stabilization-smoke-init-restore.sh only scaffolds a C# AppHost, so a TypeScript aspire init step there would be a good follow-up to back the guard test.

…fault-language-packages

Resolve the InitCommandTests.cs conflict with #20946: keep this PR's new TypeScript hosting-package init test and take upstream's rename of the neighboring skill follow-up test to InitCommand_WhenBundledSkillsSelected_PrintsToolSpecificFollowUpCommands.

Co-authored-by: Copilot App <[email protected]>
@github-actions

This comment has been minimized.

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.

🟢 Approval recommended

No active review issues block the addition of language-specific hosting packages to guest AppHost scaffolding.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

Thanks for the replies, David. The only change since my last review is a merge from main; the PR's own changes are the same, and CI is green on ebb8158.

  • Guard test suggestion: your reasoning makes sense. Matching the bare name also catches conditioned or reformatted forms, so I'm dropping that one.
  • Still open, blocking approval: sign-off on shipping Aspire.Hosting.Go as stable. The reply on the csproj thread says this confirmation has to come from you or the release owners, and I don't see it on the PR yet. On main, Aspire.Hosting.Go still sets SuppressFinalPackageVersion, and Go is still IsExperimental in DefaultLanguageDiscovery, so this PR is what makes the package stable. Once you or a release owner confirm that it ships stable in this release, I'm happy to approve. The rest of the change looks correct.

Follow-up, not blocking: the stabilization smoke script (eng/scripts/stabilization-smoke-init-restore.sh) only scaffolds a C# AppHost, so a TypeScript aspire init step there would back the guard test end to end.

…fault-language-packages

Resolve the InitCommandTests.cs conflict with #20947: keep this PR's new TypeScript hosting-package init test and take upstream's rename of the neighboring follow-up test to InitCommand_WhenAspireSelected_PrintsToolSpecificFollowUpCommands.

Co-authored-by: Copilot App <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Tests selector

4 / 100 PR test projects · 4 PR jobs, from 10 changed files.

Selected PR test projects (4 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Hosting.Go.Tests, Infrastructure.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

🔧 src/Aspire.Hosting.Go/Aspire.Hosting.Go.csproj (changed source)
→ 2 directly: Aspire.Cli.Tests, Aspire.Hosting.Go.Tests

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

📄 eng/github-ci/test-trigger-map.yml (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/DefaultLanguageDiscoveryTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Scaffolding/DefaultHostingPackagesTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/TestServices/FakeSucceedingAppHostServerProject.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Infrastructure.Tests/TestTriggerMap/TestTriggerMapTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Projects/DefaultLanguageDiscovery.cs, src/Aspire.Cli/Projects/ILanguageDiscovery.cs, src/Aspire.Cli/Scaffolding/ScaffoldingService.cs, src/Aspire.Hosting.Go/Aspire.Hosting.Go.csproj
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit dee8c7b.

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.

🟢 Approval recommended

No active review issues block the change to include language-specific hosting packages when scaffolding guest AppHosts.

No open issues 🎉

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@IEvangelist
David Pine (IEvangelist) merged commit b8dabd6 into main Nov 4, 2026
424 of 428 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 4, 2026
David Pine (IEvangelist) added a commit that referenced this pull request Nov 4, 2026
…ve-experimental-flag

Resolve the DefaultLanguageDiscovery.cs conflict with #21191: keep main's DefaultHostingPackages for the Go language and drop IsExperimental, since Go no longer has a feature flag.

Co-authored-by: Copilot App <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2052

Generated by PR Documentation Check · copilot · auto · 26.7 AIC · ⌖ 1.16 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2052 targeting release/17.0.

Documented default hosting packages recorded by aspire init --language <lang> in aspire-init.mdx. Triggered signal: pr_body_has_cli_flag_mention (PR body describes aspire init --language <lang> scaffolding behavior and the language-to-package table).

Note

This draft PR needs human review before merging.

David Pine (IEvangelist) added a commit that referenced this pull request Nov 5, 2026
> [!IMPORTANT]
> **Merge last.** This PR depends on the other open Go AppHost PRs and
must land after them.
>
> - **Must land first**, because each adds references to the flag that
this PR has to delete: #21189 (E2E helper and call sites), #21195
(`SdkExportCommandTests`) and #21196 (`GoAppHostToolingCheck` and its
tests).
> - **Must land first**, because it edits the same hunk of
`DefaultLanguageDiscovery.cs` and this PR rebases onto it: #21191.
> - **Should land first**, because removing the flag turns Go on for
everyone and these fixes should ship before it: #21186, #21187, #21188,
#21193, #21194, #21197 and #21199.

## Description

Removes the `experimentalPolyglotGo` feature flag so Go AppHosts are
available by default, the same way TypeScript AppHosts are. With no
flag, **Empty (Go AppHost)** and **Starter App (Go API + Redis, Go
AppHost)** are offered by interactive and non-interactive `aspire new`,
and Go is offered by `aspire init` language selection and `--language
go`.

**This is the GA switch for the Go AppHost epic (#21115) and must merge
last**, after the other children have landed: #21108 (E2E, publish,
deploy), #21110 (support policy, API review, packaging), #21112 (docs
and samples) and #21114 (VS Code debugging). It was opened as a draft so
CI exercises the 52 Go fixtures without the flag. It is ready for review
now, but not for merging.

What changed:

- **CLI:** `KnownFeatures` drops the Go flag and
`DefaultLanguageDiscovery` no longer marks Go experimental.
`LanguageInfo.IsExperimental` is kept because Python, Java and Rust
still use it.
- **Leftover key:** a stale `experimentalPolyglotGo` in a user's
configuration is ignored with no warning, matching what happened to the
TypeScript flag when it was removed. `Features` only reads named keys,
and the extension schemas set `additionalProperties: false`, so VS Code
flags the stale key.
- **Extension schemas:** `aspire-config`, `aspire-global-settings` and
`aspire-settings` are regenerated with
`extension/scripts/generate-schema.js`. Only the 16-line Go block is
removed from each.
- **Fixtures and CI:** 52
`tests/PolyglotAppHosts/*/Go/aspire.config.json` files and
`.github/workflows/polyglot-validation/Dockerfile.golang` no longer set
the key.
- **Java E2E picker offsets:** Go is always listed now, so with only the
Java flag set the `aspire init` language picker is C#, TypeScript, Go,
Java, and Java needs 3 Down presses instead of 2. The first CI run on
this PR timed out waiting for `> Java` in `JavaPolyglotTests`,
`JavaCodegenValidationTests` and `JavaPolyglotApphostDirectoryTests`;
each now presses Down once more, with a comment stating the picker
order. The order comes from `DefaultLanguageDiscovery`,
`LanguageService` and `CliTemplateFactory`. TypeScript flows are
unaffected because TypeScript sorts before Go.
- **Tests:** `DefaultLanguageDiscoveryTests`, `NewCommandTests`,
`ConfigCommandTests`, `NewCommandTemplateConfigPersistenceTests` and
`InitCommandTests` now expect Go without the flag, with 6 new tests. One
of them, `GetAvailableLanguagesAsync_ListsLanguagesInPickerOrder`, pins
the picker order so a future ungated language fails a unit test before
it breaks a Docker E2E run.
- **Docs:** `docs/specs/polyglot-apphost.md`, the Go code generation
README and `playground/GoAppHost/apphost.go` no longer mention the flag.

Fixes #21106

## Validation

| Command | Result |
| --- | --- |
| `.\restore.cmd` | passed |
| `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj -m:2
--no-restore` | 0 warnings, 0 errors |
| `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class "*.DefaultLanguageDiscoveryTests"
--filter-class "*.NewCommandTests" --filter-class "*.ConfigCommandTests"
--filter-class "*.NewCommandTemplateConfigPersistenceTests"
--filter-class "*.InitCommandTests" --filter-not-trait
"quarantined=true" --filter-not-trait "outerloop=true"` | 312 passed, 0
failed (run before the picker-order test was added) |
| `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class "*.DefaultLanguageDiscoveryTests"
--filter-not-trait "quarantined=true" --filter-not-trait
"outerloop=true"` | 39 passed, 0 failed (38 existing plus the
picker-order test) |
| `node extension\scripts\generate-schema.js` | only the Go block was
removed from each schema |
| repository-wide search for `experimentalPolyglotGo` and its variants |
0 hits |
| JSON parse of the 53 fixtures and 3 schemas | all parse, none contain
the flag |

Run in PR CI instead of locally, all passing on `0e65752d44`: the three
Java E2E tests (`JavaPolyglotTests`, `JavaCodegenValidationTests` and
`JavaPolyglotApphostDirectoryTests`; they need Docker, so CI was the
first execution of the extra Down press), `Infrastructure.Tests` and the
VS Code extension unit and E2E jobs.

Not run: the VS Code new-project flow in an extension host
(`extension/src/commands/new.ts` just runs `aspire new`).

### Before merging

- [ ] Search again for `experimentalPolyglotGo`,
`KnownFeatures.ExperimentalPolyglotGo`,
`EnableExperimentalGoSupportAsync`, `features__experimentalPolyglotGo`
and `experimentalPolyglot:go`, because open Go branches add flag setup
of their own and this PR must merge after all of them. Today that covers
#21189 (the `EnableExperimentalGoSupportAsync` helper and its call sites
in every Go scenario), #21195 (`SdkExportCommandTests` sets
`KnownFeatures.ExperimentalPolyglotGo`) and #21196
(`GoAppHostToolingCheckTests` builds its language discovery with the
flag, including a `goEnabled: false` case that stops being meaningful,
and `GoAppHostToolingCheck` has a comment that describes the flag). Each
of them stops compiling or goes stale once the flag is removed, so
delete or rewrite them here.
- [ ] Rebase onto #21191, which adds `DefaultHostingPackages =
["Aspire.Hosting.Go"]` to Go's `LanguageInfo` in the same hunk of
`DefaultLanguageDiscovery.cs` (#21045). Keep that initializer and drop
`IsExperimental: true`.
- [ ] Drop the Go experimental notes in the aspire.dev API reference and
docs at the same time.

## Checklist

- Is this feature complete?
  - [ ] Yes. Ready to ship.
  - [x] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
  - [x] No

---------

Co-authored-by: David Pine <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
David Pine (IEvangelist) pushed a commit to microsoft/aspire.dev that referenced this pull request Nov 12, 2026
Documents changes from microsoft/aspire#21191

Author: @(PR author; see source PR)

**Target branch:** Targeting `release/17.0` based on the source PR
milestone `17.0` (`exact_match`).

## Why
`aspire init --language <lang>` now records default hosting packages
(e.g. `Aspire.Hosting.JavaScript` for TypeScript,
`Aspire.Hosting.Python`, `Aspire.Hosting.Go`) in the AppHost
`aspire.config.json`. The triggered signal was
`pr_body_has_cli_flag_mention`. The reference page didn't describe this.

## Changes
Updated (no new pages):
-
`src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx`:
added a "Default hosting packages" section with a language-to-package
table.

> Generated by [PR Documentation
Check](https://github.com/microsoft/aspire/actions/runs/41871882754) for
#21191 · copilot · auto · 26.7 AIC · ⌖ 1.16 AIC · ⊞ 7.4K ·
[◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot,
model: auto, id: 41871882754, workflow_id: pr-docs-check, run:
https://github.com/microsoft/aspire/actions/runs/41871882754 -->

<!-- gh-aw-workflow-id: pr-docs-check -->
<!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check -->

---------

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: alistairmatthews <[email protected]>
Co-authored-by: AJ Matthews <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants