Skip to content

Add Go AppHost CLI end-to-end tests and a PolyglotGo image - #21189

Merged
David Pine (IEvangelist) merged 12 commits into
mainfrom
ievangelist-go-e2e-parity
Oct 28, 2026
Merged

David Pine (IEvangelist) merged 12 commits into
mainfrom
ievangelist-go-e2e-parity

Conversation

@IEvangelist

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

Copy link
Copy Markdown
Member

Description

Adds CLI end-to-end coverage for Go AppHosts that mirrors what TypeScript has, plus a PolyglotGo image variant that carries the Go toolchain for those tests.

Tests (tests/Aspire.Cli.EndToEnd.Tests, 7 classes, 10 tests):

Class Mirrors Covers
GoStarterTemplateTests TypeScriptStarterTemplateTests aspire new Go starter, then start, wait and stop
GoEmptyAppHostTemplateTests (2) TypeScriptEmptyAppHostTemplateTests empty Go AppHost from the template picker and from the direct template command
GoCodegenValidationTests TypeScriptCodegenValidationTests restore generates the SDK files, and regenerates them when the SDK on disk is stale (the baseline is put back after an aspire add)
GoPolyglotApphostDirectoryTests TypeScriptPolyglotApphostDirectoryTests stop a running Go AppHost through --apphost <dir>
GoSecretAppHostTests SecretTypeScriptAppHostTests secret create, read, update, delete and environment-scoped secrets. get and list output is checked with grep, and the JSON listing after the delete must hold exactly the remaining secret
GoPublishTests (3) TypeScriptPublishTests Docker Compose publish with a service callback, the default output directory, and the Dockerfile generated for AddGoApp
GoKubernetesDeployTests KubernetesDeployTypeScriptTests Go AppHost deployed to KinD with Helm, using the Helm defaults (namespace default, chart version 0.1.0); the api and cache pods must become Ready

Image and CI plumbing

  • tests/Shared/Docker/Dockerfile.e2e-polyglot-go, the image build, warm and load workflows, eng/scripts/load-cli-e2e-images.sh (--require-go), reproduce-flaky-tests.yml and docs/ci/cli-e2e-images.md get a PolyglotGo variant next to PolyglotJava.
  • The Go layer installs docker-buildx. aspire deploy builds the api image with docker buildx build and throws when buildx is missing (DockerContainerRuntime), while the shared polyglot base installs docker.io with --no-install-recommends, which leaves buildx out. The DotNet image (Dockerfile.e2e) installs it the same way. kind, helm and kubectl are installed by the test at runtime.
  • run-tests.yml downloads and loads that image for split jobs whose short name contains -Go. The classes are all named Go* for that reason: matching a bare go would also select names such as MongoDB and Config.
  • The three new actions/* pins reuse SHAs that are already pinned elsewhere in the repository, so no allow-list change is needed.
  • Aspire.Hosting.Go and Aspire.Hosting.CodeGeneration.Go join the CLI E2E runtime-package consumers in eng/github-ci/test-trigger-map.yml, next to the Java and TypeScript code generation packages. Two InlineData rows in SelectTestsAcceptanceTests cover the routing.

Helpers. AppHostLanguagePromptSelection.Go, AspireTemplate.GoStarter and GoEmptyAppHost, AspireNewGoEmptyAppHostAsync, and EnableExperimentalGoSupportAsync. The last is the only place the E2E projects write features:experimentalPolyglotGo, so removing the flag (#21106, in draft #21183) deletes one helper and its ten call sites instead of reworking each test.

The pickers type the entry's name (Go API for the starter, Go at the language prompt) instead of counting Down presses, and each step waits for the expected selection text before pressing Enter, so a wrong match fails with a clear timeout instead of choosing another entry. The PolyglotGo image has no .NET SDK, which drops the two C# starters from the template list: a Down count that is right with an SDK clamps onto Empty AppHost without one, which is how the first CI run failed. The search prompt jumps to the first entry whose text contains what was typed, ignoring case, so the selection no longer depends on what else a picker lists.

Part of #21108.

CI status

The first CI run (head d24eb6c14a) passed the CLI E2E image build (including the docker-buildx line), GoCodegenValidationTests, GoEmptyAppHostTemplateTests (2 tests), GoPolyglotApphostDirectoryTests, GoSecretAppHostTests and 2 of the 3 GoPublishTests: 7 of the 10 tests. The other three (GoStarterTemplateTests, GoPublishTests.PublishGoStarterGeneratesGoAppDockerfile and GoKubernetesDeployTests) failed for one reason, the 4 Down presses to the Go starter.

On c788f994e7, which replaces the Down presses with type-ahead, makes the Kubernetes AppHost callback-free and asserts the full secrets listing, all seven classes passed: 10 of 10 tests, including GoStarterTemplateTests (start, check that cache and api exist, stop) and GoKubernetesDeployTests. No check on that head is failing on its latest attempt (447 succeeded, 11 skipped).

The three commits after it (dad6c38807, 5506d5944a and 962ebc83a4) tighten three assertions that could pass without proving anything (see the findings below). On the last of them, 962ebc83a4, all seven classes passed again on ubuntu-latest: 10 of 10 tests, none skipped. That includes the stale-SDK baseline and restore flow in GoCodegenValidationTests and, in GoKubernetesDeployTests, a kubectl wait --for=condition=Ready that exited 0 for both the api and cache pods on a real kind cluster.

Three other jobs failed on the first attempt of that run and passed on a rerun of the same commit. This PR changes nothing under src/ or extension/.

  • Hosting.Azure (AzureFunctionsTests.AddAzureFunctionsProject_WorksWithMultipleProjects) failed on attempts 1 and 2 and passed on attempt 3.
  • KubernetesDeployWithMongoDBTests failed on attempt 1, on a runner with kernel 7.0.0-1017-azure, and passed on attempt 2.
  • The java-apphost-debug-startup-timeout VS Code extension E2E failed on attempt 1 and passed on attempt 2.

The latest attempt of every check on 962ebc83a4 is green: 447 succeeded, 11 skipped.

Findings that shaped the tests

  • The Go starter's api/go.mod ships without a go.sum, and WithModTidy only runs in run mode, so building the starter's container fails with missing go.sum entry (reproduced with a scratch go build). GoPublishTests asserts the generated Dockerfile only, and GoKubernetesDeployTests runs go mod tidy in api/ before deploying. The product fix is not in this PR (item 1 of Go AppHost: starter go.sum and E2E fixture follow-ups #21206).
  • The Kubernetes test's AppHost passes no WithHelm callback. In the generated Go SDK a Configure func inside an options struct panics the options merge with unexpected end of JSON input (Go AppHost: AddManifest is unusable — Configure option panics on publish, and WithField can't express nested/dotted CRD fields #18080, fix in Fix Go AppHost panic on callback options and accept Go numbers in unions #21188), so the test uses the Helm defaults (namespace default, chart version 0.1.0) and takes the namespace and chart-version parameters back once that fix lands (item 7 of Go AppHost: starter go.sum and E2E fixture follow-ups #21206). The deploy path itself (AddKubernetesEnvironment, AddContainerRegistry, aspire deploy) is unchanged, so the test is not marked [ActiveIssue] and the trigger map needs no new edge.
  • Three checks are written so that doing nothing cannot pass:
    • secret get and secret list are piped through grep and an echo marker is awaited. The key and value are already on screen from the typed secret set command, so waiting for that text alone always succeeds.
    • The codegen validation test copies the baseline aspire.go and .codegen-hash aside, runs aspire add Aspire.Hosting.SqlServer (which regenerates the SDK itself), puts the baseline back, checks that it is stale, and only then runs aspire restore. A restore that does nothing fails the test.
    • The Kubernetes test runs kubectl wait --for=condition=Ready for the api and cache pods, selected by app.kubernetes.io/component. kubectl get pods exits 0 on an empty namespace and Helm's --wait only waits for workloads that are in the chart, whereas kubectl wait exits 1 with no matching resources found when nothing matches.

Not in this PR

Validation

Windows, repo-local SDK, head 962ebc83a4 on top of upstream/main 230d5ac2a8. main has since gained one unrelated commit that touches only KubernetesDeployWithCertManagerTests.cs, so no rebase was needed. Rows 1 to 3 ran on this head. Rows 4 to 6 ran on d24eb6c14a: the later commits change only E2E test sources and the shared Hex1b helpers, and Infrastructure.Tests links neither (it links TemporaryWorkspace.cs, WindowsTrayTestPayload.cs and PathLookupHelper.cs from the shared directories) and does not read them, so those rows are unaffected.

Command Result
dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj -m:2 --no-restore 0 warnings, 0 errors
dotnet build tests\Aspire.Deployment.EndToEnd.Tests\Aspire.Deployment.EndToEnd.Tests.csproj -m:2 --no-restore 0 warnings, 0 errors (compiles the shared Hex1b helpers that gained the Go templates)
dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.CliInstallStrategyTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" 67 passed, 0 failed, 0 skipped. --list-tests (placed before the --) discovers the same 67, all in this class, including 4 new PolyglotGo cases
dotnet build tests\Infrastructure.Tests\Infrastructure.Tests.csproj -m:2 --no-restore 0 warnings, 0 errors
dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-method "*.RealMapRepresentativeCliE2eRuntimeConsumerSelectsCliE2e" 4 passed, 0 failed
dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-namespace "Infrastructure.Tests.TestTriggerMap" 351 total, 329 passed, 22 failed (exit 2)

The 22 TestTriggerMap failures are pre-existing and Windows-only: 5 SelectTestsCliTests and 17 PrComparisonBaseTests data rows. A control run on a clean 82c3b01ce1 (the main tip before this rebase) gave 349 total, 327 passed and the same 22 failures, caused by bash receiving mangled Windows paths and an UnauthorizedAccessException deleting a temporary git repository. This branch adds the 2 passing rows.

The shell fragments of the three newest commits were also run outside CI. 27 cases ran against stub aspire and kubectl executables, with the fragments extracted from the C# sources so the dry run cannot drift from the tests: the grep checks accept the exact value and reject a wrong, empty or longer one, the baseline snapshot and put-back restore the stale SDK, and the kubectl wait command covers exactly api and cache. Real kubectl v1.36.1 against a throwaway fake API server confirmed the difference the Kubernetes test relies on: in an empty namespace kubectl get pods --no-headers exits 0 while kubectl wait --for=condition=Ready exits 1 with no matching resources found, and with only an api pod Ready the wait exits 0 for api and 1 for cache.

Not run locally: all seven new E2E classes. They need Docker (and kind for the Kubernetes test), the CLI archive and the new PolyglotGo image, so CI is their only execution. All ten passed on c788f994e7 and again on 962ebc83a4, so the snapshot, put-back and restore flow in GoCodegenValidationTests and the kubectl wait check on a real kind cluster in GoKubernetesDeployTests have run end to end in CI. A crash-looping api or an image pull failure fails the Kubernetes test by design.

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

Go AppHost E2E tests need the Go toolchain on top of the shared polyglot base image, the same way Java tests need a JDK. Add Dockerfile.e2e-polyglot-go, the PolyglotGo DockerfileVariant and the build, upload, download and load plumbing for the prebuilt image. The image is only downloaded for split jobs whose class name starts with Go, so other jobs do not transfer the extra tarball.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Adds AspireTemplate.GoStarter and GoEmptyAppHost with their prompt sequences, a direct aspire-go-empty helper, and a single EnableExperimentalGoSupportAsync helper that owns the experimentalPolyglotGo gate so dropping the flag is a one-line change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Covers the Go starter (aspire new, go build, start, stop), the Go empty AppHost from both the template picker and the direct template command, and SDK regeneration on aspire add and aspire restore. They run on the PolyglotGo image and enable the experimentalPolyglotGo gate through the single helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Mirrors the TypeScript scenarios: stopping a Go AppHost by directory, secret CRUD with environment scopes, Docker Compose publish (explicit and default output path, service callback, generated Go app Dockerfile) and a KinD plus Helm deploy of the Go starter. The Kubernetes test runs go mod tidy in the starter API first because the template ships no go.sum and the container build needs one.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
The Go CLI E2E tests restore Aspire.Hosting.Go and Aspire.Hosting.CodeGeneration.Go from the repo-built package source at runtime, an edge the ProjectGraph cannot see. List both packages with the other CLI E2E runtime consumers, and cover them in the representative runtime-consumer theory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21189

Or

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

@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

Template selection and callback merging prevent new scenarios from completing, while startup and deletion assertions need stronger verification.

4 open issues
What changed in this PR

Adds Go AppHost coverage to Aspire’s CLI end-to-end suite, supporting the Go general-availability effort.

Changes:

  • Adds ten tests covering templates, code generation, lifecycle, secrets, publishing, and Kubernetes deployment.
  • Introduces a Go-enabled Docker image and CI artifact handling.
  • Extends shared helpers and Go runtime-package test routing.
File Description
tests/​Shared/​Hex1bTestHelpers.cs Adds Go template selections.
tests/​Shared/​Hex1bAutomatorTestHelpers.cs Adds asynchronous Go template selection.
tests/​Shared/​Docker/​Dockerfile.e2e-polyglot-go Provides Go tooling and buildx.
tests/​Infrastructure.Tests/​TestTriggerMap/​SelectTestsAcceptanceTests.cs Checks Go package routing.
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​GoAppHostTestHelpers.cs Supports editing generated Go AppHosts.
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​CliInstallStrategyTests.cs Tests Go image selection.
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​CliE2ETestHelpers.cs Configures the Go image variant.
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​CliE2EAutomatorHelpers.cs Adds Go CLI workflow helpers.
tests/​Aspire.Cli.EndToEnd.Tests/​GoStarterTemplateTests.cs Exercises starter creation and lifecycle.
tests/​Aspire.Cli.EndToEnd.Tests/​GoSecretAppHostTests.cs Exercises secrets and environment scoping.
tests/​Aspire.Cli.EndToEnd.Tests/​GoPublishTests.cs Covers Compose publishing and Dockerfile generation.
tests/​Aspire.Cli.EndToEnd.Tests/​GoPolyglotApphostDirectoryTests.cs Tests stopping through directory discovery.
tests/​Aspire.Cli.EndToEnd.Tests/​GoKubernetesDeployTests.cs Adds KinD deployment coverage.
tests/​Aspire.Cli.EndToEnd.Tests/​GoEmptyAppHostTemplateTests.cs Exercises both empty-template entry points.
tests/​Aspire.Cli.EndToEnd.Tests/​GoCodegenValidationTests.cs Checks SDK generation and refresh.
eng/​scripts/​load-cli-e2e-images.sh Loads and exports Go image settings.
eng/​github-ci/​test-trigger-map.yml Routes Go package changes to CLI tests.
docs/​ci/​cli-e2e-images.md Documents the Go image contract.
.github/​workflows/​warm-cli-e2e-image-cache.yml Includes Go Dockerfile changes.
.github/​workflows/​run-tests.yml Loads the image for Go test jobs.
.github/​workflows/​reproduce-flaky-tests.yml Supplies the image for reproduction.
.github/​workflows/​build-cli-e2e-image.yml Builds and uploads the Go image.

Review effort: Balanced

The PolyglotGo image has no .NET SDK, so the template list omits the two C# starters and a Down count that is right with an SDK clamps onto Empty AppHost. Type the entry's name instead (Go API for the starter, Go for the language prompt). The prompt jumps to the first entry whose text contains what was typed, and each step still waits for the expected selection before pressing Enter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
A Configure func inside the generated Go options struct panics when the options are merged (#18080), so the AppHost drops the WithHelm callback and the deploy uses the Helm defaults: namespace default and chart version 0.1.0. The namespace and chart version parameters can return once that merge is fixed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Deleting a secret and then waiting for another secret's name on screen cannot show the deleted one is gone. List the secrets as JSON, which is keyed by secret name, and assert the complete collection.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e

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

Three test checks can pass without validating their intended results.

1 open issue
3 previously missed issues

In code that hasn't changed since last review

Medium severity Restore stale SDK and hash before package restore

tests/​Aspire.Cli.EndToEnd.Tests/​GoCodegenValidationTests.cs:57

GuestAppHostProject.AddPackageAsync already calls BuildAndGenerateSdkAsync (src/Aspire.Cli/Projects/GuestAppHostProject.cs:1786–1795). The new AddSqlServer binding and hash therefore exist before this restore runs, so even a restore that does no generation passes. Reinstate the baseline SDK and hash after adding the package so restore must refresh stale output.

Medium severity Ensure expected pods exist and become ready

tests/​Aspire.Cli.EndToEnd.Tests/​GoKubernetesDeployTests.cs:114

kubectl get pods succeeds even when the namespace has no pods, and this test never checks its output. Helm's --wait only waits for workloads present in the chart, so omitting api or cache can still pass. Require pods for both expected components to exist and become ready before cleanup.

Medium severity Validate output from the current command

tests/​Aspire.Cli.EndToEnd.Tests/​GoSecretAppHostTests.cs:51

This wait can match test-key-123 still on screen from the earlier secret set command. The success-prompt check only verifies the exit code, so a getter returning the wrong value with exit code 0 can pass. Validate the current command's output rather than searching the terminal's existing text.

3 resolved since last review

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

The get and list steps waited for the secret value and key on screen, but both strings are part of the earlier secret set command lines that are still visible, so the waits passed even when the commands printed nothing and the numbered prompt only reported the exit code. Both steps now pipe the CLI output through grep, like the Staging and Production checks in the same test, so grep decides the exit status that the prompt reports.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
aspire add already regenerates the SDK, so by the time the second restore ran, aspire.go exposed AddSqlServer and .codegen-hash had changed, and the test passed even if restore did nothing. The test now copies the baseline aspire.go and .codegen-hash inside the container before aspire add and puts them back afterwards, so restore starts from a stale SDK. It also asserts the baseline hash file exists instead of treating a missing file as null.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
kubectl get pods succeeds on an empty namespace and Helm --wait only waits for workloads that are in the chart, so a chart missing api or cache still passed. Wait for Ready pods selected by app.kubernetes.io/component for api and cache instead; kubectl wait exits 1 with 'no matching resources found' when nothing matches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Reported validation predates the latest picker, Kubernetes, and secrets revisions, which still need successful Docker/KinD end-to-end execution.

1 open issue

Review effort: Balanced

@IEvangelist

Copy link
Copy Markdown
Member Author

Follow-up to the Copilot review that listed three assertions in the Go E2E tests that could pass without proving anything. All three held up and are fixed in the last three commits:

  • Restore (5506d5944a): GoCodegenValidationTests puts a stale SDK back after aspire add and asserts that aspire restore regenerates it.
  • Secrets (dad6c38807): secret get and secret list output is checked with grep and an echo marker, because the typed secret set command line already contains the key and value.
  • Kubernetes (962ebc83a4): kubectl wait --for=condition=Ready for the api and cache pods, because kubectl get pods exits 0 on an empty namespace.

Checked locally: the E2E and Deployment E2E projects build, the shell fragments ran in 27 dry-run cases against stub aspire and kubectl, and real kubectl ran against a fake API server. Not run: the E2E classes themselves (they need Docker, kind and the PolyglotGo image), so CI on 962ebc83a4 is the first real run of these three. The description has the details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@IEvangelist
David Pine (IEvangelist) marked this pull request as draft October 20, 2026 13:29
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review October 21, 2026 21:45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, David! This looks good to me. The PolyglotGo image follows the Java variant at every step (build with mirror retry, save/upload, load script, env-var contract, local fallback and unit tests). The trigger-map additions cover the new runtime consumers, and the earlier feedback on picker selection, the WithHelm callback and the delete check is addressed.

The inline comments are minor and can be small updates before merge or follow-ups.

One coordination note: #21183 removes the experimentalPolyglotGo flag. Whichever of the two PRs merges second needs to drop this PR's use of the flag, which is just EnableExperimentalGoSupportAsync and its call sites.

Comment thread tests/Shared/Hex1bTestHelpers.cs Resolved
- Assert Go secret get/list output with RunCommandAsync instead of waiting for an
  echoed marker that is already part of the typed command line. This also restores
  the intended 30 second bound, which the following default-timeout prompt wait
  had been silently replacing.
- Wait for the Go language picker to highlight "> Go" before pressing Enter in the
  Go empty AppHost template helpers, matching the existing Go starter and
  language-selection helpers.
- Note in the Go Dockerfile's DisableDockerDetector justification that the Go
  toolchain image copied with COPY --from is registered through
  polyglot-validation/Dockerfile.golang.

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

Copy link
Copy Markdown
Contributor

Tests selector

Selects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching '.github/workflows/run-tests.yml' selects ALL


Selection computed for commit 279e46c.

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 blocking issues remain, all ten new scenarios reportedly passed CI, and deferred coverage gaps are explicitly tracked.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@IEvangelist
David Pine (IEvangelist) merged commit 0bad09a into main Oct 28, 2026
1320 of 1334 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 28, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → test_only / build_or_ci_only (proven false positive).

Triggered signal: pr_body_has_cli_flag_mention (evidence: PR body table mentions --apphost <dir> in a test description). The signal is a false positive: all changed files are under tests/**, .github/workflows/**, eng/**, or docs/ci/**. They add Go AppHost CLI E2E tests and a PolyglotGo test image. The PR adds no user-facing behavior and no new flag.

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

## Description

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

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

What changed:

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

Fixes #21106

## Validation

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

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

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

### Before merging

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

## Checklist

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

---------

Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
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