Skip to content

Add Go AppHost initialization and stable restore E2E coverage - #21806

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

David Pine (IEvangelist) merged 4 commits into
mainfrom
ievangelist-go-apphost-readiness

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Description

Adds focused Go AppHost E2E coverage for the initialization and package-resolution gaps identified while reviewing the Preview flag-removal PR.

  • Extends SDK-refresh coverage to interactive init, non-interactive init --language go in an empty directory, and non-interactive init alongside an existing Go application. The brownfield case verifies source preservation and wires the existing application through the default Go integration.
  • Builds and vets the consumer and explicitly vets the generated .aspire/modules module, which Go's root ./... traversal skips.
  • Adds a separate stable-identity starter restore/build test with an isolated NuGet cache, exact Go/Redis package pins, SDK regeneration, and NuGet metadata assertions proving the packages came from the local hive.
  • Retains normal-channel starter startup coverage and adds guaranteed stop cleanup after resource assertions.

Contributes to #21108 and #21110; companion coverage for #21183. This does not close either readiness issue or include the flag-removal changes. Existing flag-setup calls are unchanged so #21183 can remove them as planned.

Execution lanes

Initialization, code generation, build/vet, and normal-channel startup run in the existing regular CLI E2E lane. The stable restore/build test requires a stable-shaped local-hive archive and explicitly skips ordinary prerelease PR archives, matching the existing stable-emulation tests. The stabilization job in ci.yml is currently hard-disabled; this PR does not enable it or claim automated stable-release gating.

The existing runtime-package routes already cover Go, its generator, Redis and SQL Server. The selector attributes the changed test files to Aspire.Cli.EndToEnd.Tests; no map changes are required.

Validation

Command Result
.\restore.cmd Passed; reported existing dependency-advisory warnings.
dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore -m:2 -v:quiet Passed, 0 warnings, 0 errors.
dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class "*.GoCodegenValidationTests" --filter-class "*.GoStarterTemplateTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" Initial run: all three init/codegen cases and normal-channel startup passed. An initially broader stable scenario failed at startup, after restore/build/vet passed, because the PR-stamped binary requested its original prerelease SDK from nuget.org. Stable restore/build is now a separate test, scoped to the requested package-resolution coverage.
dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method "*.RestoreAndBuildGoStarterFromStablePackages" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" Passed, 1 test, 0 skipped, against the final stable restore/build scenario.
.\localhive.ps1 -Version 17.0.99 -Output .\artifacts\go-stable-e2e -Rid linux-x64 -Archive Blocked by NU5104 for stable component packages depending on preview .NET 11 packages. The pack excludes the changed test project. A consumer-only retry with $env:NoWarn='NU5104' packed the packages, then hit Windows-to-Linux NativeAOT dashboard publishing restrictions. No warning suppression or build-policy changes are committed.
git diff --check Passed.

For the Docker executions, ASPIRE_E2E_POLYGLOT_GO_IMAGE=aspire-go-e2e-6972:latest selected an existing Go 1.26.10 image. ASPIRE_E2E_ARCHIVE pointed to a consumer archive assembled from the approved #21183 native CLI (ecee5b208e) and real 17.0.99 packages built from this worktree. This validates the consumer scenarios, not a fully rebuilt stable native bundle or stable-identity startup. Linux stable-hive reproduction commands are documented in docs/contributing.md.

Checklist

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

Co-authored-by: Copilot 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 -- 21806

Or

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

@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 test relies on host build outputs rather than the selected archive for stable-version detection and invokes Python in an image without it, causing incorrect skips or execution failures.

2 open issues
What changed in this PR

Adds focused Go AppHost end-to-end coverage for initialization, SDK regeneration, and stable package resolution, contributing to Go Preview readiness without removing the feature flag or enabling stable-release CI gating.

Changes:

  • Covers interactive, non-interactive, and existing-project initialization, with source-preservation and build/vet checks.
  • Adds isolated stable-package restore coverage and ensures stop cleanup after normal-channel resource assertions.
  • Documents Linux reproduction commands and stable-archive requirements.
File Description
tests/​Aspire.Cli.EndToEnd.Tests/​GoStarterTemplateTests.cs Adds stable restore/build checks and startup cleanup.
tests/​Aspire.Cli.EndToEnd.Tests/​GoCodegenValidationTests.cs Expands initialization scenarios and consumer/generated-module validation.
docs/​contributing.md Documents Go E2E coverage and stable-hive reproduction.

Review effort: Balanced

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.

🔵 Needs a closer look

The documented archive-building command fails with NU5104 due to prerelease .NET 11 dependencies, so the guide must document the blocker and require an already-built stable-shaped archive.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Document NU5104 blocker and require a prebuilt archive

docs/​contributing.md:125

The documented archive-building command hits the NU5104 blocker reported in the PR validation: stable component packages still depend on prerelease .NET 11 packages. The Linux script also packs these packages, so changing the RID does not avoid the failure. Document the blocker and require an already-built stable-shaped archive until a working preparation procedure is available.

2 resolved since last review

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.

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.

🟡 Changes recommended

The Linux reproduction instructions omit a caveat that the stable-hive build hits the NU5104 packing blocker before producing the archive required by the tests.

1 open issue

Review effort: Balanced

Comment thread docs/contributing.md Resolved
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

Tests selector

1 / 101 PR test projects · 0 PR jobs, from 4 changed files.

Selected PR test projects (1 / 101)

Aspire.Cli.EndToEnd.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

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

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

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

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

Job reasons

none


Selection computed for commit f06ea37.

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 and stable-package restore coverage changes.

No open issues 🎉

1 resolved since last review

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.

@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.

Approved as incremental Go E2E coverage. The stable-identity restore/build scenario requires a stable-shaped local hive and skips ordinary CI; this approval does not establish stable/staging release readiness.

@IEvangelist
David Pine (IEvangelist) merged commit 1b946a7 into main Nov 6, 2026
315 of 318 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 6, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → test_only (proven false positive).

  • Triggered signal: pr_body_has_cli_flag_mention (evidence: PR body mentions init --language go in describing E2E scenarios). Advisory only_test_or_build_changes is true.
  • Changed files: tests/Aspire.Cli.EndToEnd.Tests/** (4 files) plus docs/contributing.md (repo-internal contributor doc, not shipped to aspire.dev). No src/ changes, no new flags or user-facing behavior; the flag mentioned is an existing option exercised by tests.

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)

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

David Pine (@IEvangelist) backporting to release/17.0 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Add focused Go AppHost initialization and stable restore E2E coverage
Using index info to reconstruct a base tree...
M	tests/Aspire.Cli.EndToEnd.Tests/GoCodegenValidationTests.cs
M	tests/Aspire.Cli.EndToEnd.Tests/GoStarterTemplateTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Cli.EndToEnd.Tests/GoCodegenValidationTests.cs
Auto-merging tests/Aspire.Cli.EndToEnd.Tests/GoStarterTemplateTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Cli.EndToEnd.Tests/GoStarterTemplateTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Add focused Go AppHost initialization and stable restore E2E coverage
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 11, 2026
…overage (#22114)

## Description

Backport of #21806 to `release/17.0`, protecting Go AppHost
initialization, source preservation, generated SDK build/vet, and stable
restore package provenance. Test and contributing-documentation changes
only; no production behavior change.

This standalone replacement for closed #21998 cherry-picks the exact
final merged squash `1b946a70114eaf152778109bd0b86df19ae47006` with `git
cherry-pick -x`, without conflicts or adaptations, directly onto release
tip `cec195f2d0bf3f1d714badf74f205fa855fdf963`. It has no stack or PR
dependencies. It does not reopen or modify the previous stack, retry the
bot, merge, or enable auto-merge.

Relates to #21108 and #21110; neither issue is closed by this PR.

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

Adds coverage protecting Go AppHost initialization, existing application
source preservation, generated SDK build/vet, and stable-package restore
provenance. No production behavior change.

## Testing

### Release-branch validation performed for this PR

| Exact command | Result |
| --- | --- |
| `.\restore.cmd` | Passed (exit 0); dependency-advisory warnings
reported. |
| `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore -m:2 -v:quiet` | Passed; 0 warnings, 0 errors. |
| `dotnet test --project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-class '*.CliInstallStrategyTests'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` | Passed: 72 succeeded, 0 failed, 0 skipped. Tests the
changed archive/stable-version helpers without Docker. |
| `git diff --check upstream/release/17.0 HEAD` | Passed. |
| `git diff --binary 1b946a7^
1b946a7` compared with `git diff
--binary upstream/release/17.0 HEAD` | Exact diff text identical; all
five changed files also have identical source/backport Git blob IDs. |
| `git diff 1b946a7^
1b946a7 \| git patch-id --stable`
compared with `git diff upstream/release/17.0 HEAD \| git patch-id
--stable` | Matching patch ID:
`6dedbdbd911c022351e03d7b8fba822692d43b33`. |
| `git status --porcelain=v1` | Clean after validation; no accepted
snapshot drift. |

Release runtime validation of `GoCodegenValidationTests` /
`GoStarterTemplateTests` was **not run**: no `ASPIRE_E2E_ARCHIVE` is
configured and no existing archive is present under this worktree's
artifacts. No local-hive or native AOT build was initiated. The stable
restore case additionally requires a stable-shaped local-hive archive.
These runtime scenarios are not claimed as passed or as automated
stable-release gating.

### Source PR evidence only (not release-branch validation)

Source #21806 records a clean E2E-project build, passing
initialization/codegen and normal-channel startup cases, and one passing
stable restore/build case. Full stable native-bundle build/startup was
not validated.

| Exact source command | Source result |
| --- | --- |
| `.\restore.cmd` | Passed with dependency-advisory warnings. |
| `dotnet build
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-restore -m:2 -v:quiet` | Passed; 0 warnings, 0 errors. |
| `dotnet test --project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-class "*.GoCodegenValidationTests"
--filter-class "*.GoStarterTemplateTests" --filter-not-trait
"quarantined=true" --filter-not-trait "outerloop=true"` | Source initial
run: three initialization/codegen cases and normal-channel startup
passed. An initially broader stable scenario failed at startup after
restore/build/vet passed; the final patch separates stable restore/build
from startup. Not a claim of a final all-green class run. |
| `dotnet test --project
tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj
--no-launch-profile -- --filter-method
"*.RestoreAndBuildGoStarterFromStablePackages" --filter-not-trait
"quarantined=true" --filter-not-trait "outerloop=true"` | Source final
stable restore/build case passed: 1 succeeded, 0 skipped, with a special
consumer archive using the approved #21183 native CLI and real 17.0.99
packages. This setup is not available in this release worktree. |
| `.\localhive.ps1 -Version 17.0.99 -Output .\artifacts\go-stable-e2e
-Rid linux-x64 -Archive` | Source full stable archive attempt was
blocked by NU5104; a consumer-only retry then hit Windows-to-Linux
NativeAOT restrictions. No warning suppression or build-policy changes
are included. |

## Risk

Low, test-only changes, with possible effects limited to E2E execution.

## Regression?

Unknown; source 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>
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