Skip to content

Close Go AppHost CLI preview readiness gaps - #21823

Merged
David Pine (IEvangelist) merged 3 commits into
mainfrom
ievangelist-go-apphost-epic
Nov 6, 2026
Merged

David Pine (IEvangelist) merged 3 commits into
mainfrom
ievangelist-go-apphost-epic

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Description

Go AppHost initialization should work in an existing Go repository without replacing its module or requiring edits to its workspace. This creates a separate aspire-apphost/ module/workspace when the root already contains go.mod, preserves the application's files, and records the nested AppHost path in configuration.

Contributes to #21115, #21201, #21207 and #21208. These are umbrella issues; this PR does not close their remaining work.

Also:

  • Removes the incomplete language list from aspire init --help and updates generated localization resources and the reviewed help snapshot.
  • Makes the TypeScript doctor check honor a configured non-TypeScript AppHost, while preserving the migration resolver's legacy discovery behavior.
  • Corrects the Go toolchain warning to acknowledge installed toolchains on PATH, and extends the minimum-version guard to the Go starter modules and hosting fallback. Includes the new runtime-read test-selection edge.
  • Enables response decompression for both documentation HTTP clients.
  • Excludes dev-server build output from SDK default items so copied file-based C# sources cannot enter subsequent server compilations.

User-facing usage

From an existing Go repository:

aspire init --language go --non-interactive --suppress-agent-init

The existing go.mod, go.work and source files stay unchanged. New AppHost files live in aspire-apphost/, and root configuration selects aspire-apphost/apphost.go. Its local go.work isolates it from an ancestor workspace that does not list the new module. Explicit user GOWORK overrides are unchanged.

Updated help:

--language <language>  The programming language for the AppHost

Validation

All commands ran on Windows unless noted. MSBUILDTERMINALLOGGER=false was set for .NET validation.

  • .\restore.cmd — passed; restore reported dependency-advisory warnings.
  • dotnet build src\Aspire.Cli\Aspire.Cli.csproj --no-restore -t:UpdateXlf -v:quiet — passed, no warnings/errors.
  • dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.ScaffoldingServiceTests' --filter-class '*.GoAppHostToolingCheckTests' --filter-class '*.TypeScriptAppHostToolingCheckTests' --filter-class '*.InitCommandTests' --filter-class '*.DotNetBasedAppHostServerScaffoldCacheTests' --filter-class '*.ProgramTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 253 tests. The initial run identified the intended help snapshot change and two new-test setup issues, which were corrected before this passing run.
  • dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.GoAppHostToolingCheckTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 61 tests after the final guard scope adjustment.
  • dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-class 'Infrastructure.Tests.TestTriggerMap.TestTriggerMapTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 174 tests.
  • The documented full --filter-namespace 'Infrastructure.Tests.TestTriggerMap' run did not complete successfully and was stopped after shell-dependent failures. Prepending Git Bash did not repair the Windows process launch: the unchanged comparison-base tests still invoked the WSL Bash shim. Control C:\Windows\System32\bash.exe --version reproduces the missing /bin/bash failure; comparison-base script/test inputs have no diff against origin/main. This is not a full selector-suite pass.
  • .\.dotnet\dotnet.exe artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.dll init --help --nologo — passed; confirms updated help.
  • A scratch Linux Docker smoke with Go 1.26.10, GOPROXY=off GOTOOLCHAIN=local, root and nested workspaces, and an AppHost-shaped local SDK replacement passed root/nested module resolution, go build ./..., go vet ./... and go run .. This checks Go workspace semantics, not a full Aspire E2E run.
  • .\.dotnet\dotnet.exe msbuild <scratch>\smoke.csproj -getItem:Compile -nologo — passed: only Program.cs was included with an invalid file-based build/Gateway.cs present. A full repeated Blazor AppHost restore was not run.
  • curl.exe --silent --show-error --location --header 'Accept-Encoding: br' --output NUL --write-out 'sitemap HTTP %{http_code}, downloaded %{size_download} bytes\n' https://aspire.dev/sitemap-0.xml — HTTP 200, 678,572 bytes. Unit coverage verifies both registered clients enable automatic decompression; this curl measurement is endpoint evidence, not a CLI transfer trace.
  • git diff --check — passed.

Not included: Rust workspace behavior; Python/Java/Rust doctor checks; shared language-discovery redesign; bundle-mode performance measurements; changing Go SDK timestamp preservation; GA support/compatibility policy. The existing empty-directory Go toolchain probe is deliberately retained. Separate product PRs cover runtime/export, extension, CI/scenarios and publish validation. Root-module CLI E2E coverage is being added separately and requires this CLI behavior.

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

Isolate brownfield Go AppHosts, tighten doctor diagnostics, and address documentation and dev-server build regressions.

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

github-actions Bot commented Nov 5, 2026

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 -- 21823

Or

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

@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

The regression test passes without the resolver fix because the local C# AppHost prevents TypeScript discovery, so the configured C# AppHost must be moved outside the scanned directory to expose the regression.

1 open issue
1 file not reviewed
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file
What changed in this PR

This PR addresses CLI gaps for Go AppHost preview readiness, chiefly enabling initialization in existing Go repositories without replacing their module or workspace.

Changes:

  • Creates an isolated nested Go AppHost and records its path in configuration.
  • Updates initialization help, doctor behavior, Go version guards, and test-selection routing.
  • Enables documentation response decompression and excludes dev-server build artifacts from default project items.
File Description
tests/​Infrastructure.Tests/​TestTriggerMap/​TestTriggerMapTests.cs Covers routing for the hosting Go version fallback.
tests/​Aspire.Cli.Tests/​Snapshots/​InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt Updates the help snapshot.
tests/​Aspire.Cli.Tests/​Scaffolding/​ScaffoldingServiceTests.cs Tests nested Go scaffold paths.
tests/​Aspire.Cli.Tests/​Projects/​DotNetBasedAppHostServerScaffoldCacheTests.cs Checks generated build-artifact exclusions.
tests/​Aspire.Cli.Tests/​ProgramTests.cs Checks both documentation clients enable decompression.
tests/​Aspire.Cli.Tests/​Commands/​TypeScriptAppHostToolingCheckTests.cs Adds coverage for a configured non-TypeScript AppHost.
tests/​Aspire.Cli.Tests/​Commands/​InitCommandTests.cs Tests preservation of existing Go files and nested configuration.
tests/​Aspire.Cli.Tests/​Commands/​GoAppHostToolingCheckTests.cs Extends version guards and updates warning expectations.
src/​Aspire.Cli/​Utils/​EnvironmentChecker/​TypeScriptAppHostToolingCheck.cs Honors the configured AppHost language.
src/​Aspire.Cli/​Utils/​EnvironmentChecker/​GoAppHostToolingCheck.cs Clarifies PATH lookup before toolchain downloads.
src/​Aspire.Cli/​Scaffolding/​ScaffoldingService.cs Creates a nested Go module with its own workspace.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.zh-Hant.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.zh-Hans.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.tr.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ru.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.pt-BR.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.pl.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ko.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ja.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.it.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.fr.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.es.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.de.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.cs.xlf Refreshes help source; marks translation for review.
src/​Aspire.Cli/​Resources/​InitCommandStrings.resx Removes the incomplete language list from help.
src/​Aspire.Cli/​Resources/​InitCommandStrings.Designer.cs Aligns the resource documentation comment.
src/​Aspire.Cli/​Projects/​DotNetBasedAppHostServerProject.cs Excludes build/** from SDK default items.
src/​Aspire.Cli/​Program.cs Configures decompression for documentation clients.
eng/​github-ci/​test-trigger-map.yml Routes hosting version changes to CLI tests.
docs/​specs/​polyglot-apphost.md Documents nested Go initialization and workspace isolation.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 5, 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.

## Description

Add focused product coverage for initializing a Go AppHost in a
repository that already has a root Go module, with and without a root
`go.work`. The existing application must remain buildable while the
generated AppHost is independently buildable and runnable under
`aspire-apphost`.

**Merge dependency: #21823 must merge first.** This PR targets
`ievangelist-go-apphost-epic` and depends on parent CLI commit
`b959c96fcb`, which detects a root `go.mod`, nests the AppHost, and
supplies a nested `go.work` containing `go 1.26` and `use .`. This is a
separate, implementation-dependent test PR; it does not duplicate the
CLI implementation.

The two theory cases verify byte-for-byte preservation of root `go.mod`,
`main.go`, and an existing `go.work` (or its continued absence). They
assert nested `apphost.go`, `go.mod`, and `go.work`, build the original
module, then restore, build, vet, start, and stop the nested host
without overriding `GOWORK`. The test uses the existing Go Docker image
and terminal/lifecycle helpers, with workspace capture on failure.

Only `tests/Aspire.Cli.EndToEnd.Tests/GoRootModuleInitTests.cs` is
added. Existing graph attribution selects CLI E2E tests, and existing
`Go*` class discovery supplies the prebuilt Go image; no routing changes
are required.

Relates to #21201.

### Validation

- `.\restore.cmd` — passed; installed the repository-pinned SDK and
restored the repository.
- `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore --verbosity quiet` — passed with 0 warnings and 0 errors.
- `dotnet test --project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-build --no-launch-profile --list-tests -- --filter-class
'*.GoRootModuleInitTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed; discovered both
`hasWorkspace: False` and `hasWorkspace: True`. Discovery only, not
lifecycle execution.
- `dotnet run --project tools\SelectTests -- --from b959c96
--explain` — passed; the single changed file is graph-attributed to
`Aspire.Cli.EndToEnd.Tests`, with no unattributed files or run-all
fallback.
- `git diff --cached --check` — passed before commit.
- An initial discovery invocation put `--list-tests` after `--` and
failed with an SDK/test-host discovery-mode mismatch (exit 12); the
corrected invocation above passed.

**Linux lifecycle execution is explicitly unvalidated locally.** This
host is Windows; the Hex1b scenarios require Linux, and no Linux
CLI/archive containing parent commit `b959c96fcb` was available. The
older shared stable consumer archive does not contain the nesting fix
and was not used. PR CI must execute both cases using this PR's CLI
artifacts; build and discovery do not establish lifecycle success.
Auto-merge is not enabled.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] 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: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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 were identified for the Go AppHost initialization improvements and related CLI fixes.

1 open issue
1 file not reviewed
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 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.

@mitchdenny

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

  • PR: microsoft/aspire#21823 — Close Go AppHost CLI preview readiness gaps
  • Head commit: cc4e33f96474c3f784f1bed9686f5808de08ea12
  • Tested at: 2026-11-06, approximately 03:20–03:25 UTC
  • Execution target: Repository PR container runner, Ubuntu 24.04, Linux arm64, Docker Desktop on macOS
  • Scope: Dogfood artifact scenarios plus inspection of actual CI result/selection artifacts. No repository code modified.

Artifact Version Verification

  • Expected commit: cc4e33f96474c3f784f1bed9686f5808de08ea12
  • Installed version: 17.0.0-pr.21823.gcc4e33f9
  • Installed binary: /workspace/.aspire/dogfood/pr-21823/bin/aspire
  • Installation: The PR comment's standard dogfood command, executed inside eng/scripts/aspire-pr-container/run-aspire-pr-container.sh.
  • Status: Verified; the version contains the expected short SHA. The PR head was rechecked after the scenarios and was unchanged.
  • Prerequisites: Go 1.26.3 for lifecycle scenarios; Go 1.24.1 for older-toolchain checks. Both downloaded from go.dev into the temporary workspace.

The install succeeded. Its actual binary location was the dogfood-specific path above, not /workspace/.aspire/bin/aspire; all scenario commands used the verified binary. VS Code was absent, so the installer skipped extension installation.

Changes Analyzed

Files Changed

  • src/Aspire.Cli/Scaffolding/ScaffoldingService.cs: Nested Go module/workspace scaffolding.
  • src/Aspire.Cli/Utils/EnvironmentChecker/{GoAppHostToolingCheck,TypeScriptAppHostToolingCheck}.cs: Toolchain warning and selected-language handling.
  • src/Aspire.Cli/Program.cs: Documentation HTTP decompression.
  • src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs: Exclude build/** from SDK default items.
  • src/Aspire.Cli/Resources/InitCommandStrings.resx, matching designer/XLIFF files, and help snapshot: Language help text.
  • eng/github-ci/test-trigger-map.yml: Runtime-read dependency from the hosting Go version detector to CLI tests.
  • Matching CLI unit tests, GoRootModuleInitTests.cs, and TestTriggerMapTests.cs.
  • docs/specs/polyglot-apphost.md: Nested Go layout documentation.

Change Categories

  • CLI behavior, generated projects, and documentation clients
  • Test-selection configuration and regression tests
  • Documentation/localization
  • Hosting integration implementation changes
  • Dashboard implementation changes
  • VS Code extension changes
  • Azure DevOps pipeline changes

Test Scenarios Executed

1. Existing root Go module without a workspace

Coverage: Happy path. Status: Passed.

Created a fresh module containing go.mod and main.go, with byte-for-byte reference copies. Ran:

aspire init --language go --non-interactive --suppress-agent-init --use-config-source false
go build ./...
cd aspire-apphost
aspire restore --non-interactive
go build ./...
go vet ./...
aspire start --isolated --format json --non-interactive --apphost /workspace/root-module/aspire-apphost/apphost.go
aspire describe --format json --non-interactive --apphost /workspace/root-module/aspire-apphost/apphost.go
aspire stop --non-interactive --apphost /workspace/root-module/aspire-apphost/apphost.go

All commands passed. Original application files were unchanged. Root configuration selected aspire-apphost/apphost.go, pinned the tested PR SDK/channel, and recorded the Go hosting package. The nested workspace contained go 1.26 and use .. The AppHost started, reported an empty resource model as expected, and stopped successfully.

Evidence: pr-21823-root-module-standard.log.

2. Existing root Go module with an ancestor workspace

Coverage: Boundary/happy path. Status: Passed.

Created a separate fresh module with root go.work containing use .. Repeated init, root/nested builds, restore, vet, start, describe, and stop. Compared original go.mod, main.go, and go.work byte-for-byte. Verified go env GOWORK selected /workspace/parent-workspace/aspire-apphost/go.work, without setting GOWORK.

The dashboard returned HTTP 200 after following its normal login redirect. All lifecycle operations passed. Initial test-harness code incorrectly required the login URL's first response to be 200; it returned 302. Following redirects corrected the assertion; this was not a product failure.

Evidence: pr-21823-scenarios.log (initial creation), pr-21823-scenarios-final.log (completed lifecycle).

3. Reinitialization

Coverage: Boundary/idempotency. Status: Passed.

Reran init on the completed parent-workspace project. It reported the existing nested AppHost and skipped scaffolding. AppHost source, root configuration, root module, and root workspace remained byte-for-byte unchanged.

Evidence: pr-21823-scenarios-final.log.

4. Conflicting nested module

Coverage: Unhappy path. Status: Passed.

Created another root Go module with a pre-existing, different aspire-apphost/go.mod but no AppHost source. Init returned exit code 4 with an overwrite-conflict diagnostic. Both module files remained unchanged and no apphost.go was written.

Expected safe outcome: Nonzero exit without overwriting user files. Observed as expected.

Evidence: pr-21823-scenarios-final.log.

5. Fresh Go project

Coverage: Happy path/regression. Status: Passed.

aspire new aspire-go-empty --name FreshGo --output /workspace/fresh-go \
  --source /workspace/.aspire/hives/pr-21823/packages \
  --version 17.0.0-pr.21823.gcc4e33f9 \
  --localhost-tld false --suppress-agent-init --non-interactive --use-config-source false

Project creation, aspire restore, go build ./..., go vet ./..., isolated start, describe, and stop all passed. This was an empty AppHost smoke test, not a workload/container connectivity test.

Evidence: pr-21823-scenarios-final.log.

6. Doctor ignores an unselected TypeScript AppHost

Coverage: Negative selection. Status: Passed.

Added an unrelated root apphost.mts and package.json declaring unsupported Yarn Classic (yarn@1.22.22) beside the root configuration selecting the nested Go AppHost. Ran aspire doctor --format json --non-interactive.

Doctor exited 0, emitted the Go tooling check for the selected nested AppHost, and emitted no typescript-apphost-* check. Its summary was 6 passed, 3 warnings, 0 failed. Warnings concerned container certificate trust/certutil, not TypeScript or Go tooling.

Evidence: pr-21823-scenarios-final.log, scenario-evidence/doctor.json.

7. Older Go toolchain behavior

Coverage: Unhappy path/boundary. Status: Passed.

Ran doctor with actual Go 1.24.1 first on PATH:

  • GOTOOLCHAIN=local: Exit 1; diagnostic explained that local mode prevents switching toolchains.
  • GOTOOLCHAIN=auto: Exit 0 with a warning containing the revised message that Go uses a newer toolchain from PATH or downloads it.

This checks diagnostics with a real older Go executable; it does not prove that a later AppHost launch downloads or selects a newer executable.

Evidence: pr-21823-toolchain.log, scenario-evidence/doctor-go124-{local,auto}.json.

8. Help and documentation clients

Coverage: Happy path plus missing-page error. Status: Passed.

  • aspire init --help: Described --language without the incomplete C#/TypeScript-only list.
  • aspire docs list --format json --non-interactive: Returned valid JSON with 602 pages.
  • aspire docs api search redis --format json --non-interactive: Returned valid JSON with 5 results.
  • aspire docs get pr21823-page-that-does-not-exist --non-interactive: Returned exit 1 and a missing-page diagnostic.

Live retrieval exercises both registered clients. No wire capture was taken, so successful retrieval alone is not claimed as proof that either response was compressed. The matching CI unit tests checking automatic decompression both passed.

Evidence: pr-21823-command-help.log, pr-21823-scenarios-final.log, scenario-evidence/{docs-list.json,api-search.json,docs-missing.txt}.

CI Infrastructure Validation

Run: CI run 42135355787, attempt 2, completed successfully at the tested head.

  • Actual selector output: Downloaded select-tests-selection-Linux. Its inputs.changeSource compares the documented merge base to cc4e33f96474c3f784f1bed9686f5808de08ea12. It selects the CLI, CLI E2E, and Infrastructure test projects and the four expected PR jobs. It lists no unattributed files; the documentation file is explicitly excluded.
  • Runtime-read edge: Downloaded and parsed Infrastructure TRX results: 2,054 passed, 0 failed. All three GoVersionInputsSelectCliMinimumGoVersionGuard cases passed, including src/Aspire.Hosting.Go/GoVersionDetector.cs.
  • Go E2E: Downloaded and parsed the actual GoRootModuleInitTests TRX: 2 passed, covering hasWorkspace: True and False.
  • CLI unit evidence: Downloaded Linux CLI TRX: 10,133 passed, 59 not executed, 0 failed. Confirmed both documentation decompression cases, the generated default-item exclusion test, and all minimum-Go-version guard cases passed.
  • Dependency graph: The changed map adds a runtime-read source-file edge to Aspire.Cli.Tests; it does not alter artifact producers, workflow triggers, permissions, action pins, enumeration, or matrix shape. Production selector output and the real-map regression establish the affected route. No additional workflow dispatch was necessary.
  • Retrieval limitation: The workflow jobs-list endpoint repeatedly returned HTTP 502. Run metadata and downloadable selection/TRX artifacts were available and inspected directly; results above are based on those artifacts, not just the overall green conclusion.
  • gh-aw / Azure DevOps: Not applicable; no generated workflows or Azure Pipelines changed.

Evidence: ci-evidence/{selection.json,infrastructure.trx,go-root.trx} and downloaded CI ZIPs.

Remaining Coverage Limits

  • A full repeated source-development Blazor AppHost server build was not run. The Linux runner has no .NET SDK, and normal dogfood execution uses the bundled server rather than DotNetBasedAppHostServerProject. Its passing CI test verifies the generated DefaultItemExcludes property, not the second compilation after Gateway.cs is copied into output.
  • No dashboard browser screenshots were taken; dashboard reachability was checked over HTTP. No dashboard code changed.
  • No workload resource connectivity, extension behavior, publishing/deployment, or cross-platform lifecycle matrix was tested.
  • The employee-default configuration-source prompt required an explicit --use-config-source false in non-interactive init/new commands. The first init exited safely before scaffolding without that flag. This is setup behavior outside this PR's changes.

Summary

Scenario Result
Existing Go module without root workspace Passed
Existing module with root workspace; dashboard/lifecycle Passed
Reinitialization preserves existing files Passed
Conflicting nested module safely rejected Passed
Fresh Go template and lifecycle Passed
Doctor ignores unrelated TypeScript tooling Passed
Older Go local/automatic-toolchain diagnostics Passed
Help, docs/API retrieval, missing-page failure Passed
CI selector route and new Go E2E results Passed; artifacts inspected
Repeated source-development Blazor server build Not run

Overall Result

All executed scenarios passed; no new product failure observed. Verification is partial for the source-development build exclusion.

Before treating that particular fix as end-to-end verified, run the source-development server twice with the Blazor integration and confirm copied build/Scripts/Gateway.cs is not compiled on the second build.

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the changes and tested the matching PR CLI artifact. All executed scenarios passed; detailed results and coverage limits are in #21823 (comment).

@mitchdenny

Copy link
Copy Markdown
Member

Non-blocking follow-up: add Go AppHost deployment E2E coverage under tests/Aspire.Deployment.EndToEnd.Tests/, deploying to Azure Container Apps (ACA) at a minimum. Local start/stop and generated manifests do not establish that the deployed application works.

Suggested scenarios:

  1. A fresh Go AppHost with a real Go HTTP service: deploy to ACA and verify the public endpoint returns the expected response.
  2. An existing Go repository initialized into aspire-apphost/, with and without a root go.work: deploy the existing application from that layout, verify the live ACA endpoint, and assert the original module/workspace files remain unchanged.
  3. A multi-resource Go application: verify deployed service-to-service connectivity and configuration/connection wiring, then redeploy a change and verify the updated response.

Use the existing deployment harness with unique resource groups, capture deployment diagnostics, and clean up resources even when assertions fail. These are suggested follow-up tests; no Azure deployment was performed in this PR testing run.

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

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

3 / 101 PR test projects · 4 PR jobs, from 30 changed files.

Selected PR test projects (3 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Infrastructure.Tests

Selected PR jobs (4)

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


How these were chosen — grouped by what changed

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

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

🔧 src/Aspire.Cli/Resources/InitCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

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

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

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

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

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

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

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

🧪 tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt (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/Program.cs, src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs, src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs, src/Aspire.Cli/Resources/InitCommandStrings.resx, src/Aspire.Cli/Resources/xlf/InitCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hant.xlf, src/Aspire.Cli/Scaffolding/ScaffoldingService.cs, src/Aspire.Cli/Utils/EnvironmentChecker/GoAppHostToolingCheck.cs, src/Aspire.Cli/Utils/EnvironmentChecker/TypeScriptAppHostToolingCheck.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 1c510a2.

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

Full runtime validation remains unreported for the Go root-module/workspace E2E and repeated Blazor dev-mode restore paths, which the stand-in SDK and MSBuild item-evaluation probes do not fully exercise.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 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 8e264bf into main Nov 6, 2026
431 of 434 checks passed
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2073

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

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

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

Updated aspire-init.mdx to document that aspire init --language go in an existing Go repo creates a nested aspire-apphost/ module/workspace and leaves the existing module untouched. Signals: cli_resource_strings_changed (InitCommandStrings.resx), pr_body_has_cli_flag_mention, pr_body_has_user_facing_section (User-facing usage section).

Note

This draft PR needs human review before merging.

David Pine (IEvangelist) added a commit that referenced this pull request Nov 6, 2026
## Description

Go starters should build from their shipped files without an initial
`aspire run` repairing dependencies, and Go preview validation should
exercise the same runtime and native-runner paths as other AppHosts.

- Ship a tidy API `go.mod` and generated `go.sum`. Add starter scenarios
checking gitignore, readonly API build, tidy stability, health and
weather responses; remove the Kubernetes manual-tidy workaround.
- Honor the existing `--use-redis-cache false` option for Go.
Omitted/true retains Redis; false omits the integration and resource.
Cover all three scaffold choices with generated-source snapshots and
both HTTP lifecycle variants with Docker E2E.
- Add `go vet` to Go polyglot fixtures, an EF Core fixture, and Foundry
tool/AKS node-pool parity. Exercise configuration-section list getters
in the real Go runtime smoke.
- Add Go to all six native starter-validation platforms, with official
checksum-verified Go installation, timeout budget, and runtime-only
selector edges for Go hosting, Go codegen, and Redis. Linux retains
API/Redis readiness; containerless Windows/macOS use the cache-free
starter with API readiness unchanged.
- Add isolated-local-feed Go/Java scaffolding and restore to the
stabilization smoke without rewriting template pins. Use a genuine
Release bundled driver outside repository mode, cold consumer caches,
and exact hosting-package extraction/provenance checks. Enable Java only
in its subprocess.
- Select languages by name rather than picker position. Restore stale
Java/TypeScript SDK baselines after `aspire add` so the following
`aspire restore` genuinely tests regeneration. Establish the TypeScript
baseline with an actual restore before reading cache metadata.
- Wait for the TypeScript Kubernetes application's actual Ready pod;
exercise the Go Helm namespace/chart-version callback.

Relates to #21202, #21206, #21209, #21210, #21201, and #21108.

### User-facing usage

```bash
# Default retains Redis.
aspire new aspire-go-starter --name GoReady --non-interactive --suppress-agent-init

# Containerless starter: the Go API runs without Redis or a Docker daemon.
aspire new aspire-go-starter --name GoReady --use-redis-cache false --non-interactive --suppress-agent-init
```

Both variants emit `api/go.sum` and an already-tidy API module. Its API
can build with `go build -mod=readonly` without first running the
AppHost's tidy resource.

### Dependencies and remaining acceptance

This PR is independent of #21823. Root-module brownfield E2E #21825
merged into the #21823 feature branch, not directly into main; its
delivery follows #21823. #21806 independently covers other Go
init/build/vet/stable-restore scenarios.

The existing stabilization gate remains disabled
(`STABILIZATION_ENABLED: 'false'`); enabling it needs a separate
CI/policy decision. Current `Aspire.Hosting.Java.csproj` still sets
`SuppressFinalPackageVersion=true` while the Java starter pins the
requested Aspire version. The corrected smoke reaches actual NuGet
restore and exposes that mismatch: `Aspire.Hosting.Java (= 17.0.0)` is
unavailable, the nearest local package is `17.0.0-dev`, and nuget.org
versions are not considered. No pin substitution or Java release-policy
change is included.

Native Linux validation built the genuine stabilized Release CLI/payload
and proved cold Go/Redis package restore and C# restore. This is **not a
clean stabilization pass**: the unsuppressed stable pack first
reproduced NU5104 on existing .NET 11 preview dependencies. The
diagnostic consumer feed downgraded only NU5104 with
`WarningsNotAsErrors=NU5104`; that exception is not committed. The final
smoke correctly exits 1 with only Java in its failure list.

The bounded shared-image fix is separate in #21849; this PR does not
modify image Dockerfiles or the image-build implementation. Its
`b8274fc8e0` image job and all four uploads passed, Infrastructure
passed 2090/2090 including all 13 new image cases, and all 116 CLI
archive E2E jobs passed. Earlier Windows extension fake-timer and DCP
Docker-startup failures were investigated with same-source passing main
controls; the morning live refresh reports its Final Results passing. It
remains independently review-gated. Do not infer actual timeout/fallback
execution from a healthy-mirror image pass.

No action SHA is added or changed. No official Azure DevOps pipeline is
modified. Parent's Go-minimum-version map rule/theory and the other
owner's extension-e2e map block are untouched. The cache option uses
existing embedded CLI inputs; no additional selector rule is required.
The stabilization script remains advisory/disabled rather than being
presented as a regular-PR gate.

This does not close #21108: live Azure Container Apps deployment and
real missing/old-toolchain E2E remain uncovered here. Cross-language
lifecycle redesigns are deferred.

### CI failures diagnosed and fixed

Original-head run
[42116644663](https://github.com/microsoft/aspire/actions/runs/42116644663)
exposed two causes:

- Windows x64/ARM64 and macOS x64/ARM64 starter validation failed
because Redis could not start: the Windows Docker engine pipe was absent
and macOS had no Docker executable. The API correctly waited on its
unhealthy dependency. Those native runners now use the supported
cache-free variant; Linux and Docker E2E retain Redis coverage. No
readiness assertion was removed.
- `TypeScriptCodegenValidationTests` read `.codegen-hash` immediately
after init, which supplies SDK sources but not restore-cache metadata.
An explicit baseline restore now precedes the snapshot and stale-cache
assertions.

**Head `1ab3ad1e30`: all six native starter lanes passed**, including
both Redis-enabled Ubuntu lanes and all four formerly failing
Windows/macOS lanes, in [run
42151619597](https://github.com/microsoft/aspire/actions/runs/42151619597).
Packaged CI subsequently passed
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672515)
(both cache choices),
[GoStarterTemplateTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672968),
[JavaCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672216),
and
[TypeScriptCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721664876).
All originally failing targeted lanes/classes therefore have passing
coverage.

The shared image job first timed out at 45 minutes twice. Attempt 2
fetched 108 MB from Azure Ubuntu in 41 minutes 29 seconds (43.4 kB/s),
versus a following GitHub download at 80.1 MB/s; GHA cache import also
returned HTTP 400 service-unavailable responses. After #21849's
same-input image control passed with all four uploads, one
evidence-based product revalidation was started. [Attempt 3's image job
passed](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127718680817)
and admitted packaged E2E. No blind retries were made. The successful
infrastructure control used a healthy primary mirror; it does not
demonstrate timeout/fallback execution in that CI run.

**Head `bd30794b9e`: historical failures and final outcome are
distinct.** In [run
42167868738](https://github.com/microsoft/aspire/actions/runs/42167868738),
all six native starter lanes and Go/Java/TypeScript SDK validation
passed. The first [shared image
job](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127729647462)
was canceled after 45 minutes 22 seconds with Azure Ubuntu apt downloads
still running and all four uploads skipped; the initial Linux
tree-actions attempt also failed on a stale immutable Running snapshot.
The morning live refresh subsequently shows [Final Results
passing](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127754717945),
including
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127747615122).
This session did not initiate retries. A passing later attempt does not
repair the tree-actions race: its separate test-only fix #21854 still
needs independent approval/merge and incorporation before claiming the
race fixed in this checkout.

**Latest head `0bb6569d91` requires fresh checks**, now running in
[42222384609](https://github.com/microsoft/aspire/actions/runs/42222384609).
Both new review findings are corrected: SDK selection accepts only exact
numeric MAJOR.MINOR.PATCH package filenames, and Go starter startup is
inside its existing cleanup scope. Both threads were replied to and
resolved with evidence. Earlier-head CI is not presented as latest-head
proof.

Per the user's explicit authorization, the coordinator enabled normal
native **squash auto-merge** at 05:22:46Z on 2026-11-06. It remains
enabled behind required fresh checks and review requirements. No admin
bypass is authorized or used; the PR is not merged.

### Stabilization review corrections

The smoke now publishes a Release CLI with its real stabilized bundle
outside the checkout, propagates stabilization into child payload
builds, and clears inherited `ASPIRE_REPO_ROOT` for every consumer
invocation. Consumer packages are isolated after the driver build so
build-time extraction cannot hide a missing stable package. Successful
guest restores must produce metadata for the exact hosting pins,
including Redis for Go; provenance is retained in the output.

The real run also exposed two stale smoke assumptions: a pre-owned
parent feed mapping conflicts with scaffolding's project-local channel
policy, and current C# file-based templates use `#:package
Aspire.Hosting.AppHost@<version>`, not the obsolete SDK directive. The
smoke now lets the CLI establish its own authoritative project-scoped
feed mapping and checks the current hosting-package contract. No
customer NuGet policy is changed.

### Validation

- `.\restore.cmd` - passed.
- `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore --nologo -v quiet` - passed, zero warnings/errors; repeated
successfully after removing temporary fault injection for `0bb6569d91`.
- `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class
'*.NewCommandTemplateConfigPersistenceTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, 59
tests including default/true/false Go package and generated-source
assertions. Existing ILCompiler NU1903 advisory was emitted.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_DOTNET_IMAGE=aspire-e2e-polyglot-base:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.RestoreGeneratesSdkFiles_WithConfiguredToolchain' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, all
four npm/bun/yarn/pnpm cases against exact `1ab3ad1e30` Linux
CLI/packages. The corresponding packaged CI class also passed above.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_POLYGLOT_GO_IMAGE=aspire-go-e2e-6972:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.StarterShipsTidyApiAndServesRequests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - 1 passed/1
failed locally against exact `1ab3ad1e30`. Cache-free passed actual
scaffolding, readonly API build, tidy check, API-up, health/weather and
stop without a Docker socket. Redis timed out locally. The unchanged
`2859e199e2` control reproduced the same timeout on this Docker Desktop
host; no workaround or weaker assertion was added. **Both cases
subsequently passed packaged CI**, linked above. After the cleanup-scope
correction, this local command again passed cache-free and failed Redis
on API readiness; the independent CLI stop log confirmed successful
shutdown, while the shared terminal helper observed the prior ERR
prompt. That local run is not claimed green.
- Temporary fault-injection validation used that same E2E command with
only the cache-free case and a shell wrapper returning HTTP 503 for the
Dashboard probe after a real packaged AppHost launch - intentionally
failed. Terminal output showed `dashboard-http-failed`, then cleanup
invocation; the CLI log confirmed `apphost.go stopped successfully` and
exit 0. The wrapper and temporary test edit were removed before the
final clean build/commit. This verifies partial-start cleanup, not a
successful readiness scenario.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c "sed 's/\r$//'
/workspace/artifacts/readiness-ci/validate-stable-sdk-selection.sh |
bash"` - passed actual smoke-script preflight cases for missing SDK,
prerelease-only, mixed
stable/dev/preview/rc/build-metadata/four-component filenames,
multi-digit stable versions, and feed paths with spaces. The
instrumented driver received `BundleVersion=17.0.0` from the mixed feed.
Invalid-only feeds exited 1 with the explicit missing-stable diagnostic.
Temporary harness removed after retaining logs; not a new all-language
stabilization pass.
- `dotnet test --project
tests\Infrastructure.Tests\Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class '*.TestTriggerMapTests'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` - passed, 176 tests.
- `dotnet run --project tools\SelectTests -- --changed-files
artifacts\readiness-changed-files.txt --explain` - passed against the
real graph/map; Go hosting/codegen, Redis, starter checksum and EF Core
fixture inputs select starter-validation/polyglot with zero unattributed
files. Schedule-only deployment remains advisory.
- `$env:DOTNET_ROOT = Join-Path $PWD '.dotnet'; $env:ASPIRE_REPO_ROOT =
$PWD; .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.exe restore
--apphost tests\PolyglotAppHosts\<integration>\Go\apphost.go
--non-interactive` - passed separately for
`Aspire.Hosting.EntityFrameworkCore`, `Aspire.Hosting.Foundry`, and
`Aspire.Hosting`, generating actual SDK bindings.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace"
aspire-go-e2e-6972:latest -c 'set -e; for fixture in
Aspire.Hosting.EntityFrameworkCore Aspire.Hosting.Foundry
Aspire.Hosting; do cd "/workspace/tests/PolyglotAppHosts/$fixture/Go";
gofmt -w apphost.go; go build -buildvcs=false -o /tmp/fixture ./...; go
vet ./...; done'` - passed for all three fixtures.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c 'set -e; bash -n
/workspace/.github/workflows/polyglot-validation/test-go.sh
/workspace/.github/workflows/polyglot-validation/test-go-playground.sh
/workspace/eng/scripts/stabilization-smoke-init-restore.sh;
work=$(mktemp -d); trap "rm -rf $work" EXIT; cp
/workspace/src/Aspire.Cli/Templating/Templates/go-starter/api/*
"$work/"; cd "$work"; sed -i "s/{{projectNameLower}}/starter/g" go.mod;
go build -mod=readonly -o /tmp/go-ready-api .; go mod tidy -diff; go vet
./...'` - passed without a dependency-repair command.
- Native Linux `./restore.sh -p:SkipTestProjects=true
-p:SkipPlaygroundProjects=true` - passed with the pinned SDK.
- Native Linux `./dotnet.sh pack
src/Aspire.Hosting.AppHost/Aspire.Hosting.AppHost.csproj -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true --nologo -v
quiet` - failed as expected on existing NU5104 preview dependencies; not
counted as a stabilization pass.
- To isolate consumer behavior, the diagnostic feed used `for project in
Aspire.Hosting Aspire.Hosting.AppHost Aspire.Hosting.Dotnet
Aspire.TypeSystem Aspire.Hosting.CodeGeneration.Go
Aspire.Hosting.CodeGeneration.Java Aspire.Hosting.Go
Aspire.Hosting.Redis Aspire.Hosting.Java Aspire.Hosting.JavaScript
Aspire.AppHost.Sdk Aspire.ProjectTemplates; do ./dotnet.sh pack
"src/$project/$project.csproj" -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true
-p:WarningsNotAsErrors=NU5104 --nologo -v quiet; done` - passed. No
suppression is committed; Java remains `17.0.0-dev` by existing policy.
- Native Linux `STABILIZATION_SMOKE_CONFIGURATION=Release
ASPIRE_REPO_ROOT=/work/source bash
eng/scripts/stabilization-smoke-init-restore.sh` - built the genuine
stabilized Release driver/payload and completed the consumer flow.
**Exit 1 is the expected Java policy failure, not an all-language
pass.** Go/Redis `17.0.0` metadata names
`/work/source/artifacts/packages/Release/Shipping`; C# `17.0.0`
restored; Java reached real NuGet restore and rejected its absent stable
pin with no nuget.org fallback. Output assertions confirmed the final
failure list is exactly `java`. Sources were `1ab3ad1e30` plus the final
smoke correction; no mixed PR-stamped CLI was used.
- `bash -n eng/scripts/stabilization-smoke-init-restore.sh`, PowerShell
parser validation of `eng\scripts\cli-starter-validation.ps1`, and `git
diff --check` - passed.
- Full `Infrastructure.Tests.TestTriggerMap` namespace was not passed on
this Windows host: WSL's `bash.exe` cannot find `/bin/bash`; a narrowed
run also encountered readonly `.git` cleanup failures. Not counted as
successful validation.

## 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: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
## Description

Go starters should build from their shipped files without an initial
`aspire run` repairing dependencies, and Go preview validation should
exercise the same runtime and native-runner paths as other AppHosts.

- Ship a tidy API `go.mod` and generated `go.sum`. Add starter scenarios
checking gitignore, readonly API build, tidy stability, health and
weather responses; remove the Kubernetes manual-tidy workaround.
- Honor the existing `--use-redis-cache false` option for Go.
Omitted/true retains Redis; false omits the integration and resource.
Cover all three scaffold choices with generated-source snapshots and
both HTTP lifecycle variants with Docker E2E.
- Add `go vet` to Go polyglot fixtures, an EF Core fixture, and Foundry
tool/AKS node-pool parity. Exercise configuration-section list getters
in the real Go runtime smoke.
- Add Go to all six native starter-validation platforms, with official
checksum-verified Go installation, timeout budget, and runtime-only
selector edges for Go hosting, Go codegen, and Redis. Linux retains
API/Redis readiness; containerless Windows/macOS use the cache-free
starter with API readiness unchanged.
- Add isolated-local-feed Go/Java scaffolding and restore to the
stabilization smoke without rewriting template pins. Use a genuine
Release bundled driver outside repository mode, cold consumer caches,
and exact hosting-package extraction/provenance checks. Enable Java only
in its subprocess.
- Select languages by name rather than picker position. Restore stale
Java/TypeScript SDK baselines after `aspire add` so the following
`aspire restore` genuinely tests regeneration. Establish the TypeScript
baseline with an actual restore before reading cache metadata.
- Wait for the TypeScript Kubernetes application's actual Ready pod;
exercise the Go Helm namespace/chart-version callback.

Relates to #21202, #21206, #21209, #21210, #21201, and #21108.

### User-facing usage

```bash
# Default retains Redis.
aspire new aspire-go-starter --name GoReady --non-interactive --suppress-agent-init

# Containerless starter: the Go API runs without Redis or a Docker daemon.
aspire new aspire-go-starter --name GoReady --use-redis-cache false --non-interactive --suppress-agent-init
```

Both variants emit `api/go.sum` and an already-tidy API module. Its API
can build with `go build -mod=readonly` without first running the
AppHost's tidy resource.

### Dependencies and remaining acceptance

This PR is independent of #21823. Root-module brownfield E2E #21825
merged into the #21823 feature branch, not directly into main; its
delivery follows #21823. #21806 independently covers other Go
init/build/vet/stable-restore scenarios.

The existing stabilization gate remains disabled
(`STABILIZATION_ENABLED: 'false'`); enabling it needs a separate
CI/policy decision. Current `Aspire.Hosting.Java.csproj` still sets
`SuppressFinalPackageVersion=true` while the Java starter pins the
requested Aspire version. The corrected smoke reaches actual NuGet
restore and exposes that mismatch: `Aspire.Hosting.Java (= 17.0.0)` is
unavailable, the nearest local package is `17.0.0-dev`, and nuget.org
versions are not considered. No pin substitution or Java release-policy
change is included.

Native Linux validation built the genuine stabilized Release CLI/payload
and proved cold Go/Redis package restore and C# restore. This is **not a
clean stabilization pass**: the unsuppressed stable pack first
reproduced NU5104 on existing .NET 11 preview dependencies. The
diagnostic consumer feed downgraded only NU5104 with
`WarningsNotAsErrors=NU5104`; that exception is not committed. The final
smoke correctly exits 1 with only Java in its failure list.

The bounded shared-image fix is separate in #21849; this PR does not
modify image Dockerfiles or the image-build implementation. Its
`b8274fc8e0` image job and all four uploads passed, Infrastructure
passed 2090/2090 including all 13 new image cases, and all 116 CLI
archive E2E jobs passed. Earlier Windows extension fake-timer and DCP
Docker-startup failures were investigated with same-source passing main
controls; the morning live refresh reports its Final Results passing. It
remains independently review-gated. Do not infer actual timeout/fallback
execution from a healthy-mirror image pass.

No action SHA is added or changed. No official Azure DevOps pipeline is
modified. Parent's Go-minimum-version map rule/theory and the other
owner's extension-e2e map block are untouched. The cache option uses
existing embedded CLI inputs; no additional selector rule is required.
The stabilization script remains advisory/disabled rather than being
presented as a regular-PR gate.

This does not close #21108: live Azure Container Apps deployment and
real missing/old-toolchain E2E remain uncovered here. Cross-language
lifecycle redesigns are deferred.

### CI failures diagnosed and fixed

Original-head run
[42116644663](https://github.com/microsoft/aspire/actions/runs/42116644663)
exposed two causes:

- Windows x64/ARM64 and macOS x64/ARM64 starter validation failed
because Redis could not start: the Windows Docker engine pipe was absent
and macOS had no Docker executable. The API correctly waited on its
unhealthy dependency. Those native runners now use the supported
cache-free variant; Linux and Docker E2E retain Redis coverage. No
readiness assertion was removed.
- `TypeScriptCodegenValidationTests` read `.codegen-hash` immediately
after init, which supplies SDK sources but not restore-cache metadata.
An explicit baseline restore now precedes the snapshot and stale-cache
assertions.

**Head `1ab3ad1e30`: all six native starter lanes passed**, including
both Redis-enabled Ubuntu lanes and all four formerly failing
Windows/macOS lanes, in [run
42151619597](https://github.com/microsoft/aspire/actions/runs/42151619597).
Packaged CI subsequently passed
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672515)
(both cache choices),
[GoStarterTemplateTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672968),
[JavaCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672216),
and
[TypeScriptCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721664876).
All originally failing targeted lanes/classes therefore have passing
coverage.

The shared image job first timed out at 45 minutes twice. Attempt 2
fetched 108 MB from Azure Ubuntu in 41 minutes 29 seconds (43.4 kB/s),
versus a following GitHub download at 80.1 MB/s; GHA cache import also
returned HTTP 400 service-unavailable responses. After #21849's
same-input image control passed with all four uploads, one
evidence-based product revalidation was started. [Attempt 3's image job
passed](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127718680817)
and admitted packaged E2E. No blind retries were made. The successful
infrastructure control used a healthy primary mirror; it does not
demonstrate timeout/fallback execution in that CI run.

**Head `bd30794b9e`: historical failures and final outcome are
distinct.** In [run
42167868738](https://github.com/microsoft/aspire/actions/runs/42167868738),
all six native starter lanes and Go/Java/TypeScript SDK validation
passed. The first [shared image
job](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127729647462)
was canceled after 45 minutes 22 seconds with Azure Ubuntu apt downloads
still running and all four uploads skipped; the initial Linux
tree-actions attempt also failed on a stale immutable Running snapshot.
The morning live refresh subsequently shows [Final Results
passing](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127754717945),
including
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127747615122).
This session did not initiate retries. A passing later attempt does not
repair the tree-actions race: its separate test-only fix #21854 still
needs independent approval/merge and incorporation before claiming the
race fixed in this checkout.

**Latest head `0bb6569d91` requires fresh checks**, now running in
[42222384609](https://github.com/microsoft/aspire/actions/runs/42222384609).
Both new review findings are corrected: SDK selection accepts only exact
numeric MAJOR.MINOR.PATCH package filenames, and Go starter startup is
inside its existing cleanup scope. Both threads were replied to and
resolved with evidence. Earlier-head CI is not presented as latest-head
proof.

Per the user's explicit authorization, the coordinator enabled normal
native **squash auto-merge** at 05:22:46Z on 2026-11-06. It remains
enabled behind required fresh checks and review requirements. No admin
bypass is authorized or used; the PR is not merged.

### Stabilization review corrections

The smoke now publishes a Release CLI with its real stabilized bundle
outside the checkout, propagates stabilization into child payload
builds, and clears inherited `ASPIRE_REPO_ROOT` for every consumer
invocation. Consumer packages are isolated after the driver build so
build-time extraction cannot hide a missing stable package. Successful
guest restores must produce metadata for the exact hosting pins,
including Redis for Go; provenance is retained in the output.

The real run also exposed two stale smoke assumptions: a pre-owned
parent feed mapping conflicts with scaffolding's project-local channel
policy, and current C# file-based templates use `#:package
Aspire.Hosting.AppHost@<version>`, not the obsolete SDK directive. The
smoke now lets the CLI establish its own authoritative project-scoped
feed mapping and checks the current hosting-package contract. No
customer NuGet policy is changed.

### Validation

- `.\restore.cmd` - passed.
- `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore --nologo -v quiet` - passed, zero warnings/errors; repeated
successfully after removing temporary fault injection for `0bb6569d91`.
- `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class
'*.NewCommandTemplateConfigPersistenceTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, 59
tests including default/true/false Go package and generated-source
assertions. Existing ILCompiler NU1903 advisory was emitted.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_DOTNET_IMAGE=aspire-e2e-polyglot-base:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.RestoreGeneratesSdkFiles_WithConfiguredToolchain' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, all
four npm/bun/yarn/pnpm cases against exact `1ab3ad1e30` Linux
CLI/packages. The corresponding packaged CI class also passed above.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_POLYGLOT_GO_IMAGE=aspire-go-e2e-6972:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.StarterShipsTidyApiAndServesRequests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - 1 passed/1
failed locally against exact `1ab3ad1e30`. Cache-free passed actual
scaffolding, readonly API build, tidy check, API-up, health/weather and
stop without a Docker socket. Redis timed out locally. The unchanged
`2859e199e2` control reproduced the same timeout on this Docker Desktop
host; no workaround or weaker assertion was added. **Both cases
subsequently passed packaged CI**, linked above. After the cleanup-scope
correction, this local command again passed cache-free and failed Redis
on API readiness; the independent CLI stop log confirmed successful
shutdown, while the shared terminal helper observed the prior ERR
prompt. That local run is not claimed green.
- Temporary fault-injection validation used that same E2E command with
only the cache-free case and a shell wrapper returning HTTP 503 for the
Dashboard probe after a real packaged AppHost launch - intentionally
failed. Terminal output showed `dashboard-http-failed`, then cleanup
invocation; the CLI log confirmed `apphost.go stopped successfully` and
exit 0. The wrapper and temporary test edit were removed before the
final clean build/commit. This verifies partial-start cleanup, not a
successful readiness scenario.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c "sed 's/\r$//'
/workspace/artifacts/readiness-ci/validate-stable-sdk-selection.sh |
bash"` - passed actual smoke-script preflight cases for missing SDK,
prerelease-only, mixed
stable/dev/preview/rc/build-metadata/four-component filenames,
multi-digit stable versions, and feed paths with spaces. The
instrumented driver received `BundleVersion=17.0.0` from the mixed feed.
Invalid-only feeds exited 1 with the explicit missing-stable diagnostic.
Temporary harness removed after retaining logs; not a new all-language
stabilization pass.
- `dotnet test --project
tests\Infrastructure.Tests\Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class '*.TestTriggerMapTests'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` - passed, 176 tests.
- `dotnet run --project tools\SelectTests -- --changed-files
artifacts\readiness-changed-files.txt --explain` - passed against the
real graph/map; Go hosting/codegen, Redis, starter checksum and EF Core
fixture inputs select starter-validation/polyglot with zero unattributed
files. Schedule-only deployment remains advisory.
- `$env:DOTNET_ROOT = Join-Path $PWD '.dotnet'; $env:ASPIRE_REPO_ROOT =
$PWD; .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.exe restore
--apphost tests\PolyglotAppHosts\<integration>\Go\apphost.go
--non-interactive` - passed separately for
`Aspire.Hosting.EntityFrameworkCore`, `Aspire.Hosting.Foundry`, and
`Aspire.Hosting`, generating actual SDK bindings.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace"
aspire-go-e2e-6972:latest -c 'set -e; for fixture in
Aspire.Hosting.EntityFrameworkCore Aspire.Hosting.Foundry
Aspire.Hosting; do cd "/workspace/tests/PolyglotAppHosts/$fixture/Go";
gofmt -w apphost.go; go build -buildvcs=false -o /tmp/fixture ./...; go
vet ./...; done'` - passed for all three fixtures.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c 'set -e; bash -n
/workspace/.github/workflows/polyglot-validation/test-go.sh
/workspace/.github/workflows/polyglot-validation/test-go-playground.sh
/workspace/eng/scripts/stabilization-smoke-init-restore.sh;
work=$(mktemp -d); trap "rm -rf $work" EXIT; cp
/workspace/src/Aspire.Cli/Templating/Templates/go-starter/api/*
"$work/"; cd "$work"; sed -i "s/{{projectNameLower}}/starter/g" go.mod;
go build -mod=readonly -o /tmp/go-ready-api .; go mod tidy -diff; go vet
./...'` - passed without a dependency-repair command.
- Native Linux `./restore.sh -p:SkipTestProjects=true
-p:SkipPlaygroundProjects=true` - passed with the pinned SDK.
- Native Linux `./dotnet.sh pack
src/Aspire.Hosting.AppHost/Aspire.Hosting.AppHost.csproj -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true --nologo -v
quiet` - failed as expected on existing NU5104 preview dependencies; not
counted as a stabilization pass.
- To isolate consumer behavior, the diagnostic feed used `for project in
Aspire.Hosting Aspire.Hosting.AppHost Aspire.Hosting.Dotnet
Aspire.TypeSystem Aspire.Hosting.CodeGeneration.Go
Aspire.Hosting.CodeGeneration.Java Aspire.Hosting.Go
Aspire.Hosting.Redis Aspire.Hosting.Java Aspire.Hosting.JavaScript
Aspire.AppHost.Sdk Aspire.ProjectTemplates; do ./dotnet.sh pack
"src/$project/$project.csproj" -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true
-p:WarningsNotAsErrors=NU5104 --nologo -v quiet; done` - passed. No
suppression is committed; Java remains `17.0.0-dev` by existing policy.
- Native Linux `STABILIZATION_SMOKE_CONFIGURATION=Release
ASPIRE_REPO_ROOT=/work/source bash
eng/scripts/stabilization-smoke-init-restore.sh` - built the genuine
stabilized Release driver/payload and completed the consumer flow.
**Exit 1 is the expected Java policy failure, not an all-language
pass.** Go/Redis `17.0.0` metadata names
`/work/source/artifacts/packages/Release/Shipping`; C# `17.0.0`
restored; Java reached real NuGet restore and rejected its absent stable
pin with no nuget.org fallback. Output assertions confirmed the final
failure list is exactly `java`. Sources were `1ab3ad1e30` plus the final
smoke correction; no mixed PR-stamped CLI was used.
- `bash -n eng/scripts/stabilization-smoke-init-restore.sh`, PowerShell
parser validation of `eng\scripts\cli-starter-validation.ps1`, and `git
diff --check` - passed.
- Full `Infrastructure.Tests.TestTriggerMap` namespace was not passed on
this Windows host: WSL's `bash.exe` cannot find `/bin/bash`; a narrowed
run also encountered readonly `.git` cleanup failures. Not counted as
successful validation.

## 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: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 5138b2a)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
## Description

Go starters should build from their shipped files without an initial
`aspire run` repairing dependencies, and Go preview validation should
exercise the same runtime and native-runner paths as other AppHosts.

- Ship a tidy API `go.mod` and generated `go.sum`. Add starter scenarios
checking gitignore, readonly API build, tidy stability, health and
weather responses; remove the Kubernetes manual-tidy workaround.
- Honor the existing `--use-redis-cache false` option for Go.
Omitted/true retains Redis; false omits the integration and resource.
Cover all three scaffold choices with generated-source snapshots and
both HTTP lifecycle variants with Docker E2E.
- Add `go vet` to Go polyglot fixtures, an EF Core fixture, and Foundry
tool/AKS node-pool parity. Exercise configuration-section list getters
in the real Go runtime smoke.
- Add Go to all six native starter-validation platforms, with official
checksum-verified Go installation, timeout budget, and runtime-only
selector edges for Go hosting, Go codegen, and Redis. Linux retains
API/Redis readiness; containerless Windows/macOS use the cache-free
starter with API readiness unchanged.
- Add isolated-local-feed Go/Java scaffolding and restore to the
stabilization smoke without rewriting template pins. Use a genuine
Release bundled driver outside repository mode, cold consumer caches,
and exact hosting-package extraction/provenance checks. Enable Java only
in its subprocess.
- Select languages by name rather than picker position. Restore stale
Java/TypeScript SDK baselines after `aspire add` so the following
`aspire restore` genuinely tests regeneration. Establish the TypeScript
baseline with an actual restore before reading cache metadata.
- Wait for the TypeScript Kubernetes application's actual Ready pod;
exercise the Go Helm namespace/chart-version callback.

Relates to #21202, #21206, #21209, #21210, #21201, and #21108.

### User-facing usage

```bash
# Default retains Redis.
aspire new aspire-go-starter --name GoReady --non-interactive --suppress-agent-init

# Containerless starter: the Go API runs without Redis or a Docker daemon.
aspire new aspire-go-starter --name GoReady --use-redis-cache false --non-interactive --suppress-agent-init
```

Both variants emit `api/go.sum` and an already-tidy API module. Its API
can build with `go build -mod=readonly` without first running the
AppHost's tidy resource.

### Dependencies and remaining acceptance

This PR is independent of #21823. Root-module brownfield E2E #21825
merged into the #21823 feature branch, not directly into main; its
delivery follows #21823. #21806 independently covers other Go
init/build/vet/stable-restore scenarios.

The existing stabilization gate remains disabled
(`STABILIZATION_ENABLED: 'false'`); enabling it needs a separate
CI/policy decision. Current `Aspire.Hosting.Java.csproj` still sets
`SuppressFinalPackageVersion=true` while the Java starter pins the
requested Aspire version. The corrected smoke reaches actual NuGet
restore and exposes that mismatch: `Aspire.Hosting.Java (= 17.0.0)` is
unavailable, the nearest local package is `17.0.0-dev`, and nuget.org
versions are not considered. No pin substitution or Java release-policy
change is included.

Native Linux validation built the genuine stabilized Release CLI/payload
and proved cold Go/Redis package restore and C# restore. This is **not a
clean stabilization pass**: the unsuppressed stable pack first
reproduced NU5104 on existing .NET 11 preview dependencies. The
diagnostic consumer feed downgraded only NU5104 with
`WarningsNotAsErrors=NU5104`; that exception is not committed. The final
smoke correctly exits 1 with only Java in its failure list.

The bounded shared-image fix is separate in #21849; this PR does not
modify image Dockerfiles or the image-build implementation. Its
`b8274fc8e0` image job and all four uploads passed, Infrastructure
passed 2090/2090 including all 13 new image cases, and all 116 CLI
archive E2E jobs passed. Earlier Windows extension fake-timer and DCP
Docker-startup failures were investigated with same-source passing main
controls; the morning live refresh reports its Final Results passing. It
remains independently review-gated. Do not infer actual timeout/fallback
execution from a healthy-mirror image pass.

No action SHA is added or changed. No official Azure DevOps pipeline is
modified. Parent's Go-minimum-version map rule/theory and the other
owner's extension-e2e map block are untouched. The cache option uses
existing embedded CLI inputs; no additional selector rule is required.
The stabilization script remains advisory/disabled rather than being
presented as a regular-PR gate.

This does not close #21108: live Azure Container Apps deployment and
real missing/old-toolchain E2E remain uncovered here. Cross-language
lifecycle redesigns are deferred.

### CI failures diagnosed and fixed

Original-head run
[42116644663](https://github.com/microsoft/aspire/actions/runs/42116644663)
exposed two causes:

- Windows x64/ARM64 and macOS x64/ARM64 starter validation failed
because Redis could not start: the Windows Docker engine pipe was absent
and macOS had no Docker executable. The API correctly waited on its
unhealthy dependency. Those native runners now use the supported
cache-free variant; Linux and Docker E2E retain Redis coverage. No
readiness assertion was removed.
- `TypeScriptCodegenValidationTests` read `.codegen-hash` immediately
after init, which supplies SDK sources but not restore-cache metadata.
An explicit baseline restore now precedes the snapshot and stale-cache
assertions.

**Head `1ab3ad1e30`: all six native starter lanes passed**, including
both Redis-enabled Ubuntu lanes and all four formerly failing
Windows/macOS lanes, in [run
42151619597](https://github.com/microsoft/aspire/actions/runs/42151619597).
Packaged CI subsequently passed
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672515)
(both cache choices),
[GoStarterTemplateTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672968),
[JavaCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721672216),
and
[TypeScriptCodegenValidationTests](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127721664876).
All originally failing targeted lanes/classes therefore have passing
coverage.

The shared image job first timed out at 45 minutes twice. Attempt 2
fetched 108 MB from Azure Ubuntu in 41 minutes 29 seconds (43.4 kB/s),
versus a following GitHub download at 80.1 MB/s; GHA cache import also
returned HTTP 400 service-unavailable responses. After #21849's
same-input image control passed with all four uploads, one
evidence-based product revalidation was started. [Attempt 3's image job
passed](https://github.com/microsoft/aspire/actions/runs/42151619597/job/127718680817)
and admitted packaged E2E. No blind retries were made. The successful
infrastructure control used a healthy primary mirror; it does not
demonstrate timeout/fallback execution in that CI run.

**Head `bd30794b9e`: historical failures and final outcome are
distinct.** In [run
42167868738](https://github.com/microsoft/aspire/actions/runs/42167868738),
all six native starter lanes and Go/Java/TypeScript SDK validation
passed. The first [shared image
job](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127729647462)
was canceled after 45 minutes 22 seconds with Azure Ubuntu apt downloads
still running and all four uploads skipped; the initial Linux
tree-actions attempt also failed on a stale immutable Running snapshot.
The morning live refresh subsequently shows [Final Results
passing](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127754717945),
including
[GoStarterReadinessTests](https://github.com/microsoft/aspire/actions/runs/42167868738/job/127747615122).
This session did not initiate retries. A passing later attempt does not
repair the tree-actions race: its separate test-only fix #21854 still
needs independent approval/merge and incorporation before claiming the
race fixed in this checkout.

**Latest head `0bb6569d91` requires fresh checks**, now running in
[42222384609](https://github.com/microsoft/aspire/actions/runs/42222384609).
Both new review findings are corrected: SDK selection accepts only exact
numeric MAJOR.MINOR.PATCH package filenames, and Go starter startup is
inside its existing cleanup scope. Both threads were replied to and
resolved with evidence. Earlier-head CI is not presented as latest-head
proof.

Per the user's explicit authorization, the coordinator enabled normal
native **squash auto-merge** at 05:22:46Z on 2026-11-06. It remains
enabled behind required fresh checks and review requirements. No admin
bypass is authorized or used; the PR is not merged.

### Stabilization review corrections

The smoke now publishes a Release CLI with its real stabilized bundle
outside the checkout, propagates stabilization into child payload
builds, and clears inherited `ASPIRE_REPO_ROOT` for every consumer
invocation. Consumer packages are isolated after the driver build so
build-time extraction cannot hide a missing stable package. Successful
guest restores must produce metadata for the exact hosting pins,
including Redis for Go; provenance is retained in the output.

The real run also exposed two stale smoke assumptions: a pre-owned
parent feed mapping conflicts with scaffolding's project-local channel
policy, and current C# file-based templates use `#:package
Aspire.Hosting.AppHost@<version>`, not the obsolete SDK directive. The
smoke now lets the CLI establish its own authoritative project-scoped
feed mapping and checks the current hosting-package contract. No
customer NuGet policy is changed.

### Validation

- `.\restore.cmd` - passed.
- `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore --nologo -v quiet` - passed, zero warnings/errors; repeated
successfully after removing temporary fault injection for `0bb6569d91`.
- `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj
--no-launch-profile -- --filter-class
'*.NewCommandTemplateConfigPersistenceTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, 59
tests including default/true/false Go package and generated-source
assertions. Existing ILCompiler NU1903 advisory was emitted.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_DOTNET_IMAGE=aspire-e2e-polyglot-base:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.RestoreGeneratesSdkFiles_WithConfiguredToolchain' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - passed, all
four npm/bun/yarn/pnpm cases against exact `1ab3ad1e30` Linux
CLI/packages. The corresponding packaged CI class also passed above.
- With
`ASPIRE_E2E_CLI_ARCHIVE_DIR=artifacts\readiness-ci\cli-archive-new` and
`ASPIRE_E2E_POLYGLOT_GO_IMAGE=aspire-go-e2e-6972:latest`, `dotnet test
--project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
'*.StarterShipsTidyApiAndServesRequests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` - 1 passed/1
failed locally against exact `1ab3ad1e30`. Cache-free passed actual
scaffolding, readonly API build, tidy check, API-up, health/weather and
stop without a Docker socket. Redis timed out locally. The unchanged
`2859e199e2` control reproduced the same timeout on this Docker Desktop
host; no workaround or weaker assertion was added. **Both cases
subsequently passed packaged CI**, linked above. After the cleanup-scope
correction, this local command again passed cache-free and failed Redis
on API readiness; the independent CLI stop log confirmed successful
shutdown, while the shared terminal helper observed the prior ERR
prompt. That local run is not claimed green.
- Temporary fault-injection validation used that same E2E command with
only the cache-free case and a shell wrapper returning HTTP 503 for the
Dashboard probe after a real packaged AppHost launch - intentionally
failed. Terminal output showed `dashboard-http-failed`, then cleanup
invocation; the CLI log confirmed `apphost.go stopped successfully` and
exit 0. The wrapper and temporary test edit were removed before the
final clean build/commit. This verifies partial-start cleanup, not a
successful readiness scenario.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c "sed 's/\r$//'
/workspace/artifacts/readiness-ci/validate-stable-sdk-selection.sh |
bash"` - passed actual smoke-script preflight cases for missing SDK,
prerelease-only, mixed
stable/dev/preview/rc/build-metadata/four-component filenames,
multi-digit stable versions, and feed paths with spaces. The
instrumented driver received `BundleVersion=17.0.0` from the mixed feed.
Invalid-only feeds exited 1 with the explicit missing-stable diagnostic.
Temporary harness removed after retaining logs; not a new all-language
stabilization pass.
- `dotnet test --project
tests\Infrastructure.Tests\Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class '*.TestTriggerMapTests'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` - passed, 176 tests.
- `dotnet run --project tools\SelectTests -- --changed-files
artifacts\readiness-changed-files.txt --explain` - passed against the
real graph/map; Go hosting/codegen, Redis, starter checksum and EF Core
fixture inputs select starter-validation/polyglot with zero unattributed
files. Schedule-only deployment remains advisory.
- `$env:DOTNET_ROOT = Join-Path $PWD '.dotnet'; $env:ASPIRE_REPO_ROOT =
$PWD; .\artifacts\bin\Aspire.Cli\Debug\net11.0\aspire.exe restore
--apphost tests\PolyglotAppHosts\<integration>\Go\apphost.go
--non-interactive` - passed separately for
`Aspire.Hosting.EntityFrameworkCore`, `Aspire.Hosting.Foundry`, and
`Aspire.Hosting`, generating actual SDK bindings.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace"
aspire-go-e2e-6972:latest -c 'set -e; for fixture in
Aspire.Hosting.EntityFrameworkCore Aspire.Hosting.Foundry
Aspire.Hosting; do cd "/workspace/tests/PolyglotAppHosts/$fixture/Go";
gofmt -w apphost.go; go build -buildvcs=false -o /tmp/fixture ./...; go
vet ./...; done'` - passed for all three fixtures.
- `docker run --rm --entrypoint bash -v "${PWD}:/workspace:ro"
aspire-go-e2e-6972:latest -c 'set -e; bash -n
/workspace/.github/workflows/polyglot-validation/test-go.sh
/workspace/.github/workflows/polyglot-validation/test-go-playground.sh
/workspace/eng/scripts/stabilization-smoke-init-restore.sh;
work=$(mktemp -d); trap "rm -rf $work" EXIT; cp
/workspace/src/Aspire.Cli/Templating/Templates/go-starter/api/*
"$work/"; cd "$work"; sed -i "s/{{projectNameLower}}/starter/g" go.mod;
go build -mod=readonly -o /tmp/go-ready-api .; go mod tidy -diff; go vet
./...'` - passed without a dependency-repair command.
- Native Linux `./restore.sh -p:SkipTestProjects=true
-p:SkipPlaygroundProjects=true` - passed with the pinned SDK.
- Native Linux `./dotnet.sh pack
src/Aspire.Hosting.AppHost/Aspire.Hosting.AppHost.csproj -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true --nologo -v
quiet` - failed as expected on existing NU5104 preview dependencies; not
counted as a stabilization pass.
- To isolate consumer behavior, the diagnostic feed used `for project in
Aspire.Hosting Aspire.Hosting.AppHost Aspire.Hosting.Dotnet
Aspire.TypeSystem Aspire.Hosting.CodeGeneration.Go
Aspire.Hosting.CodeGeneration.Java Aspire.Hosting.Go
Aspire.Hosting.Redis Aspire.Hosting.Java Aspire.Hosting.JavaScript
Aspire.AppHost.Sdk Aspire.ProjectTemplates; do ./dotnet.sh pack
"src/$project/$project.csproj" -c Release
-p:StabilizePackageVersion=true -p:SkipNativeBuild=true
-p:WarningsNotAsErrors=NU5104 --nologo -v quiet; done` - passed. No
suppression is committed; Java remains `17.0.0-dev` by existing policy.
- Native Linux `STABILIZATION_SMOKE_CONFIGURATION=Release
ASPIRE_REPO_ROOT=/work/source bash
eng/scripts/stabilization-smoke-init-restore.sh` - built the genuine
stabilized Release driver/payload and completed the consumer flow.
**Exit 1 is the expected Java policy failure, not an all-language
pass.** Go/Redis `17.0.0` metadata names
`/work/source/artifacts/packages/Release/Shipping`; C# `17.0.0`
restored; Java reached real NuGet restore and rejected its absent stable
pin with no nuget.org fallback. Output assertions confirmed the final
failure list is exactly `java`. Sources were `1ab3ad1e30` plus the final
smoke correction; no mixed PR-stamped CLI was used.
- `bash -n eng/scripts/stabilization-smoke-init-restore.sh`, PowerShell
parser validation of `eng\scripts\cli-starter-validation.ps1`, and `git
diff --check` - passed.
- Full `Infrastructure.Tests.TestTriggerMap` namespace was not passed on
this Windows host: WSL's `bash.exe` cannot find `/bin/bash`; a narrowed
run also encountered readonly `.git` cleanup failures. Not counted as
successful validation.

## 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: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 5138b2a)
@IEvangelist

Copy link
Copy Markdown
Member Author

/backport to release/17.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/17.0 (link to workflow run)

Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 11, 2026
Backport of #21823 to release/17.0

/cc @IEvangelist

## Description

Standalone backport of Go AppHost CLI preview readiness fixes. Targets
`release/17.0` directly; the old chained backport #22002 is left
untouched.

Contributes to #21115, #21201, #21207, and #21208 without closing those
umbrella issues.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] 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

## Customer Impact

`aspire init` can initialize a Go AppHost inside an existing Go
repository without replacing its application module or workspace. The
change also corrects tooling checks and help, enables
documentation-response decompression, and prevents copied file-based C#
sources from entering subsequent dev-server compilations.

## Testing

Backport verification: the aggregate diff has the same stable patch ID
as merged source commit `8e264bfdae2931bd41a485f908887db997127984`:
`04b990263618ffbd44a817150577e5c356df6cdb`. The PR targets
`release/17.0` directly and has no native stack membership.

Source-PR validation, not rerun locally on this backport:

```powershell
dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.GoAppHostToolingCheckTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'
```

Passed: 61 tests after the final guard-scope adjustment. The source also
records a combined CLI selection with 253 passed and TestTriggerMapTests
with 174 passed. The broader selector namespace run was not green on the
Windows host and is not counted as successful validation; details and
controls are recorded in #21823.

No local release-branch tests were rerun. Release-branch CI was pending
when this section was written; this is not a claim that backport CI has
passed.

## Risk

Medium. Touches shared scaffolding, tooling checks, HTTP clients, and
dev-server build inputs in addition to the Go-specific behavior.

## Regression?

Unknown. The source PR does not identify a regressing release.

---------

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Pine <david.pine@microsoft.com>
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.

3 participants