Mitch Denny
90d · built 2026-11-30
Performance
What Mitch Denny shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+7.2engineers
delivers like 8.2 (8.2x pre-AI)
Output (ETV)
89.8ETV
+152.5% vs 35.6 prior
Features share
25.4%
−3.7 pp vs prior window
Fixes share
6.8%
−6.5 pp vs prior window
Work mix
25.4% Features6.1% Maintenance57.1% Tests4.5% Docs6.8% Fixes
83 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 77 %
- By Features share
- Top 64 %
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.
- 24.1ETVAdd AppHost terminals, dashboard docking, and terminal automation (#19887) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com> Copilot-Session: 3de8011a-08b4-48c9-aa13-f0feef9a378c Copilot-Session: 395e0f6a-f4c1-4db8-a3dd-e0fbf5392773 Copilot-Session: 6019354f-1f14-4f5b-9068-1179bc66b58egithub.com-microsoft-aspire · a21e9394 · 2026-09-18
- 7.8ETVAdd resource-bound aspire test with experimental live collectors (#21527) <!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `a59c24f38ed49a18059c953b917e78e3883c0067` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ Current Release CLI build with banned-API analysis and 132 command/reporter tests passed after integrating pinned main and updating both system-temp guards.<br>↑ Historical hosting, generated SDK and packaged CLI evidence is recorded below.<br>↓ New-head cross-platform/native CI is pending; full local repository, security and API reviews remain unperformed. | <!-- /copilot-assessment --> ## Description Add experimental `aspire test`: keep supporting services available until every annotated resource/replica and its runtime result collector completes, report observed outcomes, then shut down orderly. `--keep-alive` retains the foreground CLI/AppHost for inspection after success or failure. `--format json` emits one summary object on stdout, with diagnostics on stderr. **Preview opt-in:** the command is disabled by default. Run `aspire config set features.testCommandEnabled true` to enable it. The flag only gates CLI command registration; it does not add hosting/runtime API gates or change ordinary `aspire run`. Both packaged C#/TypeScript CLI E2E scenarios explicitly enable it. **Current API:** `WithTesting()` marks a resource for process-based completion. `WithTesting(Func<ResourceTestingContext, Task>?)` registers one optional asynchronous runtime collector. The callback never executes during model construction, ordinary run, or publish. There is no public configuration wrapper or prelaunch output-path accessor. Repeating `WithTesting` replaces the callback; marker-only clears it. Both preserve the internally allocated resource output directory and containing context. The two context types are **`TestingContext`** for the invocation and **`ResourceTestingContext`** for an individual logical resource. The latter exposes its containing context through **`TestingContext`**, so `context.TestingContext.OutputPath` is the run directory and `context.OutputPath` is the resource directory. No compatibility aliases or obsolete wrappers are retained for these unshipped APIs. All new public hosting testing APIs carry `ASPIRETESTING001`. This foundation supplies framework-neutral orchestration/reporting; upper integrations own framework helpers, report parsing, and source-outcome mappings. **Run isolation:** `RunCommand.cs` and every `RunCommandStrings` localization file remain unchanged from the PR merge base. `TestCommand` deliberately owns launch/startup, cancellation/drain, reporting, and inspection while calling existing project/backchannel/secrets/logging services. Necessary startup bookkeeping is duplicated rather than extracting a shared runner that could alter ordinary development behavior. Run IDs, coordinator/reporter names, protocol DTOs, paths, lifetimes, cancellation, and seven-outcome policies are unaffected by the context naming revision. ### User-facing API and usage Marker-only execution works for any resource capable of reporting authoritative completion: ```csharp #pragma warning disable ASPIRETESTING001 builder.AddExecutable("smoke-tests", "custom-test-runner", ".") .WithTesting(); ``` Collectors run alongside resource execution. Runner arguments/environment and report locations must be configured independently, not from the callback or its synchronous prefix. This excerpt follows the [source playground](https://github.com/microsoft/aspire/tree/mitchdenny-aspire-test-lifetime/playground/AspireCliTesting): `service`/`serviceEndpoint` refer to its shared HTTP service, and the playground deletes the private runner-report directory in an AppHost shutdown `finally` block. ```csharp var reports = Directory.CreateTempSubdirectory("probe-reports-"); var tests = builder.AddDotnetProject("foundation-tests", "foundation-tests/tests.cs") .WithEnvironment("SERVICE_URL", serviceEndpoint) .WithEnvironment("TEST_OUTPUT_PATH", reports.FullName) .WaitFor(service); tests.WithTesting(async context => { var passed = await context.WaitForCompletionAsync(); if (passed) { var report = Path.Combine(reports.FullName, "probe.txt"); var actual = await File.ReadAllTextAsync(report, context.CancellationToken); passed = actual == "Aspire CLI testing"; File.Copy(report, Path.Combine(context.OutputPath, "probe.txt")); } context.PublishResult(new TestResult { Name = "shared-service-probe", Outcome = passed ? TestOutcome.Passed : TestOutcome.Failed }); }); ``` `ResourceTestingContext` exposes `TestingContext`, `ResourceName`, `OutputPath`, `CancellationToken`, `PublishResult(TestResult)`, and: ```csharp public TestingContext TestingContext { get; } public Task<bool> WaitForCompletionAsync(CancellationToken cancellationToken = default); ``` The completion helper describes resource execution independently of published results. Its default always observes run cancellation, including `--timeout-seconds` and Ctrl+C. A supplied token adds caller-local cancellation; it cannot disable run cancellation. Cancelling one wait does not cancel authoritative completion or other waiters. No separate timeout or hidden default is introduced. Generated TypeScript retains the resource context and projects the containing type as `TestingContext`, accessed through `context.testingContext()`: ```typescript await tests.withTesting(); await tests.withTesting({ callback: async context => { await context.waitForCompletionAsync(); const invocation = await context.testingContext(); // invocation.outputPath() identifies the containing run; // context.outputPath() identifies this resource's artifact destination. // Read independently configured reports, stage artifacts, and publish results. }, }); // Optional caller-local cancellation: // await context.waitForCompletionAsync({ cancellationToken: signal }); ``` `TestResult.Outcome` remains required; omitted or undefined outcomes are not silently fabricated. The enum uses implicit values with failure as its default: ```csharp public enum TestOutcome { Failed, Passed, Skipped, Inconclusive, Error, TimedOut, Cancelled } ``` Only `Passed` and `Skipped` are non-failing. All five other outcomes make testing unsuccessful even when resource processes exit zero. Individual JSON/streamed results preserve `failed`, `passed`, `skipped`, `inconclusive`, `error`, `timedOut`, or `cancelled`; generated TypeScript retains member names as string enum values. The shared host/CLI classifier rejects unknown outcomes rather than falling through to success. Published test `TimedOut`/`Cancelled` outcomes are normal test failures (exit `23`), not overall command deadline expiry (`17`) or user cancellation (`130`). They do not cancel peers, change deadlines, synthesize cancellation events, or fabricate unobserved tests. Process completion remains independent: a successful process can have unsuccessful results, and passing tests cannot override a failed process or collector exception. ### Lifetime, output, and deadlines - Exit `0` requires successful resource execution/collection and orderly shutdown. Nonzero/unknown terminal process status, startup failure, unsuccessful published outcomes, and collector exceptions cannot silently pass. Resource/test failure returns `23`; startup/RPC/configuration/shutdown errors have explicit nonzero diagnostics. User cancellation returns `130`. - All resources/replicas and current callbacks are joined without fail-fast behavior. Collection starts before CLI connection; events are retained/replayed. Already-terminal resources, notification races, late exit codes, and callback exceptions are covered. An early-returning callback cannot finish a running resource. Publication closes when its callback ends or cancellation occurs; noncooperative callbacks cannot change finalized output. - In guest testing mode, a successful guest exit explicitly requests server shutdown, waits for authoritative server completion, and preserves server failures/forced termination rather than discarding them during best-effort session disposal. Guest nonzero exits and caller cancellation remain failures; ordinary non-watch run behavior is unchanged. - The CLI creates a unique private `~/.aspire/testruns/<run-id>` before launching the AppHost, honoring configured Aspire home. The host internally allocates `<run-id>/<logical-resource-name>` before execution. No `resources` intermediary or resource GUID suffix. Replicas share their logical resource's directory; integrations coordinate replica-specific filenames. Invalid portable names, case collisions, existing paths, and unsafe links fail explicitly rather than being sanitized/adopted. Dashboard/test run-ID correlation remains deferred; the two roots use independent identifiers. - Text distinguishes `Resource` state transitions from `Test` results, displays exit codes only for terminal states, and emits accurate per-resource passed/failed/other totals after collection drains. All five unsuccessful outcomes count as **failed**; **other** counts skips only. Individual outcomes remain visible: unsuccessful test results red, passes green, skips yellow. Resource-only tests do not invent counts. Overall verdict, published totals, artifact links, and useful error/partial-run diagnostics remain; no duplicate final resource table. - Versioned `summary.json` records paths/timestamps/status/exit/error, actual resource observations, results, collection status, and totals. `publishedResults.failed` includes all five unsuccessful outcomes; `passed` and `skipped` count only their named outcomes. Every publication is counted once while retaining its specific outcome. No new result metadata fields. Exit codes never fabricate counts. - JSON stdout is one object without interactive output. During keep-alive it is emitted once at completion with `cliExitCode: null`; the final file later records inspection/shutdown outcome without another stdout object. - `--timeout-seconds` optionally bounds discovery/build, startup, execution, collection, and keep-alive using one monotonic deadline. It has no default and is distinct from startup-only timeout. Integers `1` through `4294967` are validated before artifacts/launch. Expiry returns `17` after at most five additional seconds of bounded teardown. Partial observations persist as `timedOut`; completed inspection results retain outcome/time while the final file records timeout exit/diagnostics. Explicit user cancellation takes precedence (`130`). ```bash aspire config set features.testCommandEnabled true aspire test --apphost ./AppHost/AppHost.csproj aspire test --apphost ./AppHost/AppHost.csproj --keep-alive aspire test --apphost ./AppHost/AppHost.csproj --timeout-seconds 120 --format json --non-interactive ``` The file-based playground resolves the hosting SDK and dashboard from repository source, without released experimental packages or private package hives. Later framework layers append scenarios to its shared AppHost; fixtures/report locations remain their responsibility. Development watch, detached testing, profile capture, and extension-managed test debug lifetimes are not supported. ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - **TODO:** No text-rendering walkthrough was captured. Exercise multiple annotated resources/replicas and a failure; inspect resource/test distinction, terminal-only exit codes, collector-drained counts, overall totals/artifact links, keep-alive, and plain/no-color output. There is no final resource table. The new JSON CLI E2E cases produce diagnostic terminal recordings through the existing harness, not a visual-rendering demonstration. <!-- Add screenshots/recordings here --> ### Security considerations Threat modeling/security review remains pending. Dedicated run/resource directories use Unix `0700`; CLI-owned files use `0600` from creation. Windows directories use protected current-user ACLs with inherited file permissions. Dedicated `testruns` permissions are hardened without changing unrelated Aspire-home permissions. Unsafe links/reparse paths and writable Unix ancestors below trusted roots are rejected. Exclusive name reservations and private temporary files/atomic summary replacement avoid adopting or truncating existing destinations. Framework report permissions and container identity/mount access remain integration responsibilities. No new dependencies or external services; the optional playground starts a development HTTP service on a dynamic local endpoint. ### Validation **Latest CI compatibility correction:** integrated pinned main `b2baebe8864c718587bd7d13cfe5460a80f83062` and replaced both direct system-temp root probes in `TestRunReporter` with `TemporaryStorage.SystemTempPath`. The failed native archive, CLI, v2 RPC and TypeScript compatibility jobs all stopped at the same RS0030 compile errors after main's #22553 analyzer change; this is not a Homebrew recurrence. Console login-link behavior is unchanged. Current-head CI is pending. ```bash ./restore.sh # Passed: 0 warnings, 0 errors. dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --configuration Release --no-launch-profile -- --filter-class '*.Commands.TestCommandTests' --filter-class '*.TestRunReporterTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 132 tests, including reporter path guards and console login-link/non-logging regressions; production banned-API analysis enabled. ``` **Current feature-flag revision:** `testCommandEnabled` defaults to false and gates only CLI command registration. Focused tests cover unset/false/true configuration, command availability, existing test-command behavior, configuration discovery, and ordinary run. The actual source CLI rejects `test` by default (exit `1`) and displays test help when `features__testCommandEnabled=true` (exit `0`). C#/TypeScript packaged E2E setup now explicitly enables the flag; that updated project was built, not rerun against a new native package locally. New-head CI is not yet verified. ```bash dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \ --filter-class '*.RootCommandTests' --filter-class '*.KnownFeaturesTests' \ --filter-class '*.TestCommandTests' --filter-class '*.ConfigCommandTests' \ --filter-class '*.RunCommandTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 356 tests. dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-restore # Passed: 0 warnings, 0 errors. ``` **Earlier verified CI:** [run 41388552101, attempt 2](https://github.com/microsoft/aspire/actions/runs/41388552101/attempts/2) completed **successfully** for exact head `2f6dcc4a6e521e2e68e2e9dedef5462b676f0af5`, including final aggregation. This is historical evidence, not a green result for the subsequent preview-label, state-comparer, umask, or feature-flag revisions. The initial attempt had one unrelated unchanged Windows Managed terminal-host shutdown timeout; its single targeted rerun [passed](https://github.com/microsoft/aspire/actions/runs/41388552101/job/125106116188). No terminal-host source, assertions, timeouts, quarantine or skip settings were changed. CLI suites passed on Windows/Linux/macOS; Hosting-4 passed on Windows/Linux. Native hosting validation and the other PR checks also passed. **Earlier native CLI E2E passed:** [TestCommandTests job](https://github.com/microsoft/aspire/actions/runs/41388552101/job/125099931798), Linux x64, actual native CLI/packages at head `2f6dcc4a6e`, **2 tests passed in 2m28s**, exercising six real `aspire test` invocations. This validates the guest-shutdown source and corrected cross-UID fixture at that head, not merely an older archive or the current feature-flag revision. **Earlier review fixes:** guest testing now stops/drains the server and propagates completion (`b3a582dcf6`). A completion barrier proves it cannot return early; regression cases cover guest exit `0` with server `0`, `37`, `-1`, or `137`, guest exit `7`, cancellation during drain (`130`), ordinary non-watch run behavior, and cleanup. The replay regression (`2f6dcc4a6e`) pauses an actual notification replay predicate, publishes while paused, then checks the subscriber and multi-resource coordinator observe success/failure without a lost update or deadlock. Existing already-completed replay coverage remains separate; no public test hook or production instrumentation was added. ```bash export DOTNET_ROOT="$PWD/.dotnet" export PATH="$DOTNET_ROOT:$PATH" export MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \ --filter-class '*.GuestAppHostProjectTests' --filter-class '*.AppHostServerSessionTests' \ --filter-class '*.TestCommandTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 206 tests. dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- \ --filter-class '*.TestRunCoordinatorTests' --filter-class '*.TestRunStreamingTests' \ --filter-class '*.TestRunCoordinatorEndToEndTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 38 tests. ``` **Packaged CLI E2E:** `TestCommandTests.CSharpAppHost_TestResourcesCollectResultsAndStop` and `TestCommandTests.TypeScriptAppHost_TestResourcesCollectResultsAndStop` execute inside owned Linux Docker containers. Each language executes three real `aspire test` invocations: successful execution/result (exit `0`), process failure with a passing published result (exit `23`), and process success with a failing published result (exit `23`). Both AppHosts mark generic executable resources with `WithTesting`/`withTesting`, not a JavaScript testing integration. The runtime callback waits for authoritative completion, stages an artifact and publishes a result directly; TypeScript exercises real callback/context marshalling. A marker-only peer stays pending until publication completes and then probes the still-live HTTP dependency. Assertions cover the exact resource exit codes, collection state/counts, fresh flat artifact directory per invocation, artifact content, a single parseable JSON stdout object equal to persisted `summary.json`, and removal of all four recorded owned processes after return. AppHost construction explicitly checks that the collector has not run yet. Initial Linux CI exposed a fixture-only cross-UID permission issue: applying `umask 077` before scaffolding made root-owned bind-mounted source inaccessible to host fixture writes. `e1120ed4e8` retains harness shared-source permissions until host writes finish, then applies private runtime permissions and hardens only the owned container's Aspire home. Production artifact protections were not relaxed. ```bash ASPIRE_E2E_CLI_ARCHIVE_DIR="$PWD/artifacts/testing-cli-e2e-ci" \ ASPIRE_E2E_DOTNET_IMAGE=aspire-viteplus-e2e-runner:latest \ dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- \ --filter-class '*.TestCommandTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Local pass after permission fix: 2 tests, six real invocations, 1m55s. # Local driver: macOS arm64, owned Linux-arm64 containers. # Local native CLI/NuGet artifacts came from CI run 41382191517, product head f0d5b8f6. # Head 2f6dcc4a6e Linux-x64 native execution separately passed in CI above. dotnet run --project tools/SelectTests -- --from 7b5825e195^ --explain # Earlier added-file trace passed: new fixture attributed through ProjectGraph and convention # to Aspire.Cli.EndToEnd.Tests; one selected project and zero unattributed files. # CI admitted and passed a dedicated TestCommandTests class job. No routing-map edit required. ``` **CI fixes in `f0d5b8f6`:** refreshed Go/Java/Python/Rust generated snapshots for the current API; exercised `DisableExtensionLaunch` in the clone-property fixture; replaced Windows RPC fixture's inline `cmd /c` command with a batch file in a path containing spaces, and asserted actual terminal exit codes so error `99` cannot masquerade as an expected failure. The affected generator jobs and Windows Hosting-4 job passed in [CI run 41382191517](https://github.com/microsoft/aspire/actions/runs/41382191517); Linux/macOS CLI jobs passed. This run also hit an unrelated template SDK-download TLS handshake failure before test execution. The MongoDB failure on the earlier run matched existing flaky issue [#21593](https://github.com/microsoft/aspire/issues/21593), and did not recur; no MongoDB changes were made. The superseded [run 41384739405](https://github.com/microsoft/aspire/actions/runs/41384739405) caught the E2E fixture permission issue fixed above and one unchanged Windows Git SSH verification theory failure after its five-second probe budget under runner contention. No SSH policy/timeout changes were made. That run was cancelled after the new fixes were pushed; the later head `2f6dcc4a6e` Windows CLI suite passed. Earlier context-naming revision validation, macOS arm64 with the restored repository SDK; quarantined/outerloop tests excluded. Generated TypeScript handle/getter/wrapper/registration changes were inspected and rerun successfully. The scanner explicitly checks the new getter capability and returned context type. ```bash dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- \ --filter-class '*.TestingCollectorTests' --filter-class '*.TestRunCoordinatorTests' \ --filter-class '*.TestRunStreamingTests' --filter-class '*.TestRunCoordinatorEndToEndTests' \ --filter-class '*.AppHostRpcTargetTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 96 tests. dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- \ --filter-class '*.AtsTypeScriptCodeGeneratorTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 140 tests. dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \ --filter-class '*.TestRunReporterTests' --filter-class '*.TestCommandTests' --filter-class '*.RunCommandTests' \ --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' # Passed: 247 tests. dotnet run --project src/Aspire.Cli/Aspire.Cli.csproj --no-launch-profile -- \ test --apphost playground/AspireCliTesting/apphost.cs --isolated \ --timeout-seconds 120 --format json --non-interactive # Earlier pass, before the default-off CLI gate: source AppHost built and executed; # exit 0; real shared-service-probe passed. New invocations require the opt-in above. # Directly verified one stdout JSON equals summary.json, current probe.txt content, # flat foundation-tests directory, and Unix 0700 directory/0600 artifact modes. base=$(git merge-base HEAD origin/main) git diff --exit-code "$base" -- src/Aspire.Cli/Commands/RunCommand.cs \ src/Aspire.Cli/Resources/RunCommandStrings.resx \ src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs \ ':(glob)src/Aspire.Cli/Resources/xlf/RunCommandStrings.*.xlf' # Passed, including earlier review fixes: zero diff. git diff --check # Passed. ``` Coverage retains experimental context contracts, deferred runtime invocation, replacement/marker clearing with stable paths and containing context, default/run/caller cancellation and independent waiters, and all seven outcome policies. Real process/socket/RPC cases prove peers are awaited and per-test timeout/cancellation does not stop the host. CLI cases cover failure `23`, keep-alive, explicit cancellation/deadlines, truthful totals/specific outcomes, partial reporting, stdout purity, rendering/escaping/no-color, and ordinary-run regressions. Limits: the packaged CLI E2E cases do not exercise Ctrl+C, deadline expiry or keep-alive; those remain focused host/CLI test coverage. Local cross-OS native-AOT archive creation was blocked by missing native toolchain support, so local E2E validation used CI-built Linux artifacts rather than a fabricated local payload. No full local repository build, Windows packaged E2E execution, framework implementations/mappings, visual-rendering recording, API review, or threat-model/security review. The previous ordinary-run smoke remains historical evidence; this revision reran ordinary-run regression tests, not that manual scenario. ### Context and dependencies Informed by closed historical proposals [#18428](https://github.com/microsoft/aspire/pull/18428) and [#13275](https://github.com/microsoft/aspire/pull/13275), without claiming to fix them or implement their entire designs. The AppHost/CLI reporting contract remains `test-reporting.v1`; incompatible AppHosts fail explicitly. Framework integrations and dashboard work are separate stacked follow-ups. Fixes # (issue) ## 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? - [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? - [x] Yes - [ ] 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 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 16f52aeb · 2026-11-26
- 6.9ETVAdd directory and Git template engine support to aspire new (#21263) ## Description Let template authors use unpacked .NET templates from a local directory or Git without publishing a package or requiring the .NET SDK. `aspire new --template-path <directory>` loads a local template package. With `--template-repository <url>`, the path is repository-relative and defaults to the repository root. `--template-repository-ref` selects a branch, tag, or full commit SHA; omitting it selects the remote `HEAD`. Named refs are resolved before cache creation. Successful checkouts are retained under `~/.aspire/cache/templates/`, keyed by repository, normalized template path, and effective commit SHA. Different refs for the same commit share an entry, and moved branches/tags select a new entry. Cache misses fetch the exact SHA with depth one and check it out detached. Complete checkouts are published atomically; failed/canceled downloads and concurrent losing checkouts are cleaned up without deleting retained entries. Engine-backed templates implement `ITemplateFactory` and participate in `ITemplateProvider` discovery. Built-in factories retain their normal behavior when no custom source is supplied. Metadata drives text, Boolean, single-choice, and multiple-choice prompts; the engine handles defaults, generated symbols, conditional content, and renames. Git execution is isolated behind `Aspire.Cli.Git.IGitRunner`, backed by `IProcessExecutionFactory`. The engine uses an isolated virtual hive and explicit built-in components, without modifying `dotnet new` installations. A declared `AspireVersion` parameter receives the CLI's identity-aware package version, retaining PR/prerelease suffixes and stripping SemVer build metadata. Scope and limitations: - Git metadata is kept outside the template tree so root templates do not copy repository history/configuration into generated projects. - Git is required for named-ref resolution and uncached downloads. An unqualified branch takes precedence over a same-named tag; `refs/tags/name` selects that tag explicitly. - Full commit SHAs are supported; abbreviated SHAs, submodules, repository catalogs, and automatic cache eviction are not included. - Template post-actions, including restore and scripts, are not executed. - Non-interactive generation uses well-known values and engine defaults; other custom values currently require interactive prompts. - Non-empty output directories and conflicting built-in template/package options are rejected. Normal optional agent initialization and editor-opening behavior are preserved. ### User-facing usage ```bash aspire new --template-path ./my-template aspire new --template-path /absolute/path/to/my-template --name MyApp --output ./MyApp --suppress-agent-init aspire new --template-repository https://github.com/example/templates.git --template-path templates/my-template aspire new --template-repository https://github.com/example/templates.git --template-path templates/my-template --template-repository-ref v1.0 aspire new --template-repository git@github.com:example/templates.git --template-path templates/my-template --template-repository-ref feature/templates --name MyApp --output ./MyApp ``` The selected directory contains `.template.config/template.json`, directly or beneath template subdirectories. Multiple templates prompt for a selection. New options in `aspire new --help`: ```text --template-path <template-path> Path to an unpacked .NET template package directory (relative to the repository when --template-repository is specified) --template-repository <template-repository> Clone a Git repository containing templates; --template-path is relative to its root --template-repository-ref <template-repository-ref> Template repository branch, tag, or full commit SHA (requires --template-repository; defaults to the remote HEAD) ``` ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - If you cannot capture visuals now, note what scenario to test and mark this section as TODO. TODO: Capture metadata-driven text, Boolean, single-choice, and multiple-choice prompts, plus repository resolution/cloning. Native interactive prompts were exercised earlier, but a recording has not been attached. <!-- Add screenshots/recordings here --> ### Validation Passed: 451 tests, zero failures or skips. ```bash dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.NewCommand*' --filter-class 'Aspire.Cli.Tests.Templating.*' --filter-class '*.GitRunnerTests' --filter-class '*.InitCommandTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` Coverage includes real Git root/nested templates, relative paths and file URLs with spaces, branch/default HEAD/lightweight tag/annotated tag/full SHA selection, moved branches, depth-one checkouts, generated-output snapshots, cross-invocation reuse, normalized paths, repository/path/SHA cache isolation, concurrent publication, ref/clone failures, partial-download cancellation, traversal/symlink rejection, option validation, provider/factory integration, and automatic version injection. Passed: localized resources regenerated, zero warnings/errors. ```bash dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj --nologo -v:minimal ``` Passed: macOS ARM64 Native AOT publication. ```bash dotnet publish src/Aspire.Cli/Aspire.Cli.csproj -c Release -r osx-arm64 --nologo -v:minimal ``` Passed: the published native executable generated projects from a branch, annotated tag, and full SHA in an isolated local Git fixture. Verified exact file lists and JSON, automatic `AspireVersion` injection, a single retained shared cache entry, and a SHA cache hit with Git absent from `PATH`. Native publication retains existing local Xcode/debug-symbol warnings. Cross-platform CI for the latest update has not yet been verified. ### Security considerations This command reads user-selected template content, invokes Git for repository sources, writes retained checkouts to the user's cache, and generates output files. Git runs through `IProcessExecutionFactory` with argument arrays and option terminators, preserving normal authentication configuration; terminal credential prompts are disabled in non-interactive mode. Repository-relative selection rejects absolute paths, traversal outside the checkout, and symbolic-link traversal. Ref resolution precedes cache creation, downloads use the resolved SHA rather than a movable name, and checkout identity is verified before publication. Cache keys use a non-cryptographic hash of repository/path/SHA for directory naming, not a security guarantee. Incomplete entries are not published. Depth-one fetches do not hard-link source Git objects, and temporary cleanup avoids following symlinks and logs failures. Security review should confirm template-engine file/path handling, Git invocation/authentication behavior, and retained-cache processing boundaries. Templates are not a sandbox: only use trusted sources. Post-actions are not executed and non-empty output directories are rejected. Normal optional agent initialization is separate and can be suppressed. Fixes # (issue) ## 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: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com> Copilot-Session: 09ce6df6-278d-4767-b21f-144abe4c9997github.com-microsoft-aspire · f990a901 · 2026-10-26
- 4.8ETVManage and search global template sources in the CLI (#21329) ## Description Add named global template sources so users can discover reusable templates from **local directories and Git repositories**. HTTP catalogs, searchable endpoints, substitutions, and pagination have been removed from this PR to keep the scope focused. Interactive `aspire new` retains the built-in template list and adds **Search for more templates** when global sources are configured and compatible command options are used. Searches match short names, display names, and actual `template.json` descriptions case-insensitively; an empty search lists everything. Results show the configured source name. Users can search again or return to built-in templates. Validly configured sources that fail discovery warn independently so healthy sources remain usable; malformed configuration fails through normal command error handling rather than being silently skipped. Sources use **objects only**, registered under the global `templateSources` key. `aspire template source add`, `remove`, and `list` manage global configuration. Add and configuration editing share typed validation. Unknown source fields are ignored when reading configuration for compatibility with newer CLI versions, and edits to known fields preserve existing unknown fields. Source names are compared case-insensitively using the shared source-name comparer. Source-management commands require modern `aspire.config.json`; legacy-only configuration reports an error directing users to `aspire config info` to migrate it. No template-specific legacy migration is added. `source list` uses bold table headers and dashes for empty cells. `source list --format json` writes a sorted object keyed by source name to stdout, preserving configured fields without adding defaults. It includes incomplete definitions without discovering templates or contacting repositories. Configuration edits require the existing lock and publish validated edits atomically; rejected operations preserve configuration bytes. Configured Git sources reuse existing ref resolution, commit-keyed checkouts, path validation, parameter prompts, and generation. Template-engine sessions are cached by concrete directory for the CLI invocation, so aliases share discovery without losing source labels. Git ref changes create a new checkout/session while already selected templates remain pinned. Existing explicit `--template-path`, `--template-repository`, and `--template-repository-ref` options remain unchanged. No external dependencies were added. Disabling built-in templates is deferred. Source-qualified naming is tracked separately in #21363. ### User-facing usage ```bash aspire template source add company --path /absolute/path/to/company-templates aspire template source add examples --repository https://github.com/microsoft/aspire-templates aspire template source add release --repository https://github.com/microsoft/aspire-templates --ref release/17.0 --path templates aspire template source remove examples aspire template source list aspire template source list --format json aspire template source add --help aspire template source list --help aspire new ``` Global `~/.aspire/aspire.config.json`: ```json { "templateSources": { "company": { "path": "/absolute/path/to/company-templates" }, "release": { "repository": "https://github.com/microsoft/aspire-templates", "ref": "release/17.0", "path": "templates" } } } ``` Use absolute local paths. Git `repository` accepts HTTPS/SSH URLs; omitted `ref`/`path` mean `HEAD`/`.`. SCP shorthand and embedded credentials are not accepted. Source names cannot contain dots, colons, or control characters. Project-level `templateSources` settings are not used. Help/default template selection do not discover sources. Configured templates cannot be combined with `--source`, `--version`, `--channel`, or `--language`. Example `source list --format json` output for one local source: ```json { "company": { "path": "/absolute/path/to/company-templates" } } ``` ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - If you cannot capture visuals now, note what scenario to test and mark this section as TODO. TODO: Attach a reviewer-facing recording of source add/list/remove and `aspire new` → **Search for more templates** → query → source-labelled results → template parameter prompts. The terminal E2E scenario passed and records locally; no public recording is attached. Retry/back navigation, Git progress, and unavailable-source warnings also merit demonstration. <!-- Add screenshots/recordings here --> ### Validation - `./restore.sh` — passed earlier in this session. - `dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj` — passed; CLI XLF files regenerated after catalog removal and again after the `templateSources` rename. - `MSBUILDTERMINALLOGGER=false FORCE_COLOR=1 dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.TemplateSourceStartupTests' --filter-class '*.AspireConfigFileTests' --filter-class '*.ConfigurationServiceTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-class '*.NewCommandTests' --filter-class '*.DotNetTemplateFactoryTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed on a0925cab2a: **668 passed, 5 skipped**, no failures. Covers the global-key rename, forward-compatible loading, preservation of unknown fields during edits, and existing malformed/invalid-value failures. - `dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.NewCommandTests' --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.NewCommandTemplateConfigPersistenceTests' --filter-class '*.DotNetTemplateFactoryTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-class '*.ConfigCommandTests' --filter-class '*.ConfigurationServiceTests' --filter-class '*.ConfigurationHelperTests' --filter-class '*.AspireConfigFileTests' --filter-class '*.TemplateSourceStartupTests' --filter-class '*.RootCommandTests' --filter-class '*.CompletionsCommandTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed before the final naming/compatibility follow-up: **1,100 passed, 6 skipped**, no failures. - `dotnet publish src/Aspire.Cli/Aspire.Cli.csproj -c Debug -r linux-arm64 --self-contained /p:PublishAot=false /p:BundlePayloadPath="$PWD/artifacts/bundle/aspire-17.0.0-local.20261020.t031859-linux-arm64.tar.gz" -o "$PWD/artifacts/pr21329-ci/catalog-removal-hive/bin"` — passed before the final naming/compatibility follow-up; published the Linux CLI into an existing isolated test hive. - `tar -czf artifacts/pr21329-ci/catalog-removal-e2e.tar.gz -C artifacts/pr21329-ci/catalog-removal-hive .` — passed; repackaged the hive. - `ASPIRE_E2E_ARCHIVE="$PWD/artifacts/pr21329-ci/catalog-removal-e2e.tar.gz" dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method '*.ConfiguredTemplateSourceCommandsAndSearchWithoutDotNetSdk' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, **1 terminal E2E test**, before the final naming/compatibility follow-up. Exercises source add/list/remove, table/JSON output, rejected edits without byte changes, local/Git search, description-only case-insensitive search, retry/back navigation, and actual template prompts/output without a .NET SDK in the container. Not rerun locally for a0925cab2a. - `git diff --check` — passed before commit. The full `./localhive.sh` packaging attempt was blocked by missing host `pwsh` in unrelated npm packaging. Reusing the existing hive and publishing the CLI enabled terminal validation without changing dependencies or build scripts. Native AOT publishing and live authenticated remote repositories were not validated locally. CI for the latest pushed commit is being monitored; the preceding commit reached green after a macOS retry for the recurring test-host hangs tracked in #21259 and #21335. ### Security considerations Users must trust configured directories, repositories, and templates; this is not a sandbox for untrusted templates. Configured Git repositories may be resolved/fetched during search. Existing non-interactive Git acquisition, sanitized failures, immutable checkouts, pre-fetch traversal checks, and post-checkout symlink checks are reused. HTTP catalog requests are not part of this change. Source add/remove and config set/delete require the configuration lock and publish validated edits atomically. Rejected edits preserve original bytes. Invalid known-field types, conflicting locations, escaping repository paths, and edits to unknown source fields are rejected. Existing unknown source fields are allowed for forward compatibility. Only explicitly selected templates are generated. No threat model or security review has been performed for this spike. ## 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: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ac380eac-c60d-4f83-9ad8-0416e791cdbagithub.com-microsoft-aspire · 84881cc5 · 2026-10-29
- 4.7ETVCentralize temporary storage allocation behind an internal helper (#22553) ## Description Centralize temporary storage allocation behind a source-linked internal `ITemporaryStorage` service so the allocation boundary can be maintained consistently. Existing temporary locations and allocation semantics remain unchanged. - Route production callers through the service, provided via dependency injection where available, including Aspire.Hosting's filesystem service without changing its public API. - Hosting integrations (Dotnet, Kubernetes, Radius, MSBuild response files) now allocate through `IFileSystemService`, so their temporary directories are tracked and cleaned up consistently and honor `ASPIRE_PRESERVE_TEMP_FILES`. - `ASPIRE_PRESERVE_TEMP_FILES` now requires a truthy value (`true` or a non-zero number); unset, empty, `false`, or `0` leave cleanup enabled. - Enforce the boundary with the development-only Banned API analyzer. - Include the analyzer configuration in test-selection routing. Follow-up PRs will build on this internal boundary. Validation on macOS: - Full build with analyzers enabled, with native AOT skipped: passed with no warnings or errors. - Analyzer tests: 5 passed. - Test-selection routing tests: 389 passed. - CLI tests: 50 passed, 1 skipped. - Hosting filesystem tests: 29 passed. 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: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 2d131060 · 2026-11-25
- 3.5ETVUpgrade Hex1b and improve dashboard terminal navigation and metadata (#20255) ## Description Upgrade the Aspire Dashboard terminal integration to **Hex1b 0.171.0** across NuGet, npm, tool/MCP pins, and vendored web assets. The deployed assets are one bundled client-and-workers JavaScript file, one font, and two licenses. Hex1b's built-in canvas **overlay** scrollbar shows retained command marks over terminal content without a native gutter. The 0.171 producer retains up to **200 command marks** even if older backing text remains in scrollback; older marks are evicted first. The palette-derived scrollbar track is explicitly configured to preserve its appearance when using 0.171. The terminal header shows workload title, working directory, and progress. The full title/directory can be copied, with screen-reader announcements for copy success/failure. Long paths compact without losing a UNC server/share authority. Percentages appear in tooltips; the icon slot shows a progress ring while active and a resource/terminal icon otherwise. Dock tabs retain their creation-time titles and support drag/drop and keyboard reordering, horizontal scrolling, navigation controls, an insertion line, and an overflow fade. The terminal frame has a 1px border and 12px content padding (chromeless dock/window views keep their borderless, unpadded presentation). The footer has compact Fluent font/sizing controls and visible, associated Size and Palette labels; its controls wrap at narrow widths rather than clipping the palette selector. **Palette behavior:** The terminal footer has an explicit **Dark / Light** palette selector. The browser-stored terminal palette defaults to Dark and is independent of the Dashboard theme. Changing Dashboard theme in Settings changes the surrounding chrome, **not** the selected terminal palette. Changing the terminal palette recolors content and markers without reconnecting. A former `dashboard` preference migrates to Dark; forced-colors mode uses system scrollbar colors. https://github.com/user-attachments/assets/9355df7b-9ef3-4ad1-9b94-bf9e49681e9f ### User-facing usage ```bash ./dotnet.sh build src/Aspire.Managed alias aspire="$PWD/run-aspire.sh" aspire run --project playground/Terminals ``` Open the `terminal-features` resource's Terminal view. Drag the scrollbar thumb or select a command mark to navigate history; click the title/directory to copy its full value. Use the **Palette** dropdown in the footer to switch Dark/Light. The Settings theme controls Dashboard chrome separately. ### Validation - **Current 0.171.0:** All three NuGet packages were available from approved `dotnet-public` (GET 200); the npm package was published. Restore with only approved package feeds succeeded with zero errors (52 pre-existing package-audit warnings). The four-file browser acquisition verified against the published npm package. Dashboard JavaScript tests passed **197/197**; focused NuGet configuration **3/3**, Hosting terminal **82/82**, TerminalHost **51/51**, and Dashboard terminal/dock component **115/115** tests passed. Dashboard and Playwright dependency builds passed without warnings. - **Styling follow-up:** Regenerated the Dashboard XLF files, built the Dashboard integration host without warnings, and passed focused terminal component tests **40/40** and JavaScript regression tests **126/126**. Edge/WebGL2 exercised the resource and detached-window footers at 1200px and 420px in both Dashboard themes: font changes, size selection, fit, and popup interaction passed. The narrow footer no longer clips its controls. Fluent's dropdown shadow control enforces a 160px minimum width, so these controls retain that width and wrap at narrow widths instead of becoming smaller. - **Current real-browser check:** Edge/macOS with WebGL2 and WebGPU connected to a real 0.171.0 HMP/HWT producer. Both backends passed overlay/no gutter, wheel, thumb drag, marker details/tooltip/click navigation, reconnect with retained marks, read-only output/selection, input after read-only, both same-origin workers, font loading, and disposal. The browser captured light/dark and forced-color screenshots; the separate palette/resource harness passed theme transitions, palette input and link worker before its final unrelated dock step timed out waiting for the outdated `Toggle terminal` button selector. That full palette/dock harness was therefore **not** validated to completion. The focused JS palette renderer test verifies dark/light track colors and forced/more-contrast opacity. The full repository suite, non-Edge browsers, packaged Dashboard under PathBase, and internal pipeline were not run. - **Historical 0.170.0 (not the pinned package):** Earlier test counts and theme-following browser results were for a different build and do not validate 0.171.0. `TerminalTitle.test.mjs` and `TerminalDock.test.mjs` run in regular CI through Infrastructure.Tests. ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - If you cannot capture visuals now, note what scenario to test and mark this section as TODO. TODO: Attach light/dark resource and detached-terminal screenshots and a short scrollbar/header recording. Local browser captures exist; reproduce with `terminal-features` above. <!-- Add screenshots/recordings here --> ### Security considerations Workload-supplied titles, paths, and command-mark text are untrusted. They remain text rather than HTML or navigable links; copying preserves the original text. Both embedded workers load from the same-origin vendored module without Blob workers or eval. Existing terminal authentication, input authority, and read-only gates remain in place. NuGet packages restore from approved internal feeds; no public NuGet package source is configured. 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? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com> Copilot-Session: 6bb79b75-08ac-4fcb-a432-921948a3a205github.com-microsoft-aspire · d7087656 · 2026-10-01
- 2.3ETVSet local socket directory and endpoint permissions consistently (#20330) ## Description Use a shared helper to set directory permissions before binding backchannel, DCP, and terminal sockets, and endpoint permissions before listening. Configure the Hex1b PTY socket directory through its existing environment variable. Adds platform-specific coverage and documentation. Windows runtime validation and replacing the Hex1b environment-variable workaround remain follow-ups. Fixes # (issue) ## 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: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1aa4cc4c-c8da-4e89-8075-35885a2fc3fdgithub.com-microsoft-aspire · c1c5a54a · 2026-09-24
- 2.2ETVInherit template sources from explicit init configuration (#21388) ## Description Enterprises can distribute template sources through their existing init-config repository without asking each developer to register those sources globally. This follows the template-source commands merged in #21329. When `ASPIRE_INIT_SOURCE_URL` is explicitly set, interactive `aspire new` search combines that repository's `templateSources` with the user's global sources. Source listing has a separate consent contract: - Human-readable `aspire template source list` uses the same candidate selection and consent prompt as `aspire new`. Accepting includes inherited sources; declining lists only global definitions. An employee-detected candidate can be offered through this consent flow. Non-interactive listing with an available candidate requires `--use-config-source` to accept or `--use-config-source false` to decline. - `aspire template source list --format json` never prompts and defaults to global-only output without resolving, validating, or fetching an init source. Add `--use-config-source` to acquire and include inherited definitions; Git authentication is unattended and diagnostics remain on stderr. - On every command exposing it (`new`, `init`, and template-source listing), bare `--use-config-source` means `true`. Explicit `true`/`false` values remain accepted for compatibility. Omitting the option retains nullable, unspecified consent rather than silently opting in. - Global aliases win case-insensitively as **complete definitions**, without inheriting repository/ref/path fields from an overridden source. - Non-colliding sources coexist, including branch-pinned Git sources and personal local-directory sources. - Inherited sources are runtime-only: they are never written to user or project configuration. Project-level template sources remain ignored, and listing never materializes project files. - Add/remove continue editing only global definitions. Removing a global override reveals the inherited source again when inheritance is enabled. - Existing project-materialization consent remains unchanged. For template discovery/search, an explicit environment URL authorizes runtime template-config acquisition; employee detection alone does not enable discovery inheritance. The implementation reuses init-config validation, Git authentication, cancellation, timeout, and immutable snapshot acquisition. Search and opted-in listing share collision behavior, and repeated reads reuse the invocation's snapshot. Attempted source acquisition failures remain explicit rather than returning a successful global-only result. ### User-facing usage For an init repository containing: ```json { "templateSources": { "enterprise": { "repository": "https://git.acme.example/platform/templates", "ref": "template-preview", "path": "templates" } } } ``` ```bash export ASPIRE_INIT_SOURCE_URL=https://git.acme.example/platform/aspire-init export ASPIRE_INIT_SOURCE_REF=config-preview # Global-only JSON; no init-source acquisition or consent prompt. aspire template source list --format json # Include inherited sources without prompting. aspire template source list --format json --use-config-source # Prompt whether to include the proposed configuration source. aspire template source list aspire new # Skip source consent with a bare opt-in on new/init as well. aspire new aspire-starter --use-config-source aspire init --use-config-source ``` The existing **Search for more templates** flow searches both enterprise and personal global sources. Unsetting `ASPIRE_INIT_SOURCE_URL` removes the explicit inherited source from subsequent invocations; human-readable listing may still offer an employee-detected candidate through its normal consent flow. ### Security considerations An explicitly set environment variable authorizes fetching template configuration during discovery/search without another consent prompt. Listing instead requires consent: human-readable output prompts when unspecified, while JSON requires explicit `--use-config-source` (or its compatible `true` form). Acquisition can make outbound Git connections and publish snapshots under Aspire home using the existing source-validation, authentication, timeout, locking, and cache infrastructure. JSON opt-in disables interactive Git authentication. Only `templateSources` is overlaid, and project-file materialization still requires its existing consent. No separate threat model or security review has been performed. ### Validation Passed after the bare-flag change: **782 tests**, **0 skipped**, **0 failures**: ```bash MSBUILDTERMINALLOGGER=false DiffEngine_Disabled=true \ dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \ --filter-class '*.NewCommandLocalTemplateTests' \ --filter-class '*.ConfigSourceServiceTests' \ --filter-class '*.ConfigSourceCommandTests' \ --filter-class '*.InitCommandTests' \ --filter-class '*.TemplateSourceStartupTests' \ --filter-not-trait 'quarantined=true' \ --filter-not-trait 'outerloop=true' ``` Final parser validation passed **9 tests** after removing an unnecessary async test signature: ```bash MSBUILDTERMINALLOGGER=false DiffEngine_Disabled=true \ dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \ --filter-method '*.TemplateSourceList_ConfigSourceOption*' \ --filter-not-trait 'quarantined=true' \ --filter-not-trait 'outerloop=true' ``` Passed: `MSBUILDTERMINALLOGGER=false dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj --no-restore -v:quiet` and `git diff --check`. Passed: `MSBUILDTERMINALLOGGER=false dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-restore -v:quiet` with 0 warnings/errors. Existing E2E helper invocations now use the bare flag; the Linux-only Docker E2E suite was not executed locally. Behavioral command-invocation tests cover interactive accept/decline, omitted/bare/explicit true/false options, invalid values, following-option parsing, JSON no-prompt/no-fetch defaults, non-interactive consent, absent/detected candidates, alias precedence, preserved refs, output snapshots, and unchanged configuration files. `new` and `init` materialization tests now exercise bare acceptance. An isolated actual-CLI proof against a generic local Git fixture verified bare opt-in before/after `--format json`, compatible explicit/inline true, global-plus-inherited parseable JSON, ref/path preservation, unchanged settings, default/false no-fetch behavior, help on all three commands, invalid Boolean rejection, and bare new/init selecting the source without consuming subsequent options. Earlier real authenticated remote init/template proof covered combined interactive search, generation, overrides, non-persistence, environment removal, and unavailable-ref failure. Private fixture contents and screenshots are not included in this public PR. The full repository suite was not run. 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? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-aspire · 262105cc · 2026-11-01
- 2.1ETVMake AKS node pool OS SKU configurable (#21118) ## Description Allow AppHosts to select an AKS node pool OS SKU, such as `AzureLinux`, without editing generated Bicep that deployment later regenerates. Use a single `AksNodePoolConfig` type for `WithSystemNodePool` and `AddNodePool` callbacks and the stored app model. VM size, autoscaling counts, and OS SKU remain mutable so extensions can compose changes through the retained configuration or `workers.Resource.Config`. Validate final values when applying them to Bicep agent pool profiles, rather than copying or freezing configuration after the callback. Subsequent mutations do not change artifacts already generated; regenerating uses the current model values. `OsSku` is part of the configuration constructor alongside the other pool properties. An unset SKU remains omitted from Bicep, preserving existing AKS defaults. Existing parameter-based C# overloads remain supported. Configuration callbacks use `[AspireDto]` writeback, so polyglot consumers configure local data instead of invoking remote property setters. Include the shared DTO wire-name, Python callback writeback, and integral-number conversion fixes these callbacks require. Regenerate affected snapshots and align existing Python DTO fixtures with the camel-case wire names. This PR targets `main` directly and has no terminal-feature dependency. Terminal APIs, documentation, tests, and generated terminal method signatures are unchanged. The TypeScript AKS deployment scenario now selects `AzureLinux` for both system and workload pools and verifies their deployed OS SKUs after initial deployment and redeployment. ### User-facing usage C# AppHost: ```csharp var aks = builder.AddAzureKubernetesEnvironment("aks") .WithSystemNodePool(pool => { pool.OsSku = "AzureLinux"; }); var workers = aks.AddNodePool("workers", pool => { pool.MinCount = 0; pool.MaxCount = 5; pool.OsSku = "AzureLinux"; }); ``` TypeScript AppHost: ```typescript const aks = await builder.addAzureKubernetesEnvironment("aks"); await aks.withSystemNodePool(async pool => { pool.osSku = "AzureLinux"; }); const workers = await aks.addNodePool("workers", async pool => { pool.minCount = 0; pool.maxCount = 5; pool.osSku = "AzureLinux"; }); ``` ### Breaking changes Polyglot node-pool configuration in this preview integration now uses callbacks instead of scalar options objects or keyword arguments. For example, replace `aks.addNodePool("workers", { minCount: 0 })` with `aks.addNodePool("workers", async pool => { pool.minCount = 0; })`. Java and Python consumers likewise pass a configuration callback. Existing parameter-based C# calls and default behavior are unchanged. The preview `AksNodePoolConfig` positional constructor gains `OsSku`, and its VM size, counts, and OS SKU properties are mutable. Python DTO dictionary keys now consistently use camel case to match the host's JSON payloads, for example `pool["osSku"]`. Go, Java, and Rust DTO serialization likewise uses those wire names. ### Validation The latest mutable-configuration change reran AKS, TypeScript codegen, Python codegen, and the deployment project build. AKS coverage includes retained-reference composition, correcting temporarily invalid configuration before generation, rejecting invalid final values, and mutations between Bicep generations. Regenerated and reviewed the affected snapshots. The other codegen and RemoteHost suites below passed earlier for the unchanged shared DTO fixes. - `dotnet test --project tests/Aspire.Hosting.Azure.Kubernetes.Tests/Aspire.Hosting.Azure.Kubernetes.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 152 tests. - `dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-class '*.AtsTypeScriptCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 136 tests. - `dotnet test --project tests/Aspire.Hosting.CodeGeneration.Python.Tests/Aspire.Hosting.CodeGeneration.Python.Tests.csproj --no-launch-profile -- --filter-class '*.AtsPythonCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 29 tests, including generated AKS DTO callback writeback. Used Python 3.14 on `PATH`. - `dotnet test --project tests/Aspire.Hosting.CodeGeneration.Java.Tests/Aspire.Hosting.CodeGeneration.Java.Tests.csproj --no-launch-profile -- --filter-class '*.AtsJavaCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 60 tests. Used a temporary JDK 21. - `dotnet test --project tests/Aspire.Hosting.CodeGeneration.Go.Tests/Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-class '*.AtsGoCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 33 tests. - `dotnet test --project tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Aspire.Hosting.CodeGeneration.Rust.Tests.csproj --no-launch-profile -- --filter-class '*.AtsRustCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 20 tests. - `dotnet test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-class '*.AtsMarshallerTests' --filter-class '*.CallbackProxyTests' --filter-class '*.CapabilityDispatcherTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed: 274 tests, including integral DTO writeback and invalid-number rejection. - `dotnet build tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj --no-restore --verbosity quiet /p:SkipNativeBuild=true` — passed, zero warnings or errors. - `git diff --check` — passed. - Audited regenerated snapshots: terminal method signatures remain unchanged in all five languages. - Azure deployment E2E execution and full Docker-based polyglot fixture validation were not run locally. Fixes #18284 ## 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? - [x] Yes - [ ] No - [ ] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97github.com-microsoft-aspire · 6e2ac467 · 2026-10-20
- 2.1ETVFix AKS AcrPull for existing cross-resource-group registries (#20919) ## Description Fixes #18277. AKS can now pull application images from an existing ACR in another resource group or subscription using role assignments at the actual registry scope. No new public API or dependency is introduced. Following review feedback, the cluster now uses separate pre-created user-assigned identities for the control plane and kubelets. Standard Azure role preparation grants kubelet `AcrPull` on the selected registry and control-plane `Managed Identity Operator` on the kubelet identity. For environment and node-pool `WithSubnet` selections, the control plane receives `Network Contributor` on the selected virtual networks. AKS manages its normal control-plane permissions in the node resource group. The assignments precede cluster creation in both Aspire's deployment pipeline and generated `main.bicep`. Registry selection is resolved after model configuration, preparation is idempotent, excluded environments create no identities, and explicit resource scopes take precedence over existing-resource annotation scopes. Both identities inherit the cluster's final deployment scope, including scope selected through infrastructure callbacks. AKS-specific security remarks were moved out of generic `AsExisting` documentation into the AKS README. ### User-facing usage C#: ```csharp var registry = builder.AddAzureContainerRegistry("registry") .PublishAsExisting("myregistry", "registry-resource-group"); builder.AddAzureKubernetesEnvironment("aks") .WithContainerRegistry(registry); ``` TypeScript: ```typescript const registry = await builder.addAzureContainerRegistry("registry"); await registry.publishAsExisting("myregistry", { resourceGroup: "registry-resource-group" }); const aks = await builder.addAzureKubernetesEnvironment("aks"); await aks.withContainerRegistry(registry); ``` ### Breaking changes Existing AKS deployments transition from a system-assigned control-plane identity and AKS-created kubelet identity to the new user-assigned identities. Kubelet identity changes can upgrade node pools and disrupt workloads; schedule the migration appropriately. Custom permissions are not transferred automatically, and the control plane can continue using its previous identity while cached tokens expire. The README describes the migration and required permission handling. Existing-cluster migration has not been live-validated. ### Security considerations Only the kubelet identity receives registry `AcrPull`; the control-plane identity does not receive registry access. No ACR administrator credentials or image-pull secrets are introduced. `AcrPull` is registry-wide and requires RBAC Registry Permissions mode, not ABAC Repository Permissions mode. A separate kubelet UAMI does not isolate its IMDS tokens from workloads; Workload Identity alone does not block this access. External registry role assignments still require separate cleanup after `aspire destroy`. Additional customized external networking/DNS resources require corresponding control-plane permissions. Formal security review has not been performed. ### Validation - `dotnet test --project tests/Aspire.Hosting.Azure.Kubernetes.Tests/Aspire.Hosting.Azure.Kubernetes.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — **124 passed** at `833f64395c`, including final cluster-scope inheritance coverage. - `dotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — **1,946 passed, 5 skipped** at `693435bb65`. - `dotnet build tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj --no-restore --verbosity quiet` — **passed**, no warnings or errors, after the final scope correction. - Generated literal cross-group and parameterized cross-subscription `main.bicep` templates compiled with Azure CLI Bicep. The new complete scoped-cluster snapshot bundles also compiled using `az bicep build --file <bundle>/main.bicep` for both literal and parameter-valued cluster scopes. Only unused standard provisioning-parameter warnings were reported. Cross-subscription behavior and custom cluster scope have artifact coverage, not live deployment coverage. - [Azure E2E run 38328663624](https://github.com/microsoft/aspire/actions/runs/38328663624) — **failed before deployment**: the generated AppHost omitted suppression of `ASPIREAZURE003` for experimental Azure networking APIs. Commit `e499003d6b` adds the suppression and an explicit AppHost build so compilation failures fail promptly. - [Azure E2E run 38333538328](https://github.com/microsoft/aspire/actions/runs/38333538328) at `e499003d6b` — **passed**. Downloaded TRX confirms the deployment scenario executed and passed in 12m46s. - The E2E uses an external private ACR and a custom VNet, checks the complete direct role sets for both identities (including AKS-managed node-group Contributor), verifies private-image pulls and an HTTP response, repeats deployment to verify identity and assignment stability, then destroys the application and confirms the external registry survives before final cleanup. - `gh workflow run deployment-tests.yml --repo microsoft/aspire --ref mitchdenny-aks-cross-group-acr -f pr_number=20919 -f test_filter=AksCrossResourceGroupRegistryDeploymentTests` — **passed at `833f64395c`**: [Azure E2E run 38336886787](https://github.com/microsoft/aspire/actions/runs/38336886787). Downloaded TRX confirms the actual deployment test passed in 12m11s, including repeat deployment and resource-group cleanup. - `gh workflow run deployment-tests.yml --repo microsoft/aspire --ref mitchdenny-aks-cross-group-acr -f pr_number=20919` — **completed, overall failed at current head `100128e96e`**: [Full deployment E2E run 38339704524](https://github.com/microsoft/aspire/actions/runs/38339704524). All 54 deployment matrix jobs ran; 53 jobs succeeded and one failed. Downloaded and inspected every job's TRX: **60 tests passed, 1 failed, 1 skipped**, with no missing result files. All AKS, ACA, scoped-resource, and run-mode role-assignment scenarios passed. - The sole failure is [FoundryDotnetProjectDeploymentTests](https://github.com/microsoft/aspire/actions/runs/38339704524/job/115110296137): deployment, hosted agent version checks, and published image verification succeeded, but constructing the response client at `FoundryDotnetProjectDeploymentTests.cs:117` threw `MissingMethodException` for `OpenAI.Responses.ResponsesClient(ClientPipeline, OpenAIClientOptions)` from `Azure.AI.Extensions.OpenAI.ProjectResponsesClient`. This is an SDK binary-compatibility failure after provisioning; the Foundry test and dependency manifests are unchanged by this PR. It has not been fixed or rerun here. - `AzureConnectorNamespaceDeploymentTests` was skipped by its existing environment gate: the deployment environment lacks required Connector Namespace preview enrollment. The job ran successfully but did not execute the deployment scenario. - [Run 38217840141](https://github.com/microsoft/aspire/actions/runs/38217840141) passed for the earlier scoped-role spike; it does **not** validate this UAMI refactor. ## 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: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa93f73f-c514-4794-8eb1-6522875bf176 Copilot-Session: f6a8304a-349b-41cd-bcec-df6067d5aed2 Copilot-Session: 6333f233-bc1e-40b6-9027-33458e305c41 Copilot-Session: de26b94e-818b-43a7-ae02-6f6be2ddca94github.com-microsoft-aspire · 7d8db57e · 2026-10-16