Repository navigation
Remove the Go AppHost experimental feature flag - #21183
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21183Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21183" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Human confirmation is needed that prerequisites #21108, #21110, #21112, and #21114 have landed and passed validation before this merge-last switch.
No open issues 🎉
What changed in this PR
Makes Go AppHosts available by default through Aspire CLI discovery, aspire new, and aspire init. This is the merge-last switch for the Go general availability epic #21115.
Changes:
- Removes Go’s experimental flag from CLI registration and extension schemas.
- Updates CLI tests and 52 Go fixtures to use default-enabled support.
- Removes obsolete flag setup from CI, documentation, and sample instructions.
| File | Description |
|---|---|
| tests/PolyglotAppHosts/Aspire.Hosting/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Yarp/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Valkey/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.SqlServer/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Seq/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Rust/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Redis/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.RabbitMQ/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Qdrant/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Python/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.PostgreSQL/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Orleans/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Oracle/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.OpenAI/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Nats/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.MySql/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.MongoDB/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Milvus/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Maui/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kubernetes/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Keycloak/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Kafka/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.JavaScript/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Java/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Go/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Garnet/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Docker/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.DevTunnels/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.WebPubSub/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Storage/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Sql/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.SignalR/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.ServiceBus/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Search/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Redis/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.PostgreSQL/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.OperationalInsights/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Network/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Kusto/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.KeyVault/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Functions/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.EventHubs/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.CosmosDB/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.ContainerRegistry/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.CognitiveServices/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.AppService/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.ApplicationInsights/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.AppContainers/Go/aspire.config.json | Removes fixture flag. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.AppConfiguration/Go/aspire.config.json | Removes fixture flag. |
| tests/Aspire.Cli.Tests/Projects/DefaultLanguageDiscoveryTests.cs | Verifies default Go discovery. |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Verifies Go template availability and selection. |
| tests/Aspire.Cli.Tests/Commands/NewCommandTemplateConfigPersistenceTests.cs | Removes Go flag setup. |
| tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs | Tests Go initialization without flags. |
| tests/Aspire.Cli.Tests/Commands/ConfigCommandTests.cs | Removes obsolete Go flag case. |
| src/Aspire.Hosting.CodeGeneration.Go/README.md | Updates Go setup instructions. |
| src/Aspire.Cli/Projects/DefaultLanguageDiscovery.cs | Makes Go non-experimental and always discoverable. |
| src/Aspire.Cli/KnownFeatures.cs | Removes Go flag registration. |
| playground/GoAppHost/apphost.go | Removes flag setup from comments only. |
| extension/schemas/aspire-settings.schema.json | Removes Go flag schema entry. |
| extension/schemas/aspire-global-settings.schema.json | Removes Go flag schema entry. |
| extension/schemas/aspire-config.schema.json | Removes Go flag schema entry. |
| docs/specs/polyglot-apphost.md | Documents Go as always available. |
| .github/workflows/polyglot-validation/Dockerfile.golang | Runs Go validation without flag setup. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
c845cc4 to
0e65752
Compare
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
…ve-experimental-flag Resolve the DefaultLanguageDiscovery.cs conflict with #21191: keep main's DefaultHostingPackages for the Go language and drop IsExperimental, since Go no longer has a feature flag. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Removing the feature flag also removed the README's only release-status sentence. The Aspire 17 release status in #21106 says the flag is removed while documentation clearly identifies Go AppHosts as Preview, so state that in place of the experimental notice. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests selector4 / 101 PR test projects · 5 PR jobs, from 79 changed files. Selected PR test projects (4 / 101)
Selected PR jobs (5)
How these were chosen — grouped by what changed📦 affected project 📄 📄 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
The default-on Preview rollout requires human confirmation that prerequisite #21191 is complete, merge-last sequencing is satisfied, and coordinated documentation and support are ready before merging.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
Sébastien Ros (sebastienros)
left a comment
There was a problem hiding this comment.
Thanks, David. Both earlier items are resolved: #21191 is in, so Aspire.Hosting.Go ships a stable version that the starter's {{aspireVersion}} pin can restore, and the conflict in DefaultLanguageDiscovery.cs was resolved correctly (DefaultHostingPackages kept, IsExperimental dropped).
I merged this head with current main and found no remaining references to the flag. Aspire.Cli.Tests passes for the affected classes (473/473, including DefaultHostingPackagesTests), Aspire.Cli.EndToEnd.Tests builds with no warnings, and none of the 54 Go fixtures has a features block. I didn't run the E2E tests locally; they pass in this PR's CI. The stable-version restore comes from reading the package and template settings, not from a run against a stable feed.
Two things to tidy before merging, neither blocking the code:
- The description still calls this the GA switch, while #21106 designates Go as Preview for Aspire 17.
- It also says this merges after #21108, #21110, #21112 and #21114, which are all still open, and the aspire.dev docs item is unchecked. Please confirm those are complete or don't need to hold this PR.
|
✅ No documentation update needed. Step 5 branch: docs_required → already documented by name (no flag content to document). Triggered signals: integration_readme_changed, polyglot_code_generator_changed, pr_body_has_cli_flag_mention, pr_body_has_deprecation_marker. Evidence: the only source file changes are removal of the |
## 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? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Description Generated Go AppHosts can run callbacks concurrently with the main builder chain without racing the sticky error or lazy collection accessors. Invalid request arguments and unencodable callback results now fail their individual calls instead of disconnecting every pending operation. Callback decoding errors and `runtime.Goexit` produce explicit JSON-RPC errors; message headers and cancellation requests are bounded. The Go API export also includes structured `type` and `optional` metadata for every field and constant. DTO optionality comes from ATS metadata, not the generated `omitempty` tag or pointer spelling. This is additive to schema version 1 and includes options, runtime fields, enum constants, and exported value leaves. Export snapshots and the output-format documentation are updated. Related to #21204, #21212, and #21115. This does not close either follow-up issue. The remaining structured Kubernetes manifest work is separate in #21824. ### User-facing usage Collection serialization preserves its existing signature; failures are now observable through the additive `Err` methods: ```go payload := resource.GetTags().ToJSON() if err := resource.GetTags().Err(); err != nil { return err } _ = payload ``` `aspire sdk export --language go --package Name@Version` now emits fields such as: ```json { "name": "Mode", "type": "*TestPersistenceMode", "optional": true } ``` Cancellation watchers are armed only after the invocation carrying their IDs has entered the FIFO write queue. The cancellation RPC has a five-second timeout; a canceled call still returns through its own context without waiting for that RPC. ### Validation Commands ran on Windows with the restored repository SDK and an isolated Go 1.27.3 toolchain added to `PATH`. Linux race checks used Go 1.26.10 and GCC from the existing local `aspire-go-e2e-6972:latest` image. | Command | Result | | --- | --- | | `.\restore.cmd` | Passed; 17 dependency audit warnings, no errors. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 130 tests, no failures or skips. Reviewed and accepted generated Go/JSON snapshot changes. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-method "*.GeneratedRuntime_PassesGoRuntimeHardeningTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed after adding the final actual-getter-failure assertions. | | `go test -race -timeout 60s -v .` | Passed in a generated module extracted from the Go snapshot, with `runtime_test.go`, `transport_hardening_test.go`, and `decode_test.go` from the C# tests. Includes a callback and main chaining on the same captured generated builder, encoding failures, callback errors/Goexit, header bounds, and cancellation ordering/timeout cleanup. | | `go test -race -timeout 60s -run TestCallbackAndMainCanChainOnCapturedBuilder .` | Failed as expected against the original main snapshot with data races; the same regression passes with this branch. | | `dotnet test --project tests\Aspire.Hosting.RemoteHost.Tests\Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 698 tests, 1 skipped. Includes integration scanning and Go export/codegen coverage. | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.SdkExportCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 31 tests. | | `dotnet build src\Aspire.Cli\Aspire.Cli.csproj --configuration Release /p:SkipNativeBuild=true` | Passed, with the existing ILCompiler audit warning. Managed Release build, not native AOT. | | `.\.dotnet\dotnet.exe artifacts\bin\Aspire.Cli\Release\net11.0\aspire.dll sdk export --help` | Passed; help lists Go as an export language. | | `git diff --check` | Passed. | ### Remaining policy and execution gaps - Callback registry release still needs a host release signal and a cross-language ownership contract. This PR does not unregister callbacks when a registration capability returns, because the host can invoke them later. - Disconnect-driven `os.Exit(1)` is unchanged. Choosing an observable shutdown contract requires a cross-language decision; no GA lifecycle guarantee is introduced. - The reported required-token path is currently unreachable because `SplitParameters` places all cancellation tokens in Go options. Both token-emission paths select the supplied token's context. - A bundled current-main CLI export measuring Redis/Azure Storage XML-summary coverage was not run. No documentation-copy policy was changed based solely on project-built behavior. - No new grouped export view was introduced; consumers still have `capabilityId` for grouping. The aspire.dev consumer and its grouping decision are outside this product-only change. - Native AOT publishing, the full CLI suite, a many-integration live AppHost, polyglot E2E, macOS, and the complete CI matrix were not run. Go feature-flag-off validation is obsolete because #21183 removed that flag. ### Security considerations This changes handling of AppHost JSON-RPC messages and callback payloads. Headers are limited to 16 entries and 8 KiB before body allocation, in addition to the existing 64 MiB body cap. Invalid typed callback arguments are rejected before user code is called; decoding no longer silently substitutes invalid DTO fields. No authentication, listener, or permission policy changes are made. A formal threat model/security review has not been performed. ## 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? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No The additive APIs are Go `List.Err`/`Dict.Err` and JSON export metadata; no public C# API was added. Go documentation comments describe the error contract. Triple-slash XML elements do not apply to these Go members. The fixes in this PR are complete; the explicitly deferred cross-language policy and bundle-validation items remain tracked in the related issues. --------- Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…n empty file (#21932) **What failed:** `[vscode] Aspire WinUI debug E2E > debugs an unpackaged WinUI project through its generated apphost executable` failed on attempt 1 in [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (tracker #21600, unowned rank 1): ``` AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^ready:\d+$/. Input: '' ``` **Why:** The generated WinUI fixture app wrote its ready marker with `File.WriteAllText(readyFile, …)`. That call creates the file before it writes the content. `waitForReadyMarker` polls for the file and returns its first successful read, so a poll that landed in that gap returned `''` and failed the assertion. The app had started correctly; the test read the file before the content was written. **How fixed:** The fixture app (`extension/scripts/run-e2e.js`) now writes `ready:<pid>` to `<marker>.tmp` and then `File.Move(…, overwrite: true)` renames it into place. Because the rename is atomic, the marker path is either missing or holds the full content, so the test's first read is always complete. The assertion, timeouts and polling are unchanged. The existing `e2eLaunchProfile` unit test now checks for the atomic write and rejects a direct `File.WriteAllText(readyFile, …)`. ## Failure stats (14d, attempt 1) | Scope | Attempt-1 test failures / runs where the job executed | Rate | Passed on rerun | |---|---|---|---| | PR | 4 / 457 | 0.9% | 4 / 4 | | main | 0 / 99 | 0% | n/a | Main over 30 days: 0 test-level failures in 216 runs (0 / 99 in the last 14d plus 0 / 117 in the 16 days before). This job had 9 other attempt-1 failures that never reached the test and are excluded: 8 were "hosted runner lost communication" and 1 was an `aspire-extension` artifact download failure. Test-level failures (all four): - [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (PR #21921, unrelated Java debug change): `The input did not match the regular expression /^ready:\d+$/. Input: ''` ← **fixed by this PR** - [42257446455](https://github.com/microsoft/aspire/actions/runs/42257446455/job/128037952447) (PR branch `aspireagent/fix-e2e-notification-dismiss-hover-race`): `Timed out after 120000ms waiting for the C# language server to resolve generated InitializeComponent … Last definitions: []` (the `tree-actions` shard also failed in the same attempt) - [41532732531](https://github.com/microsoft/aspire/actions/runs/41532732531/job/125585902027) (PR #20950): `Timed out after 240000ms waiting for the WinUI OnLaunched marker.` AppHost hosting startup took 1m42s, and 4 other Windows shards failed in the same attempt. - [41501727353](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481870825) (PR #21183): `The C# definition probe for InitializeComponent … Timed out after 129ms waiting for E2E control revision`. `dotnet --list-runtimes` took 53s, Roslyn never started, and 6 other shards failed in the same attempt. All four are genuine flakes, not caused by their PRs. The last three come from whole-runner slowness on Windows, which is tracked in #21570 with telemetry in #21644. This PR does not address them because fixing them would mean raising timeouts. **Local regression evidence:** A harness ran the fixture's exact before/after C# writer against a Node reader that uses `waitForReadyMarker`'s semantics (first successful read is asserted against `/^ready:\d+$/`), polling tightly, with 500 marker publications per run: - Before (`File.WriteAllText(readyFile, …)`): **10/10 runs** saw an empty marker (475–496 torn first reads out of about 500 per run). - After (write `.tmp`, then `File.Move` with `overwrite: true`): **0/10 runs** saw an empty marker (0 torn reads out of about 4,980 publications). The harness ran on Linux. On Windows, `File.Move(overwrite: true)` maps to `MoveFileEx(MOVEFILE_REPLACE_EXISTING)` within the same directory, which is also atomic for readers. **PR CI** ([run 42472017876](https://github.com/microsoft/aspire/actions/runs/42472017876)): `VS Code extension E2E (Windows, winui-debug)` and the Windows extension unit tests (including the updated `e2eLaunchProfile` test) passed on attempt 1. Three unrelated jobs failed on attempt 1: a GitHub 'Unicorn' outage while downloading Deno in `launch-profiles`, and the known `tree-actions` flakes (`Expected e2e-worker to expose an endpoint URL`, addressed by #21914; `Timed out … waiting for running AppHost` on Linux). After reruns, all 70 checks pass. **Verdict: MODERATE.** The fixed race is proven deterministically (10/10 → 0/10) and matches the newest failure's exact signature. However, it accounts for only 1 of the 4 attempt-1 test failures in 14d. The other 3 belong to the Windows runner-slowness family in #21570. ## Confidence High that this removes the empty-marker failure mode: the gap is inherent to `File.WriteAllText` and the reader returns on its first read. Low that it changes the C# language server / OnLaunched timeout failures, which this PR does not target. **How we stop this recurring:** Fixture processes that publish readiness files for E2E polling should write a temp file and rename it into place. The unit test now enforces this for the WinUI marker. ## 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 - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Description Generated Go AppHosts can run callbacks concurrently with the main builder chain without racing the sticky error or lazy collection accessors. Invalid request arguments and unencodable callback results now fail their individual calls instead of disconnecting every pending operation. Callback decoding errors and `runtime.Goexit` produce explicit JSON-RPC errors; message headers and cancellation requests are bounded. The Go API export also includes structured `type` and `optional` metadata for every field and constant. DTO optionality comes from ATS metadata, not the generated `omitempty` tag or pointer spelling. This is additive to schema version 1 and includes options, runtime fields, enum constants, and exported value leaves. Export snapshots and the output-format documentation are updated. Related to #21204, #21212, and #21115. This does not close either follow-up issue. The remaining structured Kubernetes manifest work is separate in #21824. ### User-facing usage Collection serialization preserves its existing signature; failures are now observable through the additive `Err` methods: ```go payload := resource.GetTags().ToJSON() if err := resource.GetTags().Err(); err != nil { return err } _ = payload ``` `aspire sdk export --language go --package Name@Version` now emits fields such as: ```json { "name": "Mode", "type": "*TestPersistenceMode", "optional": true } ``` Cancellation watchers are armed only after the invocation carrying their IDs has entered the FIFO write queue. The cancellation RPC has a five-second timeout; a canceled call still returns through its own context without waiting for that RPC. ### Validation Commands ran on Windows with the restored repository SDK and an isolated Go 1.27.3 toolchain added to `PATH`. Linux race checks used Go 1.26.10 and GCC from the existing local `aspire-go-e2e-6972:latest` image. | Command | Result | | --- | --- | | `.\restore.cmd` | Passed; 17 dependency audit warnings, no errors. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 130 tests, no failures or skips. Reviewed and accepted generated Go/JSON snapshot changes. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-method "*.GeneratedRuntime_PassesGoRuntimeHardeningTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed after adding the final actual-getter-failure assertions. | | `go test -race -timeout 60s -v .` | Passed in a generated module extracted from the Go snapshot, with `runtime_test.go`, `transport_hardening_test.go`, and `decode_test.go` from the C# tests. Includes a callback and main chaining on the same captured generated builder, encoding failures, callback errors/Goexit, header bounds, and cancellation ordering/timeout cleanup. | | `go test -race -timeout 60s -run TestCallbackAndMainCanChainOnCapturedBuilder .` | Failed as expected against the original main snapshot with data races; the same regression passes with this branch. | | `dotnet test --project tests\Aspire.Hosting.RemoteHost.Tests\Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 698 tests, 1 skipped. Includes integration scanning and Go export/codegen coverage. | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.SdkExportCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 31 tests. | | `dotnet build src\Aspire.Cli\Aspire.Cli.csproj --configuration Release /p:SkipNativeBuild=true` | Passed, with the existing ILCompiler audit warning. Managed Release build, not native AOT. | | `.\.dotnet\dotnet.exe artifacts\bin\Aspire.Cli\Release\net11.0\aspire.dll sdk export --help` | Passed; help lists Go as an export language. | | `git diff --check` | Passed. | ### Remaining policy and execution gaps - Callback registry release still needs a host release signal and a cross-language ownership contract. This PR does not unregister callbacks when a registration capability returns, because the host can invoke them later. - Disconnect-driven `os.Exit(1)` is unchanged. Choosing an observable shutdown contract requires a cross-language decision; no GA lifecycle guarantee is introduced. - The reported required-token path is currently unreachable because `SplitParameters` places all cancellation tokens in Go options. Both token-emission paths select the supplied token's context. - A bundled current-main CLI export measuring Redis/Azure Storage XML-summary coverage was not run. No documentation-copy policy was changed based solely on project-built behavior. - No new grouped export view was introduced; consumers still have `capabilityId` for grouping. The aspire.dev consumer and its grouping decision are outside this product-only change. - Native AOT publishing, the full CLI suite, a many-integration live AppHost, polyglot E2E, macOS, and the complete CI matrix were not run. Go feature-flag-off validation is obsolete because #21183 removed that flag. ### Security considerations This changes handling of AppHost JSON-RPC messages and callback payloads. Headers are limited to 16 entries and 8 KiB before body allocation, in addition to the existing 64 MiB body cap. Invalid typed callback arguments are rejected before user code is called; decoding no longer silently substitutes invalid DTO fields. No authentication, listener, or permission policy changes are made. A formal threat model/security review has not been performed. ## 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? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No The additive APIs are Go `List.Err`/`Dict.Err` and JSON export metadata; no public C# API was added. Go documentation comments describe the error contract. Triple-slash XML elements do not apply to these Go members. The fixes in this PR are complete; the explicitly deferred cross-language policy and bundle-validation items remain tracked in the related issues. --------- 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 e7ff435)
## Description Generated Go AppHosts can run callbacks concurrently with the main builder chain without racing the sticky error or lazy collection accessors. Invalid request arguments and unencodable callback results now fail their individual calls instead of disconnecting every pending operation. Callback decoding errors and `runtime.Goexit` produce explicit JSON-RPC errors; message headers and cancellation requests are bounded. The Go API export also includes structured `type` and `optional` metadata for every field and constant. DTO optionality comes from ATS metadata, not the generated `omitempty` tag or pointer spelling. This is additive to schema version 1 and includes options, runtime fields, enum constants, and exported value leaves. Export snapshots and the output-format documentation are updated. Related to #21204, #21212, and #21115. This does not close either follow-up issue. The remaining structured Kubernetes manifest work is separate in #21824. ### User-facing usage Collection serialization preserves its existing signature; failures are now observable through the additive `Err` methods: ```go payload := resource.GetTags().ToJSON() if err := resource.GetTags().Err(); err != nil { return err } _ = payload ``` `aspire sdk export --language go --package Name@Version` now emits fields such as: ```json { "name": "Mode", "type": "*TestPersistenceMode", "optional": true } ``` Cancellation watchers are armed only after the invocation carrying their IDs has entered the FIFO write queue. The cancellation RPC has a five-second timeout; a canceled call still returns through its own context without waiting for that RPC. ### Validation Commands ran on Windows with the restored repository SDK and an isolated Go 1.27.3 toolchain added to `PATH`. Linux race checks used Go 1.26.10 and GCC from the existing local `aspire-go-e2e-6972:latest` image. | Command | Result | | --- | --- | | `.\restore.cmd` | Passed; 17 dependency audit warnings, no errors. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 130 tests, no failures or skips. Reviewed and accepted generated Go/JSON snapshot changes. | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-method "*.GeneratedRuntime_PassesGoRuntimeHardeningTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed after adding the final actual-getter-failure assertions. | | `go test -race -timeout 60s -v .` | Passed in a generated module extracted from the Go snapshot, with `runtime_test.go`, `transport_hardening_test.go`, and `decode_test.go` from the C# tests. Includes a callback and main chaining on the same captured generated builder, encoding failures, callback errors/Goexit, header bounds, and cancellation ordering/timeout cleanup. | | `go test -race -timeout 60s -run TestCallbackAndMainCanChainOnCapturedBuilder .` | Failed as expected against the original main snapshot with data races; the same regression passes with this branch. | | `dotnet test --project tests\Aspire.Hosting.RemoteHost.Tests\Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 698 tests, 1 skipped. Includes integration scanning and Go export/codegen coverage. | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.SdkExportCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed: 31 tests. | | `dotnet build src\Aspire.Cli\Aspire.Cli.csproj --configuration Release /p:SkipNativeBuild=true` | Passed, with the existing ILCompiler audit warning. Managed Release build, not native AOT. | | `.\.dotnet\dotnet.exe artifacts\bin\Aspire.Cli\Release\net11.0\aspire.dll sdk export --help` | Passed; help lists Go as an export language. | | `git diff --check` | Passed. | ### Remaining policy and execution gaps - Callback registry release still needs a host release signal and a cross-language ownership contract. This PR does not unregister callbacks when a registration capability returns, because the host can invoke them later. - Disconnect-driven `os.Exit(1)` is unchanged. Choosing an observable shutdown contract requires a cross-language decision; no GA lifecycle guarantee is introduced. - The reported required-token path is currently unreachable because `SplitParameters` places all cancellation tokens in Go options. Both token-emission paths select the supplied token's context. - A bundled current-main CLI export measuring Redis/Azure Storage XML-summary coverage was not run. No documentation-copy policy was changed based solely on project-built behavior. - No new grouped export view was introduced; consumers still have `capabilityId` for grouping. The aspire.dev consumer and its grouping decision are outside this product-only change. - Native AOT publishing, the full CLI suite, a many-integration live AppHost, polyglot E2E, macOS, and the complete CI matrix were not run. Go feature-flag-off validation is obsolete because #21183 removed that flag. ### Security considerations This changes handling of AppHost JSON-RPC messages and callback payloads. Headers are limited to 16 entries and 8 KiB before body allocation, in addition to the existing 64 MiB body cap. Invalid typed callback arguments are rejected before user code is called; decoding no longer silently substitutes invalid DTO fields. No authentication, listener, or permission policy changes are made. A formal threat model/security review has not been performed. ## 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? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] No - [ ] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No The additive APIs are Go `List.Err`/`Dict.Err` and JSON export metadata; no public C# API was added. Go documentation comments describe the error contract. Triple-slash XML elements do not apply to these Go members. The fixes in this PR are complete; the explicitly deferred cross-language policy and bundle-validation items remain tracked in the related issues. --------- 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 e7ff435)
…n empty file (#21932) **What failed:** `[vscode] Aspire WinUI debug E2E > debugs an unpackaged WinUI project through its generated apphost executable` failed on attempt 1 in [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (tracker #21600, unowned rank 1): ``` AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^ready:\d+$/. Input: '' ``` **Why:** The generated WinUI fixture app wrote its ready marker with `File.WriteAllText(readyFile, …)`. That call creates the file before it writes the content. `waitForReadyMarker` polls for the file and returns its first successful read, so a poll that landed in that gap returned `''` and failed the assertion. The app had started correctly; the test read the file before the content was written. **How fixed:** The fixture app (`extension/scripts/run-e2e.js`) now writes `ready:<pid>` to `<marker>.tmp` and then `File.Move(…, overwrite: true)` renames it into place. Because the rename is atomic, the marker path is either missing or holds the full content, so the test's first read is always complete. The assertion, timeouts and polling are unchanged. The existing `e2eLaunchProfile` unit test now checks for the atomic write and rejects a direct `File.WriteAllText(readyFile, …)`. ## Failure stats (14d, attempt 1) | Scope | Attempt-1 test failures / runs where the job executed | Rate | Passed on rerun | |---|---|---|---| | PR | 4 / 457 | 0.9% | 4 / 4 | | main | 0 / 99 | 0% | n/a | Main over 30 days: 0 test-level failures in 216 runs (0 / 99 in the last 14d plus 0 / 117 in the 16 days before). This job had 9 other attempt-1 failures that never reached the test and are excluded: 8 were "hosted runner lost communication" and 1 was an `aspire-extension` artifact download failure. Test-level failures (all four): - [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (PR #21921, unrelated Java debug change): `The input did not match the regular expression /^ready:\d+$/. Input: ''` ← **fixed by this PR** - [42257446455](https://github.com/microsoft/aspire/actions/runs/42257446455/job/128037952447) (PR branch `aspireagent/fix-e2e-notification-dismiss-hover-race`): `Timed out after 120000ms waiting for the C# language server to resolve generated InitializeComponent … Last definitions: []` (the `tree-actions` shard also failed in the same attempt) - [41532732531](https://github.com/microsoft/aspire/actions/runs/41532732531/job/125585902027) (PR #20950): `Timed out after 240000ms waiting for the WinUI OnLaunched marker.` AppHost hosting startup took 1m42s, and 4 other Windows shards failed in the same attempt. - [41501727353](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481870825) (PR #21183): `The C# definition probe for InitializeComponent … Timed out after 129ms waiting for E2E control revision`. `dotnet --list-runtimes` took 53s, Roslyn never started, and 6 other shards failed in the same attempt. All four are genuine flakes, not caused by their PRs. The last three come from whole-runner slowness on Windows, which is tracked in #21570 with telemetry in #21644. This PR does not address them because fixing them would mean raising timeouts. **Local regression evidence:** A harness ran the fixture's exact before/after C# writer against a Node reader that uses `waitForReadyMarker`'s semantics (first successful read is asserted against `/^ready:\d+$/`), polling tightly, with 500 marker publications per run: - Before (`File.WriteAllText(readyFile, …)`): **10/10 runs** saw an empty marker (475–496 torn first reads out of about 500 per run). - After (write `.tmp`, then `File.Move` with `overwrite: true`): **0/10 runs** saw an empty marker (0 torn reads out of about 4,980 publications). The harness ran on Linux. On Windows, `File.Move(overwrite: true)` maps to `MoveFileEx(MOVEFILE_REPLACE_EXISTING)` within the same directory, which is also atomic for readers. **PR CI** ([run 42472017876](https://github.com/microsoft/aspire/actions/runs/42472017876)): `VS Code extension E2E (Windows, winui-debug)` and the Windows extension unit tests (including the updated `e2eLaunchProfile` test) passed on attempt 1. Three unrelated jobs failed on attempt 1: a GitHub 'Unicorn' outage while downloading Deno in `launch-profiles`, and the known `tree-actions` flakes (`Expected e2e-worker to expose an endpoint URL`, addressed by #21914; `Timed out … waiting for running AppHost` on Linux). After reruns, all 70 checks pass. **Verdict: MODERATE.** The fixed race is proven deterministically (10/10 → 0/10) and matches the newest failure's exact signature. However, it accounts for only 1 of the 4 attempt-1 test failures in 14d. The other 3 belong to the Windows runner-slowness family in #21570. ## Confidence High that this removes the empty-marker failure mode: the gap is inherent to `File.WriteAllText` and the reader returns on its first read. Low that it changes the C# language server / OnLaunched timeout failures, which this PR does not target. **How we stop this recurring:** Fixture processes that publish readiness files for E2E polling should write a temp file and rename it into place. The unit test now enforces this for the WinUI marker. ## 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 - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 8f00c66)
…n empty file (#21932) **What failed:** `[vscode] Aspire WinUI debug E2E > debugs an unpackaged WinUI project through its generated apphost executable` failed on attempt 1 in [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (tracker #21600, unowned rank 1): ``` AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^ready:\d+$/. Input: '' ``` **Why:** The generated WinUI fixture app wrote its ready marker with `File.WriteAllText(readyFile, …)`. That call creates the file before it writes the content. `waitForReadyMarker` polls for the file and returns its first successful read, so a poll that landed in that gap returned `''` and failed the assertion. The app had started correctly; the test read the file before the content was written. **How fixed:** The fixture app (`extension/scripts/run-e2e.js`) now writes `ready:<pid>` to `<marker>.tmp` and then `File.Move(…, overwrite: true)` renames it into place. Because the rename is atomic, the marker path is either missing or holds the full content, so the test's first read is always complete. The assertion, timeouts and polling are unchanged. The existing `e2eLaunchProfile` unit test now checks for the atomic write and rejects a direct `File.WriteAllText(readyFile, …)`. ## Failure stats (14d, attempt 1) | Scope | Attempt-1 test failures / runs where the job executed | Rate | Passed on rerun | |---|---|---|---| | PR | 4 / 457 | 0.9% | 4 / 4 | | main | 0 / 99 | 0% | n/a | Main over 30 days: 0 test-level failures in 216 runs (0 / 99 in the last 14d plus 0 / 117 in the 16 days before). This job had 9 other attempt-1 failures that never reached the test and are excluded: 8 were "hosted runner lost communication" and 1 was an `aspire-extension` artifact download failure. Test-level failures (all four): - [42448442647](https://github.com/microsoft/aspire/actions/runs/42448442647/job/128635064936) (PR #21921, unrelated Java debug change): `The input did not match the regular expression /^ready:\d+$/. Input: ''` ← **fixed by this PR** - [42257446455](https://github.com/microsoft/aspire/actions/runs/42257446455/job/128037952447) (PR branch `aspireagent/fix-e2e-notification-dismiss-hover-race`): `Timed out after 120000ms waiting for the C# language server to resolve generated InitializeComponent … Last definitions: []` (the `tree-actions` shard also failed in the same attempt) - [41532732531](https://github.com/microsoft/aspire/actions/runs/41532732531/job/125585902027) (PR #20950): `Timed out after 240000ms waiting for the WinUI OnLaunched marker.` AppHost hosting startup took 1m42s, and 4 other Windows shards failed in the same attempt. - [41501727353](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481870825) (PR #21183): `The C# definition probe for InitializeComponent … Timed out after 129ms waiting for E2E control revision`. `dotnet --list-runtimes` took 53s, Roslyn never started, and 6 other shards failed in the same attempt. All four are genuine flakes, not caused by their PRs. The last three come from whole-runner slowness on Windows, which is tracked in #21570 with telemetry in #21644. This PR does not address them because fixing them would mean raising timeouts. **Local regression evidence:** A harness ran the fixture's exact before/after C# writer against a Node reader that uses `waitForReadyMarker`'s semantics (first successful read is asserted against `/^ready:\d+$/`), polling tightly, with 500 marker publications per run: - Before (`File.WriteAllText(readyFile, …)`): **10/10 runs** saw an empty marker (475–496 torn first reads out of about 500 per run). - After (write `.tmp`, then `File.Move` with `overwrite: true`): **0/10 runs** saw an empty marker (0 torn reads out of about 4,980 publications). The harness ran on Linux. On Windows, `File.Move(overwrite: true)` maps to `MoveFileEx(MOVEFILE_REPLACE_EXISTING)` within the same directory, which is also atomic for readers. **PR CI** ([run 42472017876](https://github.com/microsoft/aspire/actions/runs/42472017876)): `VS Code extension E2E (Windows, winui-debug)` and the Windows extension unit tests (including the updated `e2eLaunchProfile` test) passed on attempt 1. Three unrelated jobs failed on attempt 1: a GitHub 'Unicorn' outage while downloading Deno in `launch-profiles`, and the known `tree-actions` flakes (`Expected e2e-worker to expose an endpoint URL`, addressed by #21914; `Timed out … waiting for running AppHost` on Linux). After reruns, all 70 checks pass. **Verdict: MODERATE.** The fixed race is proven deterministically (10/10 → 0/10) and matches the newest failure's exact signature. However, it accounts for only 1 of the 4 attempt-1 test failures in 14d. The other 3 belong to the Windows runner-slowness family in #21570. ## Confidence High that this removes the empty-marker failure mode: the gap is inherent to `File.WriteAllText` and the reader returns on its first read. Low that it changes the C# language server / OnLaunched timeout failures, which this PR does not target. **How we stop this recurring:** Fixture processes that publish readiness files for E2E polling should write a temp file and rename it into place. The unit test now enforces this for the WinUI marker. ## 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 - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 8f00c66)
…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>

Important
Merge last. This PR depends on the other open Go AppHost PRs and must land after them.
aspire sdk export -l go(Go API reference exporter) #21195 (SdkExportCommandTests) and Add a Go AppHost tooling check to aspire doctor #21196 (GoAppHostToolingCheckand its tests).DefaultLanguageDiscovery.csand this PR rebases onto it: Record default hosting packages when scaffolding a guest AppHost #21191.Description
Removes the
experimentalPolyglotGofeature 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-interactiveaspire new, and Go is offered byaspire initlanguage 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:
KnownFeaturesdrops the Go flag andDefaultLanguageDiscoveryno longer marks Go experimental.LanguageInfo.IsExperimentalis kept because Python, Java and Rust still use it.experimentalPolyglotGoin a user's configuration is ignored with no warning, matching what happened to the TypeScript flag when it was removed.Featuresonly reads named keys, and the extension schemas setadditionalProperties: false, so VS Code flags the stale key.aspire-config,aspire-global-settingsandaspire-settingsare regenerated withextension/scripts/generate-schema.js. Only the 16-line Go block is removed from each.tests/PolyglotAppHosts/*/Go/aspire.config.jsonfiles and.github/workflows/polyglot-validation/Dockerfile.golangno longer set the key.aspire initlanguage 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> JavainJavaPolyglotTests,JavaCodegenValidationTestsandJavaPolyglotApphostDirectoryTests; each now presses Down once more, with a comment stating the picker order. The order comes fromDefaultLanguageDiscovery,LanguageServiceandCliTemplateFactory. TypeScript flows are unaffected because TypeScript sorts before Go.DefaultLanguageDiscoveryTests,NewCommandTests,ConfigCommandTests,NewCommandTemplateConfigPersistenceTestsandInitCommandTestsnow 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/specs/polyglot-apphost.md, the Go code generation README andplayground/GoAppHost/apphost.gono longer mention the flag.Fixes #21106
Validation
.\restore.cmddotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj -m:2 --no-restoredotnet 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"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"node extension\scripts\generate-schema.jsexperimentalPolyglotGoand its variantsRun in PR CI instead of locally, all passing on
0e65752d44: the three Java E2E tests (JavaPolyglotTests,JavaCodegenValidationTestsandJavaPolyglotApphostDirectoryTests; they need Docker, so CI was the first execution of the extra Down press),Infrastructure.Testsand the VS Code extension unit and E2E jobs.Not run: the VS Code new-project flow in an extension host (
extension/src/commands/new.tsjust runsaspire new).Before merging
experimentalPolyglotGo,KnownFeatures.ExperimentalPolyglotGo,EnableExperimentalGoSupportAsync,features__experimentalPolyglotGoandexperimentalPolyglot:go, because open Go branches add flag setup of their own and this PR must merge after all of them. Today that covers Add Go AppHost CLI end-to-end tests and a PolyglotGo image #21189 (theEnableExperimentalGoSupportAsynchelper and its call sites in every Go scenario), Addaspire sdk export -l go(Go API reference exporter) #21195 (SdkExportCommandTestssetsKnownFeatures.ExperimentalPolyglotGo) and Add a Go AppHost tooling check to aspire doctor #21196 (GoAppHostToolingCheckTestsbuilds its language discovery with the flag, including agoEnabled: falsecase that stops being meaningful, andGoAppHostToolingCheckhas 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.DefaultHostingPackages = ["Aspire.Hosting.Go"]to Go'sLanguageInfoin the same hunk ofDefaultLanguageDiscovery.cs(aspire init --language {X}should add language-specific hosting packages by default #21045). Keep that initializer and dropIsExperimental: true.Checklist
<remarks />and<code />elements on your triple slash comments?