David Pine
90d · built 2026-11-30
Performance
What David Pine shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+1621.7engineers
delivers like 1622.7 (1622.7x pre-AI)
Output (ETV)
48.7ETV
+146.5% vs 19.8 prior
Features share
30.9%
+0.8 pp vs prior window
Fixes share
10.9%
+6.7 pp vs prior window
Work mix
30.9% Features10.6% Maintenance44.3% Tests3.3% Docs10.9% Fixes
59 commits over 90 days, ending 2026-11-30.
Where this dev ranks
Percentile against the global top-100 leaderboard (all-time totals).
- By commits
- Top 99 %
- By Features share
- Top 53 %
Daily performance
Daily ETV, stacked by Features, Maintenance, Tests, Docs and Fixes.
Repository spread
Where this developer's commits land. Concentrated work (top1 > 80%) vs polymath spread (top1 < 30%).
Most impactful commits
Top 10 by ETV in the last 90 days.
- 7.0ETVAdd an expandable resource pane and contextual resource actions (#21727) ## Description The resource sidebar is useful for navigation, but its compact presentation makes it difficult to scan a populated application without losing the current filters and selection. This adds an optional full-canvas presentation of the **same resource pane**, plus contextual access to existing resource actions. Relates to #21708 (UX29). - Desktop users can expand the pane, inspect runtime state, start time, endpoints, Source, and activity links, then select a resource to return to details. Filters, grouping, ordering, selection, and the active available details tab are preserved. - Right-click, the Context Menu key, and Shift+F10 open the existing resource-action pipeline for the intended row. Ellipsis/touch actions remain available; command availability, confirmation, and secret handling are unchanged. - Width is controlled only by explicit resizing: 420px by default, an exact saved width within 420-560px, keyboard arrows/Home/End, or double-click to reset to 420px. There is no automatic fitting. Collapse/restore keeps details anchored to the workspace edge. - At **768px and below**, the existing mobile drawer is used and the full-canvas control/state is absent. At **769px and above**, desktop expansion is available. Crossing into mobile exits full canvas without automatically reentering later. - Tightly coupled improvements include neutral selection surfaces, consistent resource tiles and persistent badges, density-aware metadata, single-line platform-specific selection guidance, viewport-contained filter/group menus, and one shared visible-only activity refresh lifecycle. Full canvas is transient and opt-in. This does not change the default layout, add a separate table/cards implementation, or change the independently approved Summary behavior. A no-op `fitPaneToActions` export is deliberately retained for stale asset/assembly compatibility; no C# auto-fit calls remain. ### User-facing usage On desktop, choose **Expand resource list to full canvas**. Use the existing filters and grouping, Ctrl/Command+click to add/remove selection, or Shift+click to select a range. Select a resource to return to details, or use the toolbar control to return to the compact pane. Right-click a row or use Shift+F10 for its existing actions. At narrow sidebar widths, the two selection hints alternate in one stable line; wider/full-canvas panes show both. Rotation pauses on hover/focus and while hidden, and reduced motion removes the crossfade. Assistive technology always receives both instructions. ### Overlap with #21692 #21692 addresses resource-filter viewport containment. This branch includes overlapping filter sizing/containment behavior and extends coverage to full canvas, grouping menus, short viewports, Escape/focus return, and responsive transitions. These are **not independent fixes**: reconcile the overlapping `ResourcePaneFilter` CSS and tests before merging both PRs. This PR does not claim that #21692 has already merged. ### Validation The complete relevant gate passed: **145 component cases, 16 model/action-menu cases, and 130 browser cases**, with zero failures or skips. The browser cases intentionally opt into their outerloop scenarios while excluding quarantined cases. The final visual pass found and corrected a forced-colors text-backplate issue on selected rows. After that CSS-only correction, the **5 targeted selection/hierarchy browser cases passed**, the dashboard rebuilt successfully, and the complete named-TestShop interaction/capture pass was repeated successfully. The earlier full 130-case gate preceded only that forced-colors correction and final whitespace cleanup. Build setup and commands used for the isolated validation outputs: ```powershell $root = Join-Path $PWD 'artifacts\ux29-row-composition-tests' $env:MSBUILDTERMINALLOGGER = 'false' $p = @( "/p:ArtifactsPath=$root", "/p:ArtifactsDir=$root\", '/p:SkipNativeBuild=true', '/m:1', '/p:BuildInParallel=false', '/p:UseSharedCompilation=false', '--verbosity', 'quiet' ) .\dotnet.cmd build tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj @p .\dotnet.cmd build tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj @p .\dotnet.cmd build tests\Aspire.Dashboard.Playwright.Tests\Aspire.Dashboard.Playwright.Tests.csproj @p ``` **Result:** all three builds passed. ```powershell .\dotnet.cmd "$root\bin\Aspire.Dashboard.Components.Tests\Debug\Aspire.Dashboard.Components.Tests.dll" --filter-class '*.ResourcesLayout*' --filter-class '*.ResourceOverview*' --filter-class '*.ResourcePaneFilter*' --filter-class '*.AspireMenuTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` **Result:** 145/145 passed, 12.577s. ```powershell .\dotnet.cmd "$root\bin\Aspire.Dashboard.Tests\Debug\Aspire.Dashboard.Tests.dll" --filter-class '*.ResourcePaneActivityTests' --filter-class '*.ResourceMenuBuilderTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` **Result:** 16/16 passed, 0.799s. ```powershell .\dotnet.cmd "$root\bin\Aspire.Dashboard.Playwright.Tests\Debug\Aspire.Dashboard.Playwright.Tests.dll" --filter-class '*.ResourcePane*' --filter-class '*.ResourceTagPaneTests' --filter-class '*.ResourcesTests' --filter-class '*.AspireMenuLayoutTests' --filter-not-trait 'quarantined=true' ``` **Result:** 130/130 passed, 4m23.682s. Includes **48 axe surface audits with zero reported violations**, covering the pane, filter, grouping, and resource context menu across light/dark and 390/768/769/1440px. ```powershell .\dotnet.cmd "$root\bin\Aspire.Dashboard.Playwright.Tests\Debug\Aspire.Dashboard.Playwright.Tests.dll" --filter-method '*.SelectionSurfaces_UseDashboardNeutralTokensAcrossThemes' --filter-method '*.HierarchyAndSource_PreserveTreePathsAndCompleteDisclosure' --filter-not-trait 'quarantined=true' ``` **Result after the forced-colors correction:** 5/5 passed, 11.247s. Additional completed checks: - The resizer lifecycle and available-Traces-tab navigation cases passed **three isolated repetitions, 4/4 each**, including ordinary and reduced motion. Dynamic persistent-badge geometry passed **three repetitions, 2/2 each**; tile overflow is allowed while row containment, icon stability, and non-overlap remain required. - Populated performance fixture: **28 unique resources / 56 tag memberships**. During a 10s idle observation: **0 DOM mutations, 0 long tasks, CLS 0**. Activity update: **448 mutations bounded to the 28 changed resources, 0 long tasks, CLS 0**. Idle/refresh transport observations were respectively 3/7 render frames and 28,060/167,975 bytes. Lifecycle tests cover single-owner refresh, maximum query concurrency 1, cancellation, hidden/mobile transitions, and stale-result rejection. - The final named TestShop dashboard rebuild passed with **0 warnings and 0 errors**. Cache-bypass loading, exact 507px restoration, reset/reload at 420px, full-canvas selection, responsive exit, and ordinary collapse/restore passed. No yellow error bar, browser page/console errors, or post-start server errors were observed. - Actual live collapse and restore were sampled at **20 frames per direction**: right-edge drift **0px**, left edge matched the pane boundary, widths changed monotonically, and no content transform or horizontal overflow occurred. - Keyboard/context invocation, focus return, inert content, reduced motion, forced colors, density geometry, popup containment, activity trace links/Back, and responsive control absence/presence are covered by the browser/component gates. Axe is supplemented by these interaction and visual checks, not treated as a complete accessibility certification. ```powershell .\dotnet.cmd build src\Aspire.Dashboard\Aspire.Dashboard.csproj /t:UpdateXlf @p $changed = @(git diff --cached --name-only -- '*.cs') | ForEach-Object { $_ -replace '/', '\' } .\dotnet.cmd format whitespace --folder --verify-no-changes --include @changed --verbosity quiet Get-Content src\Aspire.Dashboard\Components\Layout\ResourcesLayout.razor.js -Raw | node --input-type=module --check git diff --cached --check ``` **Result:** localization regeneration, changed-C# whitespace verification, JavaScript syntax, and staged whitespace checks passed. All 13 XLF updates were generated, not manually edited. ### Screenshots / Recordings **Actual named TestShop captures from the deployed revision**, inspected before upload. No credentials, parameter values, or private research artifacts are included. | Desktop full canvas - light | Desktop full canvas - dark | | --- | --- | |  |  | | Mobile drawer - 390x844 | Tablet drawer - 768x1024 | | --- | --- | |  |  | | Desktop boundary - 769px | Forced colors | | --- | --- | |  |  | Motion was verified with the frame-sampled geometry checks above. To inspect interactively, collapse and restore the sidebar, then expand to full canvas and select a resource; repeat with reduced motion enabled. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 015591f4 · 2026-11-04
- 3.3ETVAdd auto-sec agentic workflow for dependency security reconciliation (#20693) ## Description Adds the `gh aw` workflow `auto-sec` to reconcile dependency security alerts with open Dependabot PRs every 12 hours and on manual dispatch. Pure code-scanning findings are excluded; only findings mapped to dependency/action versions are considered. - **Deterministic approval:** the Aspire bot App approves only eligible Dependabot PRs after live checks of bot authorship, verified commits, requested head SHA, non-breaking upgrades, seven-day cooldown, unchanged authorized delivery sources, green checks/statuses, and a matched alert fixed in the changed manifest. The current base must be an ancestor of the head; base stability, ancestry, and CI are rechecked before submission. Malware-related upgrades require human review. Submission attempts are bounded, including ambiguous transport failures. - **One reusable update PR:** supported fixes use `auto-sec/security-updates` and the `auto-sec` label. Reuse requires the expected bot PR author, repository, branch, and base. Public titles, bodies, and commit summaries contain generic package/version updates, not alert details. The PR table describes the initial batch; subsequent updates are represented by validated commits and the full branch diff. Live cumulative body refresh remains follow-up work. - **Conservative scope:** npm/yarn/pnpm, pip/uv/pyproject, and NuGet are supported. NuGet fixes must restore from existing approved dnceng sources/mappings; unavailable versions are blocked on mirroring. Feed configuration and SDK pins cannot change. Action-pin updates require maintainer allow-list coordination. - **Publication boundary:** patches are reconstructed from trusted bases and checked for dependency-version-only changes, source and artifact binding, package-occurrence metadata ownership, schema-defined lockfile locations, and complete authenticated summaries. Unknown fields, changed duplicate keys, unsupported encodings/EOF markers, arbitrary artifact names, opaque bundles, and symlinks fail closed. Checksum ownership does not authenticate digest values against registries. - **Private-data boundary:** compilation hardening suppresses private host-shell/gateway streams, preserves failure exit statuses, withholds writable telemetry, and gates every publication step on successful scrubbing. Only validated outputs and canonical patches may be uploaded. Unknown generated layouts fail hardening. These controls still require a live isolated trial. Fixes: N/A (no linked issue). ### Validation at `ce52326c3668ad48394b6eef5bb4ca0b3350f366` Existing current-head [agentic validation run](https://github.com/microsoft/aspire/actions/runs/37981391642) passed. Its logs were inspected on October 12; no redundant full build or test run was started for this feedback-only update. - `dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile -- --filter-trait "Category=AgenticWorkflow" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` — **passed in CI, 714 tests, zero failures**. - `gh aw compile --purge --force-refresh-action-pins --validate --no-check-update --schedule-seed microsoft/aspire`, followed by `node .github/workflows/auto-sec/publication-guard.js` — **passed in CI**, including generated-file drift validation. Generated locks are not manually edited. - `gh aw lint --shellcheck` — **passed in CI**. This is distinct from the earlier limited Windows native lint, which disabled shellcheck/pyflakes because local WSL Docker was unavailable. - Local focused `dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile -- --filter-class "*.AutoSecWorkflowTests" --filter-class "*.AgenticWorkflowTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` — **passed, 694 tests** on this head. - Bounded independent AI security review completed October 12 on this exact head: **no confirmed exploitable vulnerabilities found** in the workflow, deterministic gates, publication hardening, generated wiring, and targeted harness. Fourteen focused in-memory checks passed. This is not organizational security approval or a certification of production readiness. ### Outstanding rollout gates **The isolated end-to-end workflow trial is not complete.** Compile/lint, synthetic checks, and PR CI do not prove fresh-agent behavior or actual App approval/PR creation/reuse. No upstream production auto-sec run or fork runtime trial has been dispatched. The user-authorized [fork POC branch](https://github.com/IEvangelist/aspire/tree/auto-sec-poc) is preparatory only and predates the latest fixes. October 12 read-only checks confirmed that the fork has no Actions secrets or variables, no registered auto-sec workflow, and no code-scanning analysis. It is therefore not a final-source-equivalent runtime validation. Before trial/rollout: - Install the intended test App on the fork and configure `ASPIRE_BOT_APP_ID` / `ASPIRE_BOT_PRIVATE_KEY` with scoped contents/PR write permissions. Do not copy upstream secrets or substitute a personal token for bot ownership. - Refresh the manual-only, fork-scoped POC from this head, register the workflow, and provide code-scanning analysis without treating a failed/absent analysis API as an empty alert set. - Run a bounded isolated trial proving actual generic PR creation, reuse, gated Dependabot approval, and refusal for cooldown/breaking/source violations; inspect resulting diffs and public artifacts, not merely a green run. - Obtain required maintainer/organizational security acceptance. Live App permissions and repository protections were not independently verified by the AI review. - Create the `auto-sec` label and confirm production App permissions before enabling production use. Bot approvals may not satisfy branch rulesets. ### Security considerations The workflow reads private alerts with `security-events: read`. The agent requests actions; a separate deterministic job decides approvals with a read-only client, using the App token only for submission. Repository writes use the App and validated bot-owned branch. Alert text is excluded from public output; private streams and agent-writable telemetry are withheld. Runtime and organizational approval gaps remain explicit blockers, not resolved by the absence of static findings. ## 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? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 949287a1 · 2026-10-19
- 2.7ETVMake generated Go SDK APIs idiomatic (#21976) ## Description Generated Go AppHosts currently require manual cleanup before standard Go tooling is happy, project every ATS numeric value as `float64`, and expose pointer-heavy optional parameter structs. This change makes the generated SDK idiomatic and reviewable as normal Go code. - Runs every generated `.go` file through `gofmt` with deterministic UTF-8 input/output and LF line endings. - Uses the CLR numeric type retained by ATS metadata to generate `int`, `int64`, `float32`, `float64`, signed, and unsigned Go types while preserving JSON-number wire behavior. - Replaces pointer-option variadics with sealed `XxxOption` interfaces. Value-shaped options implement `apply` directly; pointer and interface values use small wrappers because Go cannot attach methods to those types. - Applies the same option pattern to `CreateBuilder`, while retaining `*XxxOptions` as compatible options for existing generated callers. - Carries `[Obsolete]` metadata through ATS and removes obsolete Go methods, properties, DTO members, enum values, exported values, and unreferenced types. Obsolete types required by active wire signatures remain generated. - Keeps the Go API export synchronized with generated option types, obsolete filtering, numeric types, and gofmt output. ### User-facing usage Endpoint and builder configuration no longer require pointer helpers or struct literals: ```go builder, err := aspire.CreateBuilder() web.WithHttpEndpoint( aspire.HttpEndpointPort(8080), aspire.HttpEndpointTargetPort(8080), aspire.HttpEndpointName("http"), ) ``` The generated option shape is direct and allocation-free for value types: ```go type WithHttpEndpointOption interface { apply(*WithHttpEndpointOptions) } type HttpEndpointPort int func (value HttpEndpointPort) apply(options *WithHttpEndpointOptions) { options.Port = (*int)(&value) } ``` Validation: ```text 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: 136, Failed: 0 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: 716, Skipped: 1, Failed: 0 dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-method "*.GoStarterHonorsRedisChoice" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" Passed: 3, Failed: 0 ``` The Go suite includes generated build/test, `go vet`, and gofmt validation. `Aspire.Cli.EndToEnd.Tests` also builds with 0 warnings and 0 errors. ### Breaking changes This intentionally changes the generated Go SDK API: - `options ...*XxxOptions` becomes `options ...XxxOption`. - Call sites can use typed option values such as `HttpEndpointPort(8080)`; existing `*XxxOptions` values remain accepted for source compatibility. - A lone optional DTO is no longer passed directly; it is wrapped by its generated option helper. - `CreateBuilder(options ...*CreateBuilderOptions)` becomes `CreateBuilder(options ...CreateBuilderOption)`; `*CreateBuilderOptions` remains accepted. - CLR integral values previously exposed as `float64`/`*float64` now use semantic Go types such as `int`/`*int`. - Obsolete generated declarations are removed unless the type remains necessary for an active wire signature. Fixes # (issue) ## 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? - [ ] 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>github.com-microsoft-aspire · cd9e0e8d · 2026-11-10
- 2.7ETVReduce agent telemetry hook overhead without reducing coverage (#20387) ## Description Preserves wildcard agent-hook coverage and all currently eligible Aspire telemetry while removing shell startup and synchronous upload waits. - Both hook and uploader modes run through `AgentTelemetryCommand` and normal command dispatch. `InitializeTelemetryOnStartup` defaults to true; the agent command defers provider creation and enrichment until an eligible event exists. Existing first-run and generic invocation-span rules are preserved. - Skill names and reference paths come from the embedded bundle's `skill-manifest.json`, read in memory with the existing manifest types and source-generated serializer. The shipped inventory preserves all 7 skills and 33 references. MCP tool names still come from the embedded canonical hook because the manifest does not contain a tool inventory. - Hook environment-variable reads use injected `IEnvironment`; hook tests run in-process without changing global environment state. A documented setting bounds input before parsing. - Eligible telemetry is persisted through Azure Monitor Exporter's existing disk-backed storage. An independent CLI uploader keeps its existing batching/retry machinery alive until the backlog drains. - Legacy Aspire registrations migrate idempotently without removing unrelated user hooks. The latest main merge preserves shell completions and the v0.0.3 skills bundle. Fixes #20329 Closes #20042 ### Coordinated OpenTelemetry upgrade The committed upgrade supersedes closed draft #20042 and consistently uses the newest releases published at least seven days before September 23, 2026: | Packages | Version | NuGet publication date (UTC) | | --- | --- | --- | | Console, InMemory, OTLP exporters; Extensions.Hosting | 1.18.0 | August 21 | | AspNetCore, Http, Runtime, SqlClient instrumentation | 1.18.0 | August 21 | | GrpcNetClient instrumentation | 1.18.0-beta.1 | August 21 | | Azure Monitor Exporter | 1.9.0 | September 5 | The 1.19.x releases were too recent for that age requirement and are not the target. The GrpcNetClient approved-feed import [succeeded in run 3085688](https://dev.azure.com/dnceng/internal/_build/results?buildId=3085688), and full solution restore succeeded against configured feeds. No quarantine was bypassed. Existing Blazor playground-specific overrides from #20339 are unchanged. Seq's generated configuration schema was refreshed for the added OTLP properties. ### Breaking changes OpenTelemetry 1.18 reduces the default maximum serialized OTLP request from 128 MiB to 64 MiB. Oversized batches are dropped. Consumers relying on the previous limit can configure: ```csharp builder.Services.Configure<OpenTelemetry.Exporter.OtlpExporterOptions>(options => { options.MaxRequestSizeBytes = 128 * 1024 * 1024; }); ``` The default maximum OTLP response size is 4 MiB. Generated ServiceDefaults inherit updated versions; existing customer projects are not rewritten. Ordinary CLI shutdown behavior is explicitly preserved despite the Azure Monitor upgrade. ### User-facing usage After installing the updated CLI, refresh agent configuration: ```shell aspire agent init ``` Claude retains `matcher: "*"`; Copilot retains unfiltered `postToolUse`. Both directly execute `aspire agent telemetry --hook` without PowerShell/Bash. Compatibility scripts are taken unchanged from the canonical bundle. `ASPIRE_AGENT_TELEMETRY_MAX_PAYLOAD_CHARACTERS` configures the native input bound: default 65,536 UTF-16 characters, range 1–1,048,576. Oversized input is drained without retention; invalid values produce a diagnostic without breaking the agent. ### Validation - Review refactor: 370 tests passed, one Linux-only skip, covering startup/completions, normal command routing, deferred provider/enrichment initialization, opt-out, all three event categories, and existing telemetry behavior. - Manifest change: 137 focused tests passed, including archive/JSON validation, canonical reporting-set parity, hook classification, and skills bundle regressions. - Final Windows x64 Native AOT publish passed after the manifest change. - The real cross-process lease-expiry recovery test is now marked `[OuterloopTest]`; fast persistence and uploader-lifecycle coverage remains in regular CI. The real recovery scenario passed before this scheduling-only change. - Coordinated dependency upgrade: full solution restore, Hosting/template builds, generated ServiceDefaults/MAUI version verification, and 21 Seq tests across .NET 8/9/10 passed. Seq stabilization packaging passed. Restore reported existing unrelated vulnerability advisories. - Real Copilot CLI 1.0.87-0, isolated COPILOT_HOME: `postToolUse` with `exec`/`args` ran its recorder after a `view` call. - Performance trade-off: normal command dispatch measured 145.4 ms median and 210.7 ms p95 for unrelated native hooks over 25 local Windows launches; the old PowerShell sample was approximately 337–460 ms. The earlier pre-host shortcut measured 52.3 ms median but was removed in response to review. These are direct-process samples, not a zero-cost guarantee. - Linux/macOS runtime performance was not tested locally. ### Security considerations The hook processes bounded untrusted JSON and launches an independent uploader. Catalog inputs come from embedded release-verified resources, not mutable user-installed skills/scripts. Only manifest-listed `references/` files are reference events; evals and scripts are excluded. No new listener, ingestion endpoint, raw-payload storage, or telemetry category is introduced. Direct argument vectors avoid shell interpretation. Existing exporter storage and process-isolation helpers are reused. Security review should cover classification parity, configuration ownership, and detached-process lifetime. Delivery remains subject to disk failures, exporter limits, retention, and permanent ingestion errors. Interrupted uploads may stay leased for several minutes; at-least-once delivery permits duplicates. Environment opt-out applies at process launch, not retroactively to running processes. ## 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? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com>github.com-microsoft-aspire · 9be381fb · 2026-09-25
- 2.7ETVAdd `aspire sdk export -l go` (Go API reference exporter) (#21195) > [!NOTE] > **Merge order:** no PR must land before this one. It overlaps #21197, which adds the same `AtsTypeSystemCompatibility.cs` and changes two generator members that this exporter calls. They merge without textual conflicts, but whichever lands second needs a two-line fix-up in `AtsGoCodeGenerator.ApiProjection.cs`, described in #21197. ## Description `aspire sdk export --language go` fails today with "no IApiReferenceExporter", because only TypeScript ships an exporter (#19032). This adds the Go exporter, so the Go API reference can be produced by the same code that generates the Go SDK. aspire.dev builds its Go API reference from `aspire sdk dump` (microsoft/aspire.dev#1917). The Go mode of its `AtsJsonGenerator` re-implements the Go generator's naming and type mapping, so it can drift from what `AtsGoCodeGenerator` really emits, and a dump cannot see the surface the generator writes by hand: - the synthesized `Build()` on the builder - the `InteractionInputCollection` helpers (`Get`, `Required`, `Value`, `RequiredValue`) - `Err()` on every handle and `ToMap()` on options structs - the hand-written `base.go` runtime types - the trailing `opts ...*XxxOptions` flattening and the callback func types The export projects through the generator's own naming and type-mapping code, so aspire.dev can consume `aspire sdk export -l go` for signatures instead of re-deriving them. Part of #21115. ### What changes - **`AtsGoApiReferenceExporter`** (new) implements `IApiReferenceExporter` for Go. It is a separate type from `AtsGoCodeGenerator` on purpose, as in the TypeScript exporter. `Aspire.TypeSystem` is force-shared with a frozen `AssemblyVersion`, so an older CLI binds this assembly but its copy of `Aspire.TypeSystem` has no `IApiReferenceExporter`, and a type that implements the interface cannot load there. `CodeGeneratorResolver` salvages the loadable types, so such a CLI keeps generating Go and only loses the export. - **`AtsGoCodeGenerator`** becomes `partial` (one word in `AtsGoCodeGenerator.cs`). The new `AtsGoCodeGenerator.ApiProjection.cs` builds the export model with the generator's own naming and type-mapping helpers, so there is no second copy of the Go rules to keep in sync. - **`GoDeclarationScanner`** reads the hand-written Go that the generator itself emits (the `base.go` runtime and the builder entry point) instead of keeping a hand-maintained list, so that surface cannot drift either. - **`GoApiModel` and `GoApiExportWriter`** hold the model and write the document. The writer builds a `JsonNode` tree and the exporter returns `JsonDocument.Parse(...).RootElement.Clone()`, the AOT-safe pattern the TypeScript exporter uses (no reflection serializer). Line endings are normalized to LF and items, declarations and members come out in a fixed order, so the output is reproducible byte for byte. - **`src/Shared/CodeGeneration/AtsTypeSystemCompatibility.cs`** (new, linked into the Go project) is the TypeScript generator's version-skew probe in the shared folder. It reads `AtsCapabilityInfo.IsExperimental` reflectively so a newer generator still runs against an older `Aspire.TypeSystem`. The TypeScript project keeps its own copy. - **CLI**: the `--language` help of `aspire sdk export` reads `(e.g., typescript, go)`, and `docs/specs/cli-output-formats.md` describes the Go export next to the TypeScript one. Go resolves through the same language discovery as the other languages, so it needs the existing `experimentalPolyglotGo` feature. - All new types are `internal`, so there is no public API change. About 2,300 lines are product code and 1,700 are tests and snapshots. ### Export shape The envelope matches the TypeScript export so one consumer can read both: `schemaVersion` (1), `language` (`go`), `generator` (`name`, `version`), `package` (`name`, `version`, and Go's `importPath`), `modules[]` (`name`, `items[]`) and `declarations[]` (`id`, `owningAssembly`, `content`). - `items[].kind` is `interface`, `augmentation` (members a package adds to a type that another package declares), `dto`, `options`, `enum`, `variable`, `function` or `type`. - `members[].kind` is `method`, `field` or `constant`. Every member has the exact Go text in `declaration`. Capability-backed members carry `capabilityId`, and members that the generator writes itself are marked `synthesized`. Methods also carry `errorModel` (`none`, `returned` or `deferred`), `experimental` and `deprecated` markers where they apply, and an `options` block (the struct type and its fields) when the method takes the trailing `opts ...*XxxOptions`. Trimmed excerpt of the Redis export. `AddRedis` shows the trailing options flattening and `ToMap()` shows a synthesized member: ```json { "id": "DistributedApplicationBuilder.AddRedis", "kind": "method", "name": "AddRedis", "declaration": "AddRedis(name string, options ...*AddRedisOptions) RedisResource", "capabilityId": "Aspire.Hosting.Redis/addRedis", "returnType": "RedisResource", "errorModel": "deferred", "parameters": [ { "name": "name", "type": "string", "optional": false } ], "options": { "typeName": "AddRedisOptions", "fields": [ { "name": "Port", "type": "*float64", "optional": true, "jsonName": "port" }, { "name": "Password", "type": "*ParameterResource", "optional": true, "jsonName": "password" } ] } } ``` ```json { "id": "AddRedisOptions.ToMap", "kind": "method", "name": "ToMap", "declaration": "ToMap() map[string]any", "returnType": "map[string]any", "errorModel": "none", "synthesized": true } ``` ### Sample exports Produced end to end with a Debug-built CLI from this checkout. The integration packages restore from NuGet, while `Aspire.Hosting` and the Go generator are this checkout's. | Export | Items | Members | Synthesized members | Size | | --- | ---: | ---: | ---: | ---: | | `Aspire.Hosting.Redis@13.6.1` | 12 | 48 | 10 (`Err()` x3, `ToMap()` x7) | 37,045 B | | `Aspire.Hosting.Azure.Storage@13.6.1` | 30 | 81 | 16 | 63,536 B | | `Aspire.Hosting` (core) | 260 | 1,609 | 250 | 1,148,073 B | The core export flags 170 experimental and 10 deprecated members. Repeating an export in a new process gives byte-identical output (SHA-256 compared). Exit codes and timings are in the Validation section. ### Compared with the dump-derived reference (owner, method) pairs that exist both in the export and in aspire.dev's current `go-modules` data (13.6.0), compared by exact Go signature: | Package | Pairs in both | Identical | | --- | ---: | ---: | | `Aspire.Hosting.Redis` | 22 | 22 | | `Aspire.Hosting.Azure.Storage` | 36 | 15 | | `Aspire.Hosting` (core) | 863 | 420 | Every non-identical pair is a return-type difference (the dump-derived reference declares the capability's declared type, such as `Resource`, or drops a nullable pointer, where the generator returns the receiver's own interface or `*string`), and the export reports what the generator emits. The core export is this checkout's build, so its 41 export-only pairs are capabilities newer than 13.6.0, not drift. ### Merging with the godoc PR This change applies to `main` on its own and is independent of the godoc PR ("Emit godoc from ATS documentation metadata in the Go SDK generator"). Both change `AtsGoCodeGenerator.cs` in different places, and both add `src/Shared/CodeGeneration/AtsTypeSystemCompatibility.cs` with identical content plus the same link line in the Go project (the godoc PR also points the TypeScript generator at that shared file), so git merges them without conflicts. The PR that merges second needs a two-line fix-up that git cannot detect, because the godoc change adds `BuildDocumentationMaps` and an `includeDocs` parameter to `RenderGoExportedValueType`: 1. In `AtsGoCodeGenerator.ApiProjection.cs`, `BuildApiModel`: add `BuildDocumentationMaps(context);` directly after `BuildNameMaps(context);`, so documentation rendering during the projection has its maps. 2. In `ProjectExportedValues`: call `RenderGoExportedValueType(node, indentLevel: 0, includeDocs: false)`, because the call no longer compiles without the new argument. Then re-accept `GoApiExportTests.GoOnlySurface.verified.json`: DTO, enum and field summaries now flow into the export. With both changes merged and the fix-up applied, the Go codegen test project passes. ### Behavior notes - Documentation text is whatever the generator emits today. In the SDK-built AppHost server that the Debug CLI used, a restored integration's XML documentation file was not next to its assembly, so summaries are sparse for those NuGet integrations (Redis 11 of 48 members, Azure Storage 9 of 81) and fuller for `Aspire.Hosting`, a project reference (1,068 of 1,609). - The scanner reads the layout of the generator's own output. The parity tests fail if that layout changes in a way the scanner cannot read. - Names are reserved across all types in the context (the exported package plus `Aspire.Hosting`), as in generation. An app that combines many integrations can get a different disambiguation suffix where two packages collide. - The export is a pure function of the ATS context: no new process launches, file IO or network calls. The core export is about 1.1 MB. - The CLI writes the document to stdout followed by a platform newline. ### Tests - `GoApiExportTests` (28 cases, three Verify snapshots) projects a test AppHost through the real generator and checks parity in both directions: every type, function, interface member and variable the generator emits is in the export, and nothing is exported that the generator does not emit. It also covers the Go-only members, trailing options flattening, callbacks and unions, augmenting packages, unique ids, determinism, LF line endings, cancellation and the scanner. - `ApiReferenceExportTests` and `CodeGenerationResolverTests` (RemoteHost) resolve and run the Go exporter through `CodeGenerationService`. The existing "language without an exporter" test uses Python instead of Go, since Go ships an exporter. - `SdkExportCommandTests` (CLI) checks that `sdk export --language go` resolves the Go generator when the feature is enabled. ### Follow-ups 1. Go export: add `type` and `optional` to DTO fields and constants (from `AtsDtoPropertyInfo.IsOptional`). Today the type is only inside the member `declaration`, and every DTO field carries `omitempty`. 2. aspire.dev: build the Go API reference from `aspire sdk export -l go`, which removes the return-type and nullable differences above. 3. Copy XML documentation next to restored integration assemblies in the SDK-built AppHost, so NuGet integrations get summaries. 4. Go export: optional grouped `functions` and `appliesTo` view. The dump-derived reference lists one signature per capability, while the export repeats a member per concrete interface. ## Validation | Command | Exit | Result | | --- | --- | --- | | `.\restore.cmd` | 0 | passed | | `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"` | 0 | 61 total, 61 passed, 0 failed, 0 skipped (28 are new) | | `dotnet test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-class "*.ApiReferenceExportTests" --filter-class "*.CodeGenerationResolverTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 0 | 21 total, 21 passed, 0 failed, 0 skipped | | `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"` | 0 | 31 total, 31 passed, 0 failed, 0 skipped | | `dotnet run --project tools/SelectTests -- --from upstream/main --to HEAD --explain` | 0 | 16 changed files, 0 unattributed, 4 of 99 test projects selected | | `aspire sdk export --language go --package Aspire.Hosting.Redis@13.6.1` | 0 | 37,045 B in 21.3 s (includes building the AppHost server) | | `aspire sdk export --language go --package Aspire.Hosting.Azure.Storage@13.6.1` | 0 | 63,536 B in 8.0 s | | `aspire sdk export --language go` | 0 | 1,148,073 B in 7.8 s | `upstream` is the microsoft/aspire remote. The three exports ran in a directory whose `aspire.config.json` contains `{"features":{"experimentalPolyglotGo":true}}`, with `DOTNET_ROOT` pointing at this checkout's `.dotnet` and `ASPIRE_CLI_TELEMETRY_OPTOUT=1`. Stdout is the JSON document only. Times are wall clock on a developer machine. The new Verify snapshots (`GoApiExportTests.FocusedApiExport`, `GoOnlySurface` and `AugmentingPackage`) were reviewed before they were accepted. Conditional test selection: the selector selects `Aspire.Cli.EndToEnd.Tests`, `Aspire.Cli.Tests`, `Aspire.Hosting.CodeGeneration.Go.Tests` and `Aspire.Hosting.RemoteHost.Tests` and triggers `cli-starter-validation`, `extension-e2e`, `polyglot` and `typescript-api-compat`. The new files live in projects the trigger map already covers, and the linked shared file is attributed by the project graph, so `eng/github-ci/test-trigger-map.yml` needs no change. Not verified: - The full `Aspire.Cli.Tests` and `Aspire.Hosting.RemoteHost.Tests` suites. Only the classes above ran. The TypeScript exporter and the other languages' generators are not touched and were not run. - A release or native AOT build of the CLI. The exports above use a Debug CLI, and the only CLI change is a help string. - `aspire sdk export --language go` with `experimentalPolyglotGo` off was not run. Reading the code, language discovery does not list Go in that case (`DefaultLanguageDiscovery`), so the CLI does not add the Go generator package and the AppHost server answers `No code generator found for language: go. Available languages: ...`, which does not name the feature. The other experimental languages behave the same way, and the message goes away when the feature flag is removed (#21106). - The bundle (prebuilt AppHost) flow and integrations referenced as local projects. Summary coverage there is not measured. - Apps that combine many integrations. Names are compared only for the exported package plus `Aspire.Hosting`. - The polyglot validation job and the rest of the CI matrix. CI is the first run there. - The combination with the godoc PR beyond the Go codegen test project, which passed on a throwaway merge. No end-to-end export was run on the merged tree. ## 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-ea6e2d91a57egithub.com-microsoft-aspire · 769cf381 · 2026-10-30
- 2.4ETVEmit godoc from ATS documentation metadata in the Go SDK generator (#21197) > [!NOTE] > **Merge order:** no PR must land before this one. #21188 and #21199, which overlapped it, are on main and this branch contains them. Whichever of the remaining open PRs lands second rebases: > > - A PR that changes `TwoPassScanningGeneratedAspire.verified.go` (a new or changed `Aspire.Hosting` API reaches it) conflicts with this one there, because this PR adds doc comments throughout the file. Regenerate the snapshot with `dotnet verify accept -y` instead of merging hunks by hand. `AtsGeneratedAspire.verified.go` works the same way. > - #21195 calls `RenderGoExportedValueType`, whose signature this PR changes, so the second to land needs a one-line fix-up in `AtsGoCodeGenerator.ApiProjection.cs`. ## Description Part of #21115. The Go SDK generator documents a member only from the capability `Description`, plus a few fixed comments for enums, DTOs and handles. `Summary`, `Remarks`, `Returns`, per-parameter docs, enum value docs and the obsolete and experimental flags never reach `aspire.go`, so `go doc` and gopls hover show one thin line or nothing. This PR emits godoc from the same ATS documentation metadata the TypeScript generator already turns into JSDoc. ### What changes in the generated SDK Documentation flows to every kind of declaration: - Capabilities (handle methods, standalone functions, property getters and setters): summary, remarks, a `Parameters:` list and a `Returns:` paragraph. A trailing `...Options` parameter points at its Options struct, and each Options field carries the doc of its parameter. - Handle interfaces, DTO structs and their fields, enum types and each enum value, exported value groups and their members, and Options structs. The comments follow godoc conventions: - A comment starts with the identifier it documents, paragraphs are separated by a bare `//`, and code samples and lists from the XML docs keep an indented-block form. Lines are wrapped near 80 columns and never split a word. - `<see cref>` references become `[Name]` doc links only for generated types. Anything else stays plain text so the SDK has no dangling links. - Obsolete capabilities end with a `Deprecated:` paragraph, the one marker gopls and staticcheck recognize. - Experimental capabilities get a `# Experimental` heading and the line `Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.` Go has no toolchain-recognized experimental marker, so this uses the convention `google.golang.org/grpc` documents its experimental APIs with. It renders as a heading on pkg.go.dev and in gopls hover and is stable under gofmt. TypeScript uses `@experimental`. - XML-doc text is normalized to LF and no comment line has trailing whitespace. - A one-line remarks paragraph that gofmt and `go doc` would read as a heading, such as `Requires Redis 7.2` or `Used with the resource's name`, ends with a period so it stays a paragraph. Example from the test snapshot. On main this method has only the first line: ```go // WithPreviewStatus sets the preview status. // // Parameters: // - status: The status to set. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. // // Deprecated: Use WithDocumentation instead. WithPreviewStatus(status DocumentedStatus) DocumentedResource ``` ### Commits 1. **Share the ATS version-skew probe between polyglot generators.** `AtsTypeSystemCompatibility` (reads the experimental flag from an `Aspire.TypeSystem` that may predate it) moves from the TypeScript generator project to `src/Shared/CodeGeneration` and is linked into the Go and TypeScript generator projects. The TypeScript generator only gains a `using`. 2. **Emit godoc from ATS documentation metadata in the Go SDK generator.** New `GoDocComment.cs` formats a comment from the metadata, and `AtsGoCodeGenerator.cs` calls it at each declaration. 3. **Escape ATS metadata at the Go generator output sinks.** Injection hardening, described below. 4. **Render exported string values as Go string literals.** The same sink class for exported values, described below. 5. **End one-line remarks that gofmt would turn into headings with a period.** See the conventions list above. 6. **Make the escaping and gofmt round-trip comments state what they cover.** Comments only. 7. **Build the Go doc maps with the name maps.** `BuildNameMaps` builds the documentation maps itself, so a caller that builds only the name maps still gets a usable renderer (review feedback). ### Escape ATS metadata at the Go generator output sinks ATS metadata (descriptions, capability ids, parameter and property names) was spliced into Go source unescaped. A multi-line description, or a name containing a quote, a newline or a percent sign, produced Go that did not compile or that carried extra statements. Now: - every doc comment line is prefixed with `//`: CR, LF and CRLF start a new comment line, and Unicode line and paragraph separators, control characters and the byte order mark are replaced or dropped, so a description cannot end the comment; - string literals (capability ids, request argument names, json struct tags, map keys, enum constant values and `%q` arguments) go through one `GoStringLiteral` helper, and a capability id inside a `fmt.Errorf` format string has its `%` doubled; - method names (`ToPascalCase`) go through the existing `SanitizeIdentifier`, as parameter and type names already did; - exported string values, enum values and dictionary keys go through `GoStringLiteral` too (see the review finding below). This is a low-severity robustness fix. An integration author already runs code on the developer's machine, so no trust boundary is crossed. Output for valid first-party names is unchanged: the hardening commits change no snapshot that exists on main. The shared scanner and the other language generators have the same pattern and are left for a follow-up. A review of this change found one more sink of the same class, rated Medium and fixed by commit 4. Exported string values, enum values and dictionary keys were written with the relaxed JSON writer, which spells a character outside the Basic Multilingual Plane (for example an emoji) as a UTF-16 surrogate pair such as `\uD83D\uDE00`. Go rejects surrogate halves in a string literal, so one such value failed `go build` for the whole SDK with `escape is invalid Unicode code point U+D83D`. These values now go through `GoStringLiteral`, which keeps such characters as UTF-8. Numbers and booleans are the same text in JSON and Go and render as before. ### Generated output and cost - Two-pass SDK (`aspire.go` for `Aspire.Hosting` plus the test types): 1,347,950 to 1,808,456 bytes (+34.2%) and 31,892 to 45,393 lines. The smaller test-types snapshot: 162,529 to 176,209 bytes (+8.4%) and 4,591 to 5,049 lines. - The sequence of non-comment, non-blank lines in both large snapshots is identical to main (27,526 and 3,730 lines compared, 0 differences). The snapshot diffs are doc comment lines and the blank lines that separate them. - Markers in the two-pass snapshot: `Deprecated:` 16, `# Experimental` 221, `Parameters:` 848, `Returns:` 789. - Generation time, scan excluded, 1 warm-up and 15 samples on a shared developer machine: median 16.0 ms on main and 104.2 ms with this change (+88 ms), min 12.8 ms and 85.7 ms. This was measured before main's latest Go generator changes were merged and not repeated. The cost is linear in the number of documented identifiers and the regular expressions are source-generated. It was not profiled further. Review tip: read `DocumentedMetadataGeneratedAspire.verified.go`, `EscapedMetadataGeneratedAspire.verified.go` and `GoDocCommentRender.verified.txt` first. The two large snapshot diffs are comments only. ### Tests and guard New tests are in `GoDocCommentTests.cs` and `GoGeneratorEscapingTests.cs`. They build their metadata in code, so the TypeScript `TestTypes` that the Go, Java, Python and Rust test projects link are untouched. - `GenerateDistributedApplication_WithDocumentedMetadata_EmitsGodoc` (Verify snapshot) covers every declaration kind above, including `Deprecated:`, `# Experimental`, enum values, special characters and CRLF input. - `Render_FormatsGodocBlocks` (Verify snapshot) covers the comment formatter, and `Render_KeepsEveryLineInsideTheComment` proves hostile text never leaves the `//` comment. `Render_EndsHeadingLookingRemarksWithAPeriod` proves that one-line remarks which `go/doc/comment` would read as a heading (gofmt rewrites them to `# Heading`) end with a period. - `GeneratedSdk_DocCommentsFollowGodocConventions` is the guard that documented APIs keep their docs: over the SDK generated from the real scanned `Aspire.Hosting` assembly, every commented declaration starts with its name, no line has trailing whitespace or a lone CR, `Deprecated:` starts its own paragraph, obsolete and experimental metadata present in the model reaches the output, and the documented enum values equal the commented constants. The two-pass snapshot also covers the whole SDK, so an XML-doc edit to a scanned `Aspire.Hosting` API changes it, the same coupling the TypeScript snapshot has. - `GeneratedSdk_PassesGoToolchainChecks` runs `go build ./...`, `go vet ./...` and `gofmt` on that SDK and asserts gofmt leaves the generated top-level doc comments unchanged. go/printer only reformats doc comments that start in column 1, so the indented interface-method and struct-field comments are covered by the heading test above instead. - `GoGeneratorEscapingTests` generates an SDK from hostile metadata: a description of `Adds Foo.\nfunc init() {}\n// ` that tries to end the comment and declare a function, capability ids, method, parameter and property names containing double quotes, percent signs, backslashes, hyphens and line separators, and exported values (a string, an enum value and a dictionary key) containing an emoji. It checks the Verify snapshot, that no injected statement appears in the output, and that the output passes `go build` and `go vet`. With the escaping commit's generator changes reverted, all three fail (the injected statement is in the output, the snapshot differs and `go build` reports syntax errors). With only the exported-value rendering reverted, the snapshot differs and `go build` reports `escape is invalid Unicode code point U+D83D`. The Go toolchain tests use the existing `[RequiresTools]` gate, like `GeneratedTransport_SupportsDuplexCommunication`, so this PR adds no test project, CI job or runtime dependency. `eng/github-ci/test-trigger-map.yml` needs no entry: the moved file is a linked `src/Shared` file, which the selector attributes to its consuming projects, and the Python, Java and Rust generators and tests do not reference it (see the `SelectTests` row below). ### Merging with the Go API reference exporter #21195 adds the Go API reference exporter to the same project. At its current head (`ec5022d3a9`) the two pull requests merge without textual conflicts (checked with `git merge-tree`), but the exporter calls `RenderGoExportedValueType`, which this change gives a required `includeDocs` parameter, so whichever merges second needs a one-line fix-up in `AtsGoCodeGenerator.ApiProjection.cs`: in `ProjectExportedValues`, pass `includeDocs: false` to `RenderGoExportedValueType`. The compiler flags that call. `BuildNameMaps` builds the documentation maps itself, so the exporter's `BuildApiModel` can render documentation without any change. The exporter's `GoApiExportTests.GoOnlySurface` snapshot then shows the ATS documentation summaries in place of the generated `X represents X.` text. A trial merge of both heads with that fix-up built, and 80 of the 81 tests in the Go codegen test project passed. The one failure was that snapshot, which differed only in those summaries and is re-accepted with `dotnet verify accept -y`. That trial ran at earlier heads of both branches (see Not verified). ### Merge with main This branch merges main (`45de07f9e3`), which now contains #21188, #21199 and #21261. The conflicts were in `AtsGoCodeGenerator.cs` and two snapshots, and the resolution keeps both sides: - Both sets of private fields and helpers are kept. `BuildNameMaps` builds the accepting interfaces from #21199 first and the documentation maps last, because the renderer resolves type names through the maps built before it. - The enum value constant takes its name from `GetEnumMemberConstantName` (#21199), with this PR's value doc block and string-literal escaping. - DTO callback conversion keeps this PR's escaped map key together with the updated `EmitGoCallbackShimBody` call from #21261. - The union allowed-types note now also says that `float64` accepts any built-in Go numeric type, matching the widened type switch from #21188. The snapshots were regenerated, not merged by hand. In the two large ones the non-comment, non-blank lines are identical to main's (see the counts above). ## Validation Run from the repository root on Windows after `restore.cmd`, with Go 1.27.0 installed so the `[RequiresTools]` tests ran and were not skipped. | Command | Exit | Result | | --- | --- | --- | | `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"` | 0 | 79 passed, 0 failed, 0 skipped (65 on main) | | `dotnet test --project tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 0 | 153 passed, 0 failed, 0 skipped (153 on main) | | `dotnet run --project tools/SelectTests -- --from upstream/main --to HEAD --explain` | 0 | 0 unattributed changed files, no fallback. Selects 7 of 100 PR test projects: `Aspire.Cli.EndToEnd.Tests`, `Aspire.Cli.Tests`, `Aspire.Hosting.CodeGeneration.Go.Tests`, `Aspire.Hosting.CodeGeneration.TypeScript.Tests`, `Aspire.Hosting.Native.Core.Tests`, `Aspire.Hosting.RemoteHost.Tests`, `Aspire.Managed.Tests`, and triggers the `cli-starter-validation`, `extension-e2e`, `homebrew-installer`, `polyglot`, `typescript-api-compat`, `typescript-sdk` and `winget-installer` PR jobs. The Python, Java and Rust codegen test projects are not selected. | Not verified: - The `polyglot` job and the full CI matrix. Of the selected test projects, only the Go and TypeScript codegen projects and the code generation classes of `Aspire.Hosting.RemoteHost.Tests` (`CodeGenerationResolverTests`, `ApiReferenceExportTests` and `ServiceErrorMessageTests`, 22 tests) were run locally. CI is the first run for the rest. - Whether the CI runners that run the Go test project have `go` on `PATH`. The three toolchain tests depend on `[RequiresTools]`. - That the generated SDK body is gofmt-clean. It is not clean on main either, so only the comments are gofmt-checked. - Generation time was measured once on a shared, busy machine, with main and this change measured at different times. - The checks that the new tests fail without each fix were run before the two merges of main into this branch (`f06f16b7bf` and `45de07f9e3`) and were not repeated. - The Python, Java and Rust codegen test projects (29, 71 and 26 tests) passed on an earlier head of this branch and were not re-run after the exported-value and heading fixes. They do not link the moved shared file or any file those fixes changed. - The merge with #21195 was built and tested locally at its head `7e3948ad85` and an earlier head of this branch only, in the Go codegen test project and not in the full CI matrix. At its current head `ec5022d3a9` only the textual merge was checked. #21195 may change before it lands. ### Follow-up issues - Escape ATS metadata in the shared scanner and the TypeScript, Python, Java and Rust generators. - Go SDK: package doc, standard generated-code header, gofmt-clean body, LF output. - Scanner: preserve `<para>` boundaries and code indentation. - Go SDK: guard names derived with `ToCamelCase` (implementation names, list and dictionary getter fields, builder and application implementations) against Go keywords, and make `ReserveName` reject keywords and predeclared names. ## 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-ea6e2d91a57egithub.com-microsoft-aspire · 3dde72b2 · 2026-10-30
- 1.9ETVHarden Go SDK runtime and complete typed API export metadata (#21827) ## 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>github.com-microsoft-aspire · e7ff4353 · 2026-11-09
- 1.4ETV[release/17.0] Harden Go SDK runtime and complete typed API export metadata (#22123) ## Description Backport of #21827 to `release/17.0`, cherry-picked from e7ff435302acb88f9cfe7c9a61e3633e0f553f08 without source modifications. Fixes Go callback concurrency, per-call transport error handling, cancellation ordering, and missing typed API-export metadata. This PR targets `release/17.0` directly with a single commit and no abandoned-stack commits. It replaces #22122, whose head was `main`. Merge this first, then #22057, then #22064, then #22121. Those PRs also target `release/17.0` directly and temporarily include their prerequisite commits; they are not an abandoned stack. Related issues: #21204, #21212, #21115. This does not close those broader follow-ups. ## 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 Additive APIs are Go collection `Err` methods and API-export metadata, not public C# APIs. JSON-RPC payload/header handling changes; no authentication or permission-policy changes. Review statuses above follow the source PR. ## Customer Impact Go AppHosts can race when callbacks and builder chains share wrappers. Invalid call payloads can disconnect unrelated pending operations. This backport isolates those failures, synchronizes shared state, and exposes structured field and constant metadata in Go API exports. ## Testing Validated on this release-based branch: - `.\restore.cmd` — passed. - `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"` — 128 passed; two scaffold newline checks initially failed because three unchanged starter files retained CRLF from an earlier checkout despite `eol=lf`. Confirmed these inputs and the scaffold tests are identical to the release baseline; normalized only working-tree line endings, with no committed file changes. - `dotnet test --project tests\Aspire.Hosting.CodeGeneration.Go.Tests\Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-method "*.GoStarterFiles_UseLfLineEndings" --filter-method "*.ScaffoldedAndStarterSources_AreGofmtClean" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` — both previously failing checks passed after normalization. All 130 tests have passed across these runs. - `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"` — 713 passed, 1 skipped, 0 failed. - `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"` — 31 passed, 0 failed. - `git diff --check origin/release/17.0..HEAD` — passed. Linux race checks, native AOT, and full cross-platform CI were not rerun for this backport; source-PR validation is not claimed as release-branch validation. ## Risk Medium: changes Go runtime concurrency, transport/cancellation behavior, and API-export metadata. Successful-call signatures and the existing export schema version are retained; focused runtime and export tests cover the changed behavior. ## Regression? Unknown: the source PR does not identify a regressing release or commit. Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 9a97ab88 · 2026-11-11
- 1.3ETVShow contextual resource availability in the dashboard sidebar (#21819) ## Description Make the resource sidebar explain what is available in the current view without confusing availability, resource health, and selection. This is the sidebar follow-up to #21792 and targets `ievangelist-dashboard-detail-close-buttons`. Only the follow-up is included in this diff; the parent PR is unchanged. - Show localized **No logs**, **No traces**, **No metrics**, and **Not applicable** badges with muted, still-interactive rows. Missing telemetry means no data is currently available, not that the resource cannot support it. Uninstrumented peers remain available in Traces. - Explain why parameters do not produce console logs, structured logs, traces, or metrics, or support terminals. Clicking or keyboard-selecting a parameter opens its overview. Empty resources still open the existing no-data view. - Highlight **Select all** rather than every row for aggregate selection. Individual, modifier-key, range, and group selection retain their existing selection indicators and metadata. Availability uses the existing telemetry-resource subscription and a cached snapshot lookup. First-signal arrival and clearing update badges without changing selection. Keep the data query scoped to the selected resources when their first signal arrives, and refresh logs/traces when the layout's initial resource snapshot finishes loading. ### User-facing usage Open Structured logs, Traces, or Metrics and select a resource with a no-data badge: its empty view opens normally. When that resource sends telemetry, the badge disappears and its data becomes visible without selecting it again; clearing that signal restores the badge and empty state. A running resource can therefore be healthy and still have no telemetry. Hover or keyboard-focus a parameter in a telemetry, Console logs, or Terminal view to see the feature-specific explanation, then press Enter to open the parameter overview. Use **Select all** for the aggregate view, Ctrl/Cmd-click to add or remove individual resources, or Shift-click for a range. ### Screenshots / Recordings > **This PR includes UI changes.** These 14 screenshots are from this branch's Release build using deterministic synthetic resources and telemetry. They show both themes at desktop (1440 x 900), tablet (768 x 1024), and mobile (390 x 844) sizes. No real credentials or application data are used. #### Responsive availability and aggregate selection Only **Select all** is highlighted in the aggregate view. Running resources with no telemetry are muted; parameters explain why the current feature is not applicable. | Viewport | Light | Dark | | --- | --- | --- | | Desktop, 1440 x 900 |  |  | | Tablet, 768 x 1024 |  |  | | Mobile, 390 x 844 |  |  | #### First telemetry and clear, with the same resource selected The gateway already has a log, but the selected catalog view does not show it. Catalog's first log removes its badge and appears without changing selection. Clearing catalog's logs restores the badge and empty state. | Selected resource, no logs yet | First log arrives | Catalog logs cleared | | --- | --- | --- | |  |  |  | #### View-specific explanations and selection | Scenario | Screenshot | | --- | --- | | Traces, dark: selected running resource with no traces |  | | Metrics, light: selected running resource with no metrics |  | | Console logs, light: nonparameters remain available; parameter explains why it produces no console logs |  | | Parameter selection opens Overview and removes the contextual unavailable badge |  | | Explicit multiselection retains individual rails while Select all is not filled |  | ### Validation Run on Windows after `.\restore.cmd` (**passed**), with `MSBUILDTERMINALLOGGER=false`. All commands below use the repository-pinned SDK, Release configuration, and Microsoft.Testing.Platform filters. **Layout component suite: passed, 481 cases.** ```powershell dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj -c Release --no-launch-profile -- --filter-namespace 'Aspire.Dashboard.Components.Tests.Layout' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` **Availability and telemetry-page compatibility: passed, 81 cases**, including 16 availability cases. This overlaps the layout suite; counts are not additive. ```powershell dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj -c Release --no-launch-profile -- --filter-class '*.ResourceRowAvailabilityTests' --filter-class '*.StructuredLogsTests' --filter-class '*.TracesTests' --filter-class '*.MetricsTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` **Focused functional browser suite: passed, 49 cases.** Explicitly opted into the selected outerloop browser scenarios; unrelated quarantined tests remain excluded. ```powershell dotnet test --project tests\Aspire.Dashboard.Playwright.Tests\Aspire.Dashboard.Playwright.Tests.csproj -c Release --no-launch-profile -- --filter-method '*.ExistingTelemetry_RemainsVisibleWhenAllResourcesViewReloads' --filter-method '*.UnavailableRows_RemainInteractiveAndUpdateWhenSignalsArriveAndClear' --filter-method '*.ParameterRows_ExplainEachUnavailableFeatureAndKeyboardSelectionOpensOverview' --filter-method '*.AvailabilityBadges_FollowTabChangesWithoutChangingSelection' --filter-method '*.SelectAll_*' --filter-method '*.AllResourcesRow_ClearsSelectionAndSummarizesAllResources' --filter-method '*.ResourceRowModifierClicks_SelectSeveralResources' --filter-method '*.ExtremeName_RetainsFullAccessibleAndHoverKeyboardDisclosure' --filter-method '*.IconTile_PreservesStylesAcrossPaneModesAndDensities' --filter-method '*.SelectionSurfaces_UseDashboardNeutralTokensAcrossThemes' --filter-method '*.DynamicRows_PreserveTokenGeometryAfterModelAndPresentationChanges' --filter-method '*.RowComposition_AlignsStatusAndSingleLineDetailsWithAccessibleContrast' --filter-method '*.PaneWidth_DisclosesMetadataWithoutChangingSelectionAndKeepsEndpointBehavior' --filter-not-trait 'quarantined=true' ``` Coverage includes all three signals arriving and being cleared at three widths, unchanged selection and data scope, visible feature-specific parameter explanations and keyboard navigation across five views, tab-dependent labels, synthetic trace peers, long-name disclosure, aggregate/individual/group selection, and Ctrl/Cmd-click from the aggregate set. The initial logs snapshot failure was reproduced before the lifecycle fix; both logs and traces now have passing load/reload coverage. Existing styling/geometry tests were aligned with aggregate selection; no new computed-color-only assertions were added. `git diff --check`: **passed**. Screenshot capture assertions: **passed**, including that another resource's log never appears in the selected resource's view. Builds report NU1903 for the repository-pinned `Microsoft.DotNet.ILCompiler` 11.0.0-rc.2.26504.105 ([GHSA-p3jp-9v83-76w9](https://github.com/advisories/GHSA-p3jp-9v83-76w9)). This PR does not change dependencies or feeds. Fixes # (issue) ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · ba68df27 · 2026-11-06
- 1.3ETVAdd a Go AppHost tooling check to aspire doctor (#21196) ## Description `aspire doctor` checks the TypeScript AppHost toolchain but says nothing about Go. A Go AppHost needs a Go toolchain at or above the `go 1.26` directive in the generated SDK and the scaffolded `go.mod`, and `aspire run` without one fails late with a raw process-start error. This adds `GoAppHostToolingCheck` (order 33, next to `TypeScriptAppHostToolingCheck`). It runs only for a Go AppHost, so other AppHost languages see no change. The configured AppHost is authoritative: when settings select an AppHost of another language there are no Go checks. When none is configured, the check looks for `apphost.go` in the working directory. | Check name | Status | When | | --- | --- | --- | | `go-apphost-go` | Fail | `go` is not on `PATH` (includes the install link) | | `go-apphost-version` | Fail | Go is older than 1.21, or the effective `GOTOOLCHAIN` is `local` (Go never switches toolchains, so it cannot satisfy the AppHost's `go 1.26`) | | `go-apphost-version` | Warning | Go 1.21 to 1.25 and the effective `GOTOOLCHAIN` is `path`, `local+path` or `<name>+path`: Go only switches to a newer toolchain that is already on `PATH` (for example `go1.26.0`), and the check does not read `go.mod`, so it cannot tell whether one is there | | `go-apphost-version` | Warning | Go 1.21 to 1.25 and Go can download the required toolchain: any other `GOTOOLCHAIN` (`auto`, `<name>`, `<name>+auto`), or no readable answer from `go env GOTOOLCHAIN` | | `go-apphost-version` | Warning | `go version` prints nothing readable (inconclusive, not proven broken) | | `go-apphost-tools` | Pass | Go 1.26 or later, with the installed version | Details worth knowing: - The effective `GOTOOLCHAIN` is only needed for Go 1.21 up to 1.25. Nothing extra runs for Go 1.26 or later, or for Go older than 1.21. The `go` command takes the value from the process environment, then from the user config that `go env -w` writes, then from `$GOROOT/go.env`. Fedora's Go package ships `GOTOOLCHAIN=local` in that `go.env` ([Fedora docs](https://developer.fedoraproject.org/tech/languages/go/go-installation.html)). A non-empty process variable is used as is. Otherwise the check runs `go env GOTOOLCHAIN` with the same 5 s timeout as the version probe, and a failure or empty output counts as `auto`, which keeps the Warning. - That `go env GOTOOLCHAIN` runs in a fresh empty directory under the temp folder, deleted afterwards, never in the AppHost directory, because doctor must not download a toolchain, and go commands that read a `go.mod` can trigger a download. Measured in a directory whose go.mod says `go 1.99`: on Go 1.24.1 and 1.27.0 `go env GOTOOLCHAIN` printed `auto` without switching, while `go version` there tries to download `go1.99.0`. The empty directory keeps the probe independent of that behaviour; it is defence in depth, not a documented guarantee. - `go version` runs with `GOTOOLCHAIN=local`. With the default `auto`, every `go` command runs toolchain selection first, so a Go older than the `go.mod` in the current directory tries to download that toolchain instead of reporting the installed version. On Go 1.24.1 in the `go 1.99` directory `go version` failed after 0.8 s; with `local` it answered in 0.04 s. - Both probes launch `go` through `IProcessExecutionFactory`, like the other CLI child processes: the `ASPIRE_CLI_*` identity variables are stripped from the environment, output encodings are pinned, and each launch is debug-logged. A `go` that outlives the 5 s timeout is killed together with its process tree. Standard output and standard error are collected separately: `go` reports notices such as a toolchain download on standard error, and they must not end up in the version string or in the `GOTOOLCHAIN` value that the callers parse. A non-zero exit is logged at debug level with its standard error and counts as no answer. - Only `GOTOOLCHAIN=local` proves failure. In every mode `go` looks in `PATH` for the exact toolchain that `go.mod` names (the go line `go 1.26` becomes `go1.26.0`), and the path modes fail only when that executable is missing (`cmd/go/internal/toolchain/select.go`). Measured with Go 1.27.0, `GOTOOLCHAIN=path` and a `go.mod` that says `go 1.99`: with no `go1.99.0` on `PATH`, `go list .` prints `go: cannot find "go1.99.0" in PATH`; with a `go1.99.0` shim on `PATH`, Go selects and runs it offline; a `go1.99.1` shim is not accepted. The check does not read `go.mod`, so `path`, `local+path` and `<name>+path` are a Warning that names the toolchain to put on `PATH`, built from `MinimumGoVersion`. - `GOTOOLCHAIN` values are matched case-sensitively, as the `go` command does. - `CommandPathResolver` now knows `go`, so the AppHost launcher reports `go is not installed or not found in PATH. Please install Go and try again.` with `https://go.dev/doc/install` instead of a process-start failure. - The 1.26 floor is duplicated in the CLI because it cannot reference `Aspire.Hosting.CodeGeneration.Go`. `MinimumGoVersion_MatchesGoModTemplate` reads the `go` directive from the templates in `AtsGoCodeGenerator.cs` and `GoLanguageSupport.cs` and fails when they stop matching. A `path_rules` entry in `eng/github-ci/test-trigger-map.yml` selects `Aspire.Cli.Tests` when either file changes, with a guard test in `Infrastructure.Tests`. - The Go language definition is only returned while `experimentalPolyglotGo` is on, so the check returns no results with the flag off and needs no change when the flag is removed (#21106). The check asks that definition for `apphost.go` directly instead of calling `DetectLanguageRecursiveAsync`, which returns only the first language that matches, and C# matches any `*.csproj`: a Go AppHost beside a service project would be reported as C#. Part of #21115 ### Known limitations - A pinned `GOTOOLCHAIN=<name>` (for example `go1.24.1`) is not modelled; the check validates the Go on `PATH`. - With `path`, `local+path` and `<name>+path` the check cannot tell whether the toolchain that `go.mod` names is on `PATH`, because it does not read `go.mod`; it warns. - `go1.26rc1` is accepted as Go 1.26. ### Not in this PR - Doctor checks for the Python, Java and Rust AppHost toolchains. - A language-agnostic AppHost resolver shared by the TypeScript and Go checks. The Go check uses the configured AppHost, then looks for `apphost.go` directly. `TypeScriptAppHostToolingCheck` resolves through `LegacyTypeScriptAppHost`, which is shared with `aspire update --migrate` and falls back to first-language-wins discovery even when settings select another language's AppHost. ## Validation All commands ran on Windows with the repo-local SDK, on the head of this branch, on top of `upstream/main` `5ea175ce62`. `main` has since moved ten commits (`f4ae2cc424`); a trial merge of this branch into it is clean, and the commands were not repeated on the merged result. | Command | Result | | --- | --- | | `dotnet build src\Aspire.Cli\Aspire.Cli.csproj -m:2 --no-restore --no-incremental -p:BuildProjectReferences=false` | 0 warnings, 0 errors | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.GoAppHostToolingCheckTests" --filter-class "*.TypeScriptAppHostToolingCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.EnvironmentCheckerTests" --filter-class "*.CommandPathResolverTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 135 passed, 0 failed (59 in `GoAppHostToolingCheckTests`) | | `dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.TestTriggerMapTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 178 passed, 0 failed | The `GOTOOLCHAIN` handling and the AppHost lookup were each tested RED first, against the code before the change, and went GREEN afterwards: - Effective `GOTOOLCHAIN` value: 10 of 45 Go tests failed, including every `go.env` row (expected Fail, actual Warning). - AppHost lookup: 2 of 48 failed (a configured non-Go AppHost with a discoverable `apphost.go`; `apphost.go` beside a `.csproj` with Go missing). - Path modes: 10 of 50 failed. The six `path`, `local+path` and `<name>+path` rows expected a Warning and got a Fail, and the four `local` rows expected the new message. The probe runner has its own unit tests with the shared `TestProcessExecutionFactory`. They cover: standard output returned without the standard error notices that `go` prints; a non-zero exit, which logs the standard error and gives no answer; a process that does not start; start failures (`Win32Exception`, `InvalidOperationException`, `IOException`); a `go` that outlives the timeout; and caller cancellation. The timeout is a parameter, so the timeout test takes milliseconds. A separate test asserts that the `go env GOTOOLCHAIN` probe does not override `GOTOOLCHAIN`. Real `aspire doctor --format json` runs of the CLI built from this branch. The scratch directory has an `apphost.go` beside `api\Api.csproj` and `{"features":{"experimentalPolyglotGo":true}}` in `aspire.config.json`. The installed Go is 1.27.0. For the older-Go rows a `go.cmd` shim on `PATH` stands in for Go 1.24.1: it answers `version` with `go version go1.24.1 windows/amd64`, answers `env GOTOOLCHAIN` with a value from a test variable (default `auto`), and logs its arguments, `GOTOOLCHAIN` and working directory. | Environment | Result | | --- | --- | | Go 1.27.0 | `go-apphost-tools` pass (`go 1.27.0`), exit 0 | | no `go` on `PATH` | `go-apphost-go` fail with the install link, exit 1 | | shim 1.24.1, `GOTOOLCHAIN=local` in the process environment | `go-apphost-version` fail, exit 1 | | shim 1.24.1, no process variable, `go env GOTOOLCHAIN` answers `local` | same fail, exit 1 | | shim 1.24.1, `GOTOOLCHAIN=path` | `go-apphost-version` warning: "only lets Go switch to a newer toolchain that is already on PATH (for example go1.26.0)", exit 0 | | shim 1.24.1, `GOTOOLCHAIN=go1.25.0+path` | same warning, exit 0 | | shim 1.24.1, no process variable, `go env GOTOOLCHAIN` answers `path` | same warning, exit 0 | | shim 1.24.1, default | `go-apphost-version` warning with the download message, exit 0 | | `aspire.config.json` selects `../ts/apphost.mts` (Go enabled), the working directory also has an `apphost.go`, no `go` on `PATH` | no Go entries, exit 0 (the TypeScript check reports the configured AppHost) | | `experimentalPolyglotGo` not set, `apphost.go` beside `api\Api.csproj`, no `go` on `PATH` | no Go entries, exit 0 | The shim saw `version` with `GOTOOLCHAIN=local` in the AppHost directory. The runs without a process `GOTOOLCHAIN` also saw `env GOTOOLCHAIN`, with `GOTOOLCHAIN` unset, in a fresh `%TEMP%\aspire-go-doctor-*` directory, and no such directory was left afterwards. Go 1.27.0 reports `go-apphost-tools` with `metadata` `{"language":"go","appHostPath":"...\\apphost.go","version":"1.27.0"}`. Before the AppHost lookup change this layout produced no Go results, even with Go missing (the second RED test above). An earlier run used the real Go 1.24.1 binary (from a scratch module cache) with `GOTOOLCHAIN=local` in the process environment, only in the `GOENV` config file, and only in a `go.env` under `GOROOT`. Each gave the same `go-apphost-version` fail, and the default gave the download warning. The code that reads the effective `GOTOOLCHAIN` has not changed since. After the probes moved to `IProcessExecutionFactory`, the Go 1.27.0 run and the shim rows for `GOTOOLCHAIN=local`, `go env GOTOOLCHAIN` answering `local` or `path`, and the default were run again on the new head with `--log-level Debug`. They gave the same results and left no `aspire-go-doctor-*` directory. The shim saw an empty `ASPIRE_CLI_COMMIT` although the parent process had a 40-character SHA in it. Three more shim runs: - A `go` that hangs: the debug log shows the wait canceled after 5 s and the kill of the process tree, the check gives the inconclusive warning, and no `cmd` or `ping` process was left behind. - A `go version` that writes a notice to standard error: the version is still read from standard output alone and the check carries on to the `go env GOTOOLCHAIN` probe. - A `go version` that exits with 2 and prints `go: cannot find main module` to standard error: the debug log shows `'go version' failed with exit code 2: go: cannot find main module`, and the check gives the inconclusive warning. Not run: - Linux and macOS. - The real Go 1.24.1 binary on this head. The older-Go rows above use the shim; the real-binary runs predate the AppHost lookup, path-mode and process-launch changes. - A real `go1.26.0` toolchain on `PATH` with `GOTOOLCHAIN=path`, end to end. The Go 1.27.0 measurements above, with a copy of `go.exe` named `go1.99.0`, show that Go selects a `PATH` toolchain offline. - Go 1.21 to 1.25 other than 1.24.1, and a `go.env` installed by a real distribution package. The real-binary `go.env` run used `GOROOT` pointing at a scratch directory that holds only a `go.env`. - `aspire run` for a Go AppHost without Go on `PATH`, end to end. The message comes from the same `CommandPathResolver` that `CommandPathResolverTests` covers. - The real GitHub conditional-selection run for the new trigger-map rule. - A real `go.exe` that exits with a non-zero code. That path is covered by a unit test and by a `go.cmd` shim that exits with 2. - The rows that never launch a probe (no `go` on `PATH`, a configured TypeScript AppHost, `experimentalPolyglotGo` off) and the `GOTOOLCHAIN=go1.25.0+path` row were not repeated after the probes moved to the factory. ## 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: 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-ea6e2d91a57egithub.com-microsoft-aspire · 7317791d · 2026-10-28