Skip to content

Automate version stabilization: dynamically compute package versions for Helix testing - #15681

Merged
Jose Perez Rodriguez (joperezr) merged 15 commits into
microsoft:mainfrom
joperezr:automate-helix-versions
May 21, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 15 commits into
microsoft:mainfrom
joperezr:automate-helix-versions

Conversation

@joperezr

@joperezr Jose Perez Rodriguez (joperezr) commented Mar 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Automates release stabilization. Going forward, stabilizing a release is a single-line change in eng/Versions.props (flipping StabilizePackageVersion to true) — no more hand-edits to Directory.Packages.Helix.props, no more dropping compute_version_suffix from ci.yml, no more [ActiveIssue] tags on KubernetesDeploy tests, no more SKIP lists in polyglot scripts.

Fixes #15335.

What changed

Dynamic version mechanism

  • src/Directory.Build.targets — extended the existing GetPackageName target''s docs (the target itself was already there, reused as-is for the Helix package-version computation).
  • tests/Shared/RepoTesting/Aspire.RepoTesting.targets — _GeneratePackagesVersionsProps now calls GetPackageName on every packable src/**/*.csproj, writes per-package versions into the generated Directory.Packages.Versions.props, and exposes $(AspireAppHostSdkVersion) for the SDK imports.
  • tests/Shared/RepoTesting/Directory.Packages.Helix.props — stripped from ~86 lines of hardcoded versions to a ~15-line shell.

PR-time vs stabilization-time decoupling (.github/workflows/ci.yml)

  • compute_version_suffix now appends /p:DotNetFinalVersionKind=prerelease so PR builds keep producing unique prerelease versions even when stabilization is later flipped on a release branch (otherwise Arcade''s release kind would silently drop the version suffix).
  • New Stabilization Check PR-only job that runs ./build.sh -pack /p:StabilizePackageVersion=true, runs the version/channel/template-pinning subset of Aspire.Cli.Tests under stabilization, and runs an aspire new aspire-empty + aspire restore smoke against the locally-built stable feed. Catches NU5104 and restore-against-stable regressions at PR time. Wired into Final Results needs: for branch protection.

Smoke script (eng/scripts/stabilization-smoke-init-restore.sh)

  • Source-mapped NuGet.config (Aspire* → local-stable, * → nuget.org).
  • --non-interactive + per-prompt suppression flags; absolute --output; env-var overrides for configuration + feed path; runnable locally.
  • Pins the exact Aspire.AppHost.Sdk version from the local feed, passes it to aspire new --version, and asserts the generated AppHost references that exact version before running restore — so a mismatch fails with a precise diagnosis instead of a confusing "not found in local-stable feed" restore error.

Validation

Stacked a do-not-merge PR (#17320, since closed) on top of this branch with the single-line StabilizePackageVersion=true flip. All historically-broken-on-stabilization lanes went green with no manual workarounds:

  • Hosting.Kubernetes + Hosting.Azure.Kubernetes (ubuntu + windows)
  • Polyglot SDK Validation — Rust, Go, Java, Python, TypeScript
  • All Templates-* lanes
  • Stabilization Check end-to-end (pack + CLI tests + smoke)

Empirically confirms the "one-line stabilization" claim.

Pros / cons of this model

Pros

  • Eliminates ~5 separate manual edits historically required for stabilization (and the mistakes that come with them).
  • New Stabilization Check job surfaces NU5104 (stable depending on preview) at PR time instead of at stabilization time, so integration owners learn about preview transitive deps when they introduce them — and can choose to flip SuppressFinalPackageVersion or chase the upstream to stabilize.
  • Helix package versions are always correct by construction — no per-release tax.

Cons

  • PR CI runs stable-pack twice (once for the regular build matrix, once for Stabilization Check). ~5 min added on the long pole. Worth it for the always-on signal.
  • Most PR tests still run against prerelease binaries. Version-label-sensitive CLI code is covered by the curated subset run under stabilization in the new job; broader backfill of parameterized version-shape theories is tracked in Backfill parameterized unit tests for version-label-sensitive CLI / acquisition code paths #17318 (out of scope here).
  • A future Arcade bump that moves PackageVersion into a target body would need a small fix to GetPackageName (documented inline).

Follow-ups

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes — Stabilization Check job exercises the mechanism end-to-end on every PR.
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@github-actions

github-actions Bot commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

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

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

Or

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

@joperezr

Copy link
Copy Markdown
Member Author

Ankit Jain (@radical) I'm running a couple of internal builds with Helix test runs to validate that these changes work as expected.

Jose Perez Rodriguez (joperezr) added a commit that referenced this pull request Apr 29, 2026
… gap

Two test buckets cannot run on a stabilized branch because they exercise NuGet
restore against Aspire.Hosting.* packages that have SuppressFinalPackageVersion=true
and therefore only ship as prerelease (e.g. 13.3.0-dev.<sha>) — but the stabilized
build asks for >= 13.3.0 stable.

Polyglot SDK Validation:
- Add 'Aspire.Hosting' to the skip list in test-typescript-playground.sh (it
  transitively depends on Aspire.Hosting.Azure.Kubernetes via aspire.config.json).
- Apply the same skip block to test-python-playground.sh and test-java-playground.sh
  (the 13.2 PR only updated the TypeScript script).

Cli.EndToEnd-KubernetesDeploy* (11 files):
- Mark each [Fact] with [ActiveIssue(#15335)]. The proper fix is the dynamic
  version computation tracked by #15335 (PR #15681). When that lands the
  ActiveIssue tags can be removed.

Co-authored-by: Copilot <[email protected]>
Jose Perez Rodriguez (joperezr) added a commit that referenced this pull request Apr 29, 2026
…6566)

* [release/13.3] Stabilizing builds in preparation for 13.3 release

- Flip StabilizePackageVersion default to true in eng/Versions.props
- Drop the compute_version_suffix step from ci.yml so PR builds use the stabilized version
- Pin Aspire.AppHost.Sdk import to 13.3.0 in RepoTesting.targets
- Pin all stabilizable Aspire packages to 13.3.0 in Directory.Packages.Helix.props
  (packages whose csproj sets SuppressFinalPackageVersion=true keep $(PackageVersion))
- Skip preview-only AppHosts (Kusto, Foundry, Keycloak, Kubernetes, Maui) in the
  TypeScript polyglot validation script (see #15335)

Co-authored-by: Copilot <[email protected]>

* [release/13.3] Skip tests blocked by suppressed-package stabilization gap

Two test buckets cannot run on a stabilized branch because they exercise NuGet
restore against Aspire.Hosting.* packages that have SuppressFinalPackageVersion=true
and therefore only ship as prerelease (e.g. 13.3.0-dev.<sha>) — but the stabilized
build asks for >= 13.3.0 stable.

Polyglot SDK Validation:
- Add 'Aspire.Hosting' to the skip list in test-typescript-playground.sh (it
  transitively depends on Aspire.Hosting.Azure.Kubernetes via aspire.config.json).
- Apply the same skip block to test-python-playground.sh and test-java-playground.sh
  (the 13.2 PR only updated the TypeScript script).

Cli.EndToEnd-KubernetesDeploy* (11 files):
- Mark each [Fact] with [ActiveIssue(#15335)]. The proper fix is the dynamic
  version computation tracked by #15335 (PR #15681). When that lands the
  ActiveIssue tags can be removed.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Jose Perez Rodriguez (joperezr) added a commit to joperezr/aspire that referenced this pull request May 20, 2026
…soft#15681

Throwaway validation PR: exercises CI by flipping the single knob that

the changes in microsoft#15681 claim should be the only edit required to stabilize

a release. No other files should change.

Co-authored-by: Copilot <[email protected]>
Jose Perez Rodriguez (joperezr) added a commit to joperezr/aspire that referenced this pull request May 20, 2026
…soft#15681

Throwaway validation PR: exercises CI by flipping the single knob that

the changes in microsoft#15681 claim should be the only edit required to stabilize

a release. No other files should change.

Co-authored-by: Copilot <[email protected]>
Jose Perez Rodriguez (joperezr) added a commit to joperezr/aspire that referenced this pull request May 20, 2026
…soft#15681

Throwaway validation PR: exercises CI by flipping the single knob that

the changes in microsoft#15681 claim should be the only edit required to stabilize

a release. No other files should change.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

Matched test failure patterns (1 test)
  • Aspire.Cli.EndToEnd.Tests.KubernetesDeployWithSqlServerTests.DeployK8sWithSqlServer — Unable to access container registry during publish

Jose Perez Rodriguez (joperezr) added a commit to joperezr/aspire that referenced this pull request May 20, 2026
…soft#15681

Throwaway validation PR: exercises CI by flipping the single knob that

the changes in microsoft#15681 claim should be the only edit required to stabilize

a release. No other files should change.

Co-authored-by: Copilot <[email protected]>
@joperezr
Jose Perez Rodriguez (joperezr) marked this pull request as ready for review May 20, 2026 22:17
Copilot AI review requested due to automatic review settings May 20, 2026 22:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR automates release stabilization for Helix/out-of-repo testing by dynamically generating centralized package-version information (including mixed stable/preview behavior) from the actual packable src/ projects, removing the need to hardcode dozens of versions during stabilization.

Changes:

  • Adds a ReturnPackageVersion MSBuild target to return each packable project’s PackageId + computed PackageVersion.
  • Extends Helix/out-of-repo support to generate Directory.Packages.Versions.props including Aspire package versions and AspireAppHostSdkVersion for SDK imports.
  • Updates CI to run PR builds as prerelease while adding a PR-only stabilization gate that packs stable artifacts and runs targeted CLI tests plus an init/restore smoke flow.
Show a summary per file
File Description
tests/Shared/RepoTesting/Directory.Packages.Helix.props Removes hardcoded Aspire package versions; relies on generated Directory.Packages.Versions.props.
tests/Shared/RepoTesting/Aspire.RepoTesting.targets Generates per-Aspire-package versions by invoking ReturnPackageVersion across src/ projects; wires AspireAppHostSdkVersion into SDK imports.
src/Directory.Build.targets Introduces ReturnPackageVersion target for Helix version generation.
eng/scripts/stabilization-smoke-init-restore.sh Adds a stabilization smoke script to validate template creation + restore against a locally packed stable feed.
.github/workflows/ci.yml Ensures PR builds are prerelease and adds a PR-only stabilization_check job to validate stabilized build shape.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 3

Comment on lines +96 to +98
if ! ls "$LOCAL_FEED"/Aspire.Hosting.[0-9]*.[0-9]*.[0-9]*.nupkg 2>/dev/null \
| grep -vE -- '-(dev|preview|rc|alpha|beta|ci|pr)\.' \
| grep -q .; then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. The previous pattern matched -(dev|preview|rc|alpha|beta|ci|pr)\. which only catches forms with a dot after the label — so -rc1.nupkg or -alpha2.nupkg would have slipped through.

Switched to a stable-only positive match: /Aspire\.Hosting\.[0-9]+\.[0-9]+\.[0-9]+\.nupkg$. Any SemVer prerelease shape (-dev., -preview.X.Y., -rc1, -rc.1, -alpha, -beta2, etc.) now fails the check, matching the intent. Verified against the matrix: only Aspire.Hosting.13.4.0.nupkg matches, all four prerelease shapes are correctly rejected.

Comment on lines +107 to +109
if ! ls "$LOCAL_FEED"/Aspire.ProjectTemplates.[0-9]*.[0-9]*.[0-9]*.nupkg > /dev/null 2>&1; then
echo "❌ No stable Aspire.ProjectTemplates.*.nupkg in $LOCAL_FEED."
echo " Did pack run with StabilizePackageVersion=true (and without -p:SkipProjectTemplates)?"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same fix as the Aspire.Hosting one — switched to the positive [0-9]+\.[0-9]+\.[0-9]+\.nupkg$ match so prerelease templates packages are correctly rejected. Also added a "found nupkgs" diagnostic on failure to match the Aspire.Hosting check's behavior.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +91 to +93
# 3. Runs a small init+restore smoke script that exercises the full
# `aspire init` -> `aspire restore` flow against the locally-built stable feed,
# which is the scenario that has historically broken on stabilization branches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good spot — the job comment was stale. The script switched from aspire init to aspire new aspire-empty back in b96c43658 but the comment block above the job here wasn't updated to match. Fixed in the same commit.

@joperezr

Copy link
Copy Markdown
Member Author

Hey Ankit Jain (@radical) Eric Erhardt (@eerhardt) David Fowler (@davidfowl) — this is ready for review.

The TL;DR: stabilizing a release going forward should be a single-line change in eng/Versions.props (flip StabilizePackageVersion to true). No more hand-editing Directory.Packages.Helix.props, no more dropping compute_version_suffix from ci.yml, no more [ActiveIssue] tags on KubernetesDeploy tests, no more SKIP lists in polyglot scripts.

Empirically validated via #17320 (now closed) — that PR stacked the one-line flip on top of this branch and all historically-broken-on-stabilization lanes (KubernetesDeploy E2E, polyglot SDK validation for all languages, Hosting.Kubernetes, Hosting.Azure.Kubernetes, templates) went green with zero manual workarounds. Full CI on this PR is also green (302 ✅ / 2 ⏭️ / 0 ❌).

PR description has been updated with the full breakdown of what changed, what the new Stabilization Check job catches, pros/cons, and follow-ups (#17317, #17318). Would love to land before 13.4 stabilization.

Comment thread src/Directory.Build.targets Resolved
Comment thread .github/workflows/ci.yml Resolved
@joperezr

Copy link
Copy Markdown
Member Author

Added one more thing while we were here: a new bump-patch-pr job in release-github-tasks.yml that, after each release, opens a PR against the just-released release_branch bumping PatchVersion in eng/Versions.props. So shipping 13.4.0 automatically opens a PR on release/13.4 to roll to 13.4.1, leaving the branch ready for the next servicing build.

This is only possible because of the dynamic Helix package-version computation in this PR — previously bumping the patch required hand-edits to Directory.Packages.Helix.props and was therefore impractical to automate.

Gated on is_prerelease != true (previews don''t roll the patch). Idempotent via skip_bump_patch_pr. Sanity-checks that the release branch''s Major.Minor matches the just-released version to catch wrong-release_branch mistakes. AzDO dispatch script and docs updated.

PR description updated to reflect this addition (under "Auto-bump patch on release branch" + the pros list).

Jose Perez Rodriguez (joperezr) added a commit that referenced this pull request May 21, 2026
* [release/13.3] Stabilizing builds in preparation for 13.3 release (#16566)

* [release/13.3] Stabilizing builds in preparation for 13.3 release

- Flip StabilizePackageVersion default to true in eng/Versions.props
- Drop the compute_version_suffix step from ci.yml so PR builds use the stabilized version
- Pin Aspire.AppHost.Sdk import to 13.3.0 in RepoTesting.targets
- Pin all stabilizable Aspire packages to 13.3.0 in Directory.Packages.Helix.props
  (packages whose csproj sets SuppressFinalPackageVersion=true keep $(PackageVersion))
- Skip preview-only AppHosts (Kusto, Foundry, Keycloak, Kubernetes, Maui) in the
  TypeScript polyglot validation script (see #15335)

Co-authored-by: Copilot <[email protected]>

* [release/13.3] Skip tests blocked by suppressed-package stabilization gap

Two test buckets cannot run on a stabilized branch because they exercise NuGet
restore against Aspire.Hosting.* packages that have SuppressFinalPackageVersion=true
and therefore only ship as prerelease (e.g. 13.3.0-dev.<sha>) — but the stabilized
build asks for >= 13.3.0 stable.

Polyglot SDK Validation:
- Add 'Aspire.Hosting' to the skip list in test-typescript-playground.sh (it
  transitively depends on Aspire.Hosting.Azure.Kubernetes via aspire.config.json).
- Apply the same skip block to test-python-playground.sh and test-java-playground.sh
  (the 13.2 PR only updated the TypeScript script).

Cli.EndToEnd-KubernetesDeploy* (11 files):
- Mark each [Fact] with [ActiveIssue(#15335)]. The proper fix is the dynamic
  version computation tracked by #15335 (PR #15681). When that lands the
  ActiveIssue tags can be removed.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* Remove MarkupString from SpanDetails and StructuredLogDetails resource strings (#16584)

Replace HTML-embedded resource strings with plain label strings and
move the <strong> formatting into Razor markup directly. This eliminates
the need for MarkupString casts and string.Format for these toolbar items.

* [release/13.3] Ensure compute environment prepare waits for validation (#16583)

* Ensure compute environment prepare waits for validation

When Foundry is used with another compute environment, the compute environments get confused about who takes ownership of which compute.

Make all compute-environment prepare pipeline steps depend on the shared validate-compute-environments step so before-start cannot race environment validation.

Add diagnostics coverage for a mixed Foundry hosted-agent and Azure Container Apps app.

Cover deployment target lookup returning null for a different compute environment.

* Fix tests

---------

Co-authored-by: Eric Erhardt <[email protected]>

* [release/13.3] Normalize App Service Application Insights Bicep identifiers (#16564)

* Initial plan

* Normalize app service app insights bicep identifiers

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/e848458a-5173-4241-b442-80d01de3d5c2

Co-authored-by: eerhardt <[email protected]>

* Preserve app insights bicep suffix separators

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/e848458a-5173-4241-b442-80d01de3d5c2

Co-authored-by: eerhardt <[email protected]>

* Address PR feedback

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: eerhardt <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>

* [release/13.3] Fix TypeScript AppHost package manager detection (#16598)

* Fix TypeScript package manager detection

Treat package-lock.json as an npm marker and limit parent directory package manager probing to the AppHost directory's direct parent. Log the marker used to select the TypeScript AppHost package manager.

Co-authored-by: Copilot <[email protected]>

* Fix TypeScript AppHost path comparisons

Use OS-appropriate path comparison when deciding whether to skip root and home parent directories for package manager detection.

Co-authored-by: Copilot <[email protected]>

* Preserve same-directory yarn marker precedence

Keep yarn markers ahead of package-lock.json within the same candidate directory while still allowing a local npm lockfile to beat parent-directory yarn markers.

Co-authored-by: Copilot <[email protected]>

* Remove yarn directory package manager hint

Only use file-based yarn markers for TypeScript AppHost package manager detection and update the resolver test accordingly.

Co-authored-by: Copilot <[email protected]>

* Address TypeScript toolchain review feedback

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Sebastien Ros <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix Windows detached AppHost launcher (#16572)

* Fix Windows detached AppHost launcher

Use the Windows DETACHED_PROCESS creation flag when launching the detached child CLI process so aspire start is not tied to the launching console lifetime. Keep the existing new process group and restricted handle inheritance behavior.

Co-authored-by: Copilot <[email protected]>

* Clarify Windows detach launcher comment

Document that the detached Windows flag combination follows established daemonization patterns used by libuv/Node.js and GitHub CLI, without over-claiming Docker parity.

Co-authored-by: Copilot <[email protected]>

* Remove Windows detach unit test

Remove the unit test coverage for the Windows detached process creation flags while keeping the implementation change and manual repro validation.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: David Fowler <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Validate build-only container references in the pipeline (#16582)

* Validate build-only container references in the pipeline

Add the publish/deploy validation step and implement the opt-out by clearing its RequiredBySteps during pipeline configuration.

Co-authored-by: Copilot <[email protected]>

* Fix tests

* PR feedback

Move DisableBuildOnlyContainerValidation to the Pipeline.

* PR feedback

* Fix tests

* Address build-only container validation feedback

Ensure manifest publishing runs the build-only container validation step and strengthen tests to cover mixed consumed and unconsumed build-only containers.

* Revert publish-manifest changes.

* Apply suggestion from @eerhardt

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Normalize CLI yes/no prompts (#16597)

* Normalize CLI yes/no prompts

Use single-key confirmation prompts for CLI yes/no choices so y/n answers are accepted without arrow-key selections while preserving [Y/n] and [y/N] defaults.

Co-authored-by: Copilot <[email protected]>

* Prefer local hive versions in aspire add

Treat the configured local hive as a local build channel so aspire add keeps generated AppHosts on the same CLI/SDK version and writes the local NuGet source when needed.

Co-authored-by: Copilot <[email protected]>

* Revert "Prefer local hive versions in aspire add"

This reverts commit 682178778ffedf19ddbffc863b88a714b2658f05.

---------

Co-authored-by: Sebastien Ros <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Publish native Aspire CLI tool packages (#16611)

* fix(publishing): stage native CLI tool packages

Download RID-specific Aspire.Cli tool packages from native build artifacts and stage them in the shipping packages directory so publishing can include them.

Co-authored-by: Copilot <[email protected]>

* fix(publishing): validate CLI package RIDs

Compare discovered CLI archives and RID-specific tool packages against the expected clipack RIDs, require exactly one pointer package, and summarize publish output without listing every NuGet package.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Rename pipeline --log-level to --pipeline-log-level to avoid CLI log overlap (#16596)

* Rename pipeline --log-level to --pipeline-log-level to avoid CLI log overlap

The pipeline commands (do, publish, deploy, destroy) had a --log-level option
that collided with the global CLI --log-level/-l option. When a user passed
--log-level Debug to control pipeline verbosity, Program.ParseLoggingOptions()
also picked it up and cranked CLI internal logging to Debug, flooding output
with mixed noise.

Rename the pipeline-specific option to --pipeline-log-level so the two
concerns are cleanly separated:
- --log-level / -l (global, recursive) controls CLI internal logging
- --pipeline-log-level (pipeline commands only) controls pipeline step output

The value is still forwarded as --log-level to the AppHost process, which is
correct since the AppHost has its own --log-level parameter.

Also adds tests verifying the separation and argument forwarding.

* Rename s_logLevelOption to s_pipelineLogLevelOption

* [release/13.3] Fallback to junctions if either creating OR evaluating symlinks fails (#16618)

* Fallback to junctions if either creating OR evaluating symlinks fails

* Update src/Aspire.Cli/Utils/ReparsePoint.cs

Co-authored-by: Copilot <[email protected]>

* Update outdated test verified results

* Regenerate the verified file

---------

Co-authored-by: David Negstad <[email protected]>
Co-authored-by: David Negstad <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix TypeScript AppHost generated port ranges (#16649)

* Fix TypeScript AppHost generated port ranges

Use a shared AppHost profile port generator for CLI templates, init, and TypeScript AppHost scaffolding so generated dashboard and service profile ports avoid the Windows ephemeral range. Add regression coverage for the generated TypeScript apphost.run.json ports.

Co-authored-by: Copilot <[email protected]>

* PR feedback

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix unbounded collection growth in TelemetryRepository (#16590)

* Fix unbounded collection growth in TelemetryRepository and related types

- Add MaxResourceCount option to TelemetryLimitOptions (default 10,000)
  to cap _resources growth. Throws on limit exceeded.
- Clear _logScopes, _logPropertyKeys on ClearStructuredLogs (full clear)
  and remove per-resource property keys on per-resource clear.
- Clear _traceScopes, _tracePropertyKeys, _spanLinks on ClearTraces
  (full clear) and clean up span links and property keys per-resource.
- Clear _meters alongside _instruments in OtlpResource.ClearMetrics.
- Add internal const limits on TelemetryRepository for resource views
  (10,000), instruments (10,000), dimensions (10,000), known attribute
  value keys (10,000), and values per key (10,000).
- Enforce instrument limit in OtlpResource.AddMetrics.
- Enforce resource view limit in OtlpResource.GetView.
- Enforce dimension limit in OtlpInstrument.FindScope.
- Cap KnownAttributeValues keys and per-key value lists in
  OtlpInstrument.CreateDimensionScope.
- Add clarifying comments to fields describing their bounds.

* Add limit enforcement tests and fix uncaught exceptions from resource limit

- Add TelemetryLimitTests with 5 tests for resource and instrument limits
- Add maxResourceCount parameter to CreateRepository test helper
- Wrap GetOrAddResource calls in GetPeerResource (return null), CalculateTraceUninstrumentedPeers, and OnPeerChanged with try/catch
- Fix _meters comment to not claim an unenforced bound
- Document TOCTOU soft-cap behavior on resource limit check

* Reset HasTraces/HasLogs and clear unviewed error logs on full clear

- ClearTraces full-clear now resets HasTraces on all resources
- ClearStructuredLogs full-clear now resets HasLogs on all resources and clears _resourceUnviewedErrorLogs

* Remove redundant per-telemetry-type resource limit tests

* Add scope and instrument limits with TryGetValue pattern

- Add MaxScopeCount limit to TryGetOrAddScope, using TryGetValue instead
  of GetValueRefOrAddDefault to avoid add-then-remove on overflow
- Refactor instrument add in OtlpResource to use TryGetValue + count check
  before inserting, removing the add-then-remove pattern
- Fix AddLogs failure count: count log records, not scopes
- Fix AddMetrics failure count: count data points, not metrics
- Add tests for resource limit, scope limit, and correct failure counting

* Move Ingress and Gateway extension methods to Aspire.Hosting namespace (#16633)

KubernetesGatewayExtensions and KubernetesIngressExtensions were in
the Aspire.Hosting.Kubernetes namespace, requiring users to add an
explicit using directive. Move them to Aspire.Hosting to match the
convention used by other extension methods like
KubernetesEnvironmentExtensions and KubernetesServiceExtensions.

Co-authored-by: Mitch Denny <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Remove obsolete ATS export shims (#16628)

Remove obsolete internal compatibility shims from the ATS export surface so generated polyglot SDKs only expose the unified methods.

Co-authored-by: Sebastien Ros <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Add BrowserLogs tracked browser sessions (#16637)

* Add BrowserLogs CDP transport seam

Co-authored-by: Copilot <[email protected]>

* Use CDP pipe for BrowserLogs owned browsers

Switch owned tracked-browser launches to a private CDP pipe, keep WebSocket adoption as an opt-in seam, and add session/persistent process lifetime configuration.

Co-authored-by: Copilot <[email protected]>

* Remove BrowserLogs persistent lifetime

BrowserLogs pipe-launched browsers are always session scoped because Chromium exits when the CDP pipe closes. Remove the public lifetime option and mark public BrowserLogs types experimental.

Co-authored-by: Copilot <[email protected]>

* Split BrowserLogs pipe launcher partials

Move platform-specific native launch logic into Windows and Unix partial classes while keeping the shared launcher entry points in the common file.

Co-authored-by: Copilot <[email protected]>

* Use posix_spawn for BrowserLogs Unix pipe launches

Replace the managed fork/exec launcher with posix_spawn file actions so Chromium still receives CDP pipe fds 3 and 4 without running managed code in a forked child.

Co-authored-by: Copilot <[email protected]>

* Move BrowserLogs to Aspire.Hosting.Browsers

Co-authored-by: Copilot <[email protected]>

* Move BrowserLogs tests to Browsers assembly

Co-authored-by: Copilot <[email protected]>

* Update CI snapshots after BrowserLogs move

Co-authored-by: Copilot <[email protected]>

* Update TypeScript capabilities snapshot

Remove the BrowserLogs capability from the Hosting assembly scanner snapshot now that BrowserLogs lives in Aspire.Hosting.Browsers.

Co-authored-by: Copilot <[email protected]>

* Remove BrowserLogs friend assembly access

Stop relying on InternalsVisibleTo for the Browsers package and its tests by source-sharing the BrowserLogs implementation into the test assembly and replacing Hosting-internal runtime dependencies with public-compatible behavior.

Co-authored-by: Copilot <[email protected]>

* Restore BrowserLogs health report publishing

Add a public CustomResourceSnapshot helper for publishing health reports without InternalsVisibleTo and use it to restore BrowserLogs session and last-error health report rows.

Co-authored-by: Copilot <[email protected]>

* Address BrowserLogs localization feedback

Add translator comments for BrowserLogs resource strings with format placeholders and regenerate XLF files.

Co-authored-by: Copilot <[email protected]>

* Fix review findings in BrowserLogs

- Fix null-forgiveness on screenshot Data property to throw
  InvalidOperationException instead of ArgumentNullException
- Guard _stopCts.Cancel() against ObjectDisposedException when
  MonitorAsync cleanup races with StopAsync
- Block '..' path traversal in SanitizePathSegment

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: David Fowler <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>

* [release/13.3] Gateway TLS without hostname (FQDN discovery) + TS AppHost endpoint fix (#16585)

* Support Gateway TLS without pre-known hostname (FQDN discovery)

When WithTls() is called without WithHostname(), the Gateway now:
1. Generates an HTTPS listener without a hostname restriction
2. After Helm deploy, polls Gateway status for the assigned address
3. Patches the HTTPS listener to add the discovered hostname
4. Creates a bootstrap self-signed TLS secret with the discovered FQDN
5. cert-manager then detects the hostname and issues a real certificate

This enables a single-deploy TLS workflow for controllers like AGC that
assign FQDNs automatically (e.g., *.alb.azure.com), without requiring
users to deploy once to discover the FQDN and then redeploy with it.

Co-authored-by: Copilot <[email protected]>

* Use helm field-manager for Gateway hostname patch to avoid conflicts

After patching the Gateway hostname via JSON patch, re-apply the full
Gateway YAML with --server-side --field-manager=helm --force-conflicts
to transfer field ownership back to Helm. This prevents SSA conflicts
when the user later redeploys with an explicit hostname via WithHostname().

Co-authored-by: Copilot <[email protected]>

* Fix endpoint resource lookup for TS AppHost RPC bridge

Use ResourceNameComparer on the deploymentTargets dictionary so that
endpoint references created through the TypeScript AppHost RPC bridge
(which may use a different resource instance) resolve correctly by
resource name. This matches the pattern already used in
KubernetesEnvironmentContext._kubernetesComponents.

Co-authored-by: Copilot <[email protected]>

* Fix test assertion for YAML quoted protocol values

The YAML serializer quotes string values like protocol: "HTTPS" on CI.
Use a more flexible assertion that matches both quoted and unquoted forms.

Co-authored-by: Copilot <[email protected]>

* Address all automated review feedback

1. Address type validation: Parse full Gateway JSON status, prefer
   Hostname-type addresses, fall back to DNS-like values, skip IPs.
2. Use -o json instead of jsonpath: Parse full Gateway JSON for both
   address discovery and listener index detection. More reliable.
3. Use JsonSerializer + --patch-file: Build JSON patch operations with
   proper serialization, write to temp file to avoid shell escaping.
4. Minimal manifest for field ownership: Read current Gateway JSON,
   strip server fields (status, resourceVersion, managedFields), keep
   only apiVersion/kind/metadata(name,namespace)/spec for SSA apply.
5. Temp file pattern: Use CreateTempSubdirectory consistently.
6. Add SAN to bootstrap certs: Add SubjectAlternativeNameBuilder with
   DNS name in both DiscoverFqdnAndBootstrapTlsAsync and the existing
   BootstrapTlsSecretsAsync. Modern TLS clients require SAN.

Co-authored-by: Copilot <[email protected]>

* Preserve annotations and labels in Gateway ownership transfer

The minimal manifest used for server-side apply field ownership transfer
was missing annotations and labels, causing AGC annotations like
alb.networking.azure.io/alb-name to be stripped. Now copies annotations
and labels from the current Gateway metadata.

Co-authored-by: Copilot <[email protected]>

* Add E2E test for K8S Gateway TLS deployment with HTTP-01

Tests the full flow: provision AKS with ALB controller, install cert-manager
with gatewayHTTPRoute HTTP-01 solver, create a project with AddKubernetesEnvironment
+ AddGateway + WithTls (no hostname), deploy with aspire deploy, and verify
FQDN discovery, certificate issuance, and HTTPS access.

Co-authored-by: Copilot <[email protected]>

* Use --enable-alb in az aks create and AMD VM SKU

Consolidate ALB enablement into the az aks create command instead of a
separate az aks update step. Use Standard_D2as_v5 (AMD) for quota
compatibility with E2E test subscription.

Co-authored-by: Copilot <[email protected]>

* Fix E2E test: use --enable-gateway-api --enable-application-load-balancer

Per the official AGC quickstart docs, use the correct flags:
- --enable-gateway-api: enables Gateway API CRDs
- --enable-application-load-balancer: enables ALB controller addon
- --network-plugin azure: required Azure CNI
- Standard_D2as_v5: AMD VM SKU for quota compatibility
- Use the add-on's auto-created aks-appgateway subnet instead of
  creating one manually

Co-authored-by: Copilot <[email protected]>

* Wait for ALB controller pods to be Running before checking GatewayClass

The ALB controller pods need time to initialize after cluster creation.
Poll until pods are Running and GatewayClass azure-alb-external exists,
with up to 10 minutes timeout.

Co-authored-by: Copilot <[email protected]>

* Fix ClusterIssuer: parentRefs requires name and namespace

cert-manager requires parentRefs to include a name. Use 'ingress' to
match the Gateway name from AddGateway('ingress'), and include the
namespace to match the Helm deploy namespace.

Co-authored-by: Copilot <[email protected]>

* Fix E2E test AppHost: add using directive and pragma suppressions

The injected AppHost code needs:
- using Aspire.Hosting.Kubernetes for AddGateway extension methods
- #pragma warning disable ASPIRECOMPUTE003 for AddContainerRegistry
Both prepended to the top of the file alongside ASPIREPIPELINES001.

Co-authored-by: Copilot <[email protected]>

* Fix E2E test: capture webfrontend variable from starter template

The starter template generates builder.AddProject('webfrontend') without
assigning to a variable. The Gateway route needs a reference to it, so
inject 'var webfrontend =' before the AddProject call.

Co-authored-by: Copilot <[email protected]>

* Refactor FQDN discovery polling to use Polly retry pipeline

Replace the manual for-loop retry with a Polly ResiliencePipeline
using constant 5s backoff, 60 max attempts, and result-based retry
(retries when result is null). Polly.Core is already a transitive
dependency via Aspire.Hosting.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Mitch Denny <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix Python starter TypeScript health check build (#16647)

* Fix Python starter health check template

Update the Python starter TypeScript AppHost to use the supported withHttpHealthCheck options object and align its root build script with AppHost-only type checking. Add E2E coverage that verifies the generated starter builds successfully.

Co-authored-by: Copilot <[email protected]>

* Use fail-fast helper for Python starter build test

Update the Python React template E2E build verification to use the existing fail-fast command helper so npm build failures are surfaced immediately.

Co-authored-by: Copilot <[email protected]>

* Verify TypeScript templates build

Co-authored-by: Copilot <[email protected]>

* Add build script aliases to TypeScript AppHost scaffold

Co-authored-by: Copilot <[email protected]>

* Use AppHost tsconfig for TypeScript AppHost lint

Co-authored-by: Copilot <[email protected]>

* Use AppHost tsconfig name for Python starter

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Sebastien Ros <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Fix sticky 'Finding apphosts' notification in VS Code extension (#16665)

The 'Finding apphosts' message was displayed via DisplayMessage, which
the extension renders as a sticky vscode.window.showInformationMessage
toast that has no programmatic dismissal. Fold it into the surrounding
ShowStatusAsync status text so it rides on the existing progress
notification (auto-dismissed via the finally block) instead.

Co-authored-by: Adam Ratzman <[email protected]>

* [release/13.3] API Review Feedback (#16674)

* API Review Feedback

Addressing feedback from https://github.com/microsoft/aspire/pull/16602

Rename JS experimental ID, refactor AKS/EF resource APIs

Renames ASPIREEXTENSION001 to ASPIREJAVASCRIPT001 for JavaScript APIs, resources, and tests. Refactors AKS-related code to Aspire.Hosting.Azure.Kubernetes, makes AksSkuTier internal, and defaults AKS SKU tier to Free. Renames EFMigrationResource.ContextTypeName to DbContextTypeName throughout. Adds missing using directives, Experimental attributes, and AspireValue metadata. Updates tests and samples for new names and diagnostics.

* Remove unused enum

* Change more dbContextTypeName instances.

* Update CodeGeneration snapshots for new WellKnownPipelineSteps entries

Adding [AspireValue("WellKnownPipelineSteps")] to BeforeStart and
CheckContainerRuntime causes the language code generators to emit them
in the WellKnownPipelineSteps exported value catalog. Update the
TwoPassScanningGeneratedAspire snapshots for Go, Java, Python, Rust, and
TypeScript to include the two new entries.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Jose Perez Rodriguez <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Normalize *.localhost dashboard URLs to localhost for CLI HTTP requests (#16708)

* Normalize *.localhost dashboard URLs to localhost for HTTP requests

DNS resolvers typically don't implement RFC 6761 for localhost subdomains,
so hosts like 'myapp.dev.localhost' fail to resolve. This adds
NormalizeDashboardUrl to McpToolHelpers which rewrites *.localhost API
base URLs to localhost before making HTTP requests, while preserving the
original hostname in dashboard display URLs (used in JSON output hyperlinks).

- Add NormalizeDashboardUrl and IsLocalhostTld to McpToolHelpers
- Normalize API base URL in TelemetryCommandHelpers and McpToolHelpers
- Preserve original *.dev.localhost hostname in dashboard display URLs
- Add unit tests for logs/traces with dev.localhost backchannel URLs
- Add E2E test variant using dev.localhost dashboard URL

* Refactor E2E test to use aspire ps --format json for dashboard URL

* Fix E2E test: use --frontend-url and extract dashboard URL from logs

- Use --frontend-url instead of invalid --dashboard-url for aspire dashboard run
- Extract dashboard login URL from log output instead of aspire ps (which
  cannot discover standalone dashboards)
- Pass login?t=xxx URL to aspire otel traces for proper token exchange
- dev.localhost variant passes *.localhost to --frontend-url to exercise
  NormalizeDashboardUrl end-to-end

* Fix E2E test: extract URL from dashboard run output, use --allow-anonymous

- Add --allow-anonymous to avoid token exchange issues in standalone mode
- Extract dashboard URL from 'Now listening on:' in aspire dashboard run output
- Avoids needing login token exchange which fails in container E2E tests

* Fix E2E test: use auth with login token from dashboard run output

- Remove --allow-anonymous to verify authentication works end-to-end
- Extract login URL (with ?t=xxx token) from aspire dashboard run output
- CLI exchanges login token for API key via validateToken endpoint

* Add echo of OTEL_DASHBOARD_URL for debugging visibility

* Add AppHost otel traces tests with dev.localhost variant

- Add AppHostOtelTracesReturnsTraces and _DevLocalhost variants
- New tests create Starter project, start AppHost, generate traces, verify otel traces output
- DevLocalhost variant uses useDevLocalhost flag in AspireNewAsync to test URL normalization
- Add useDevLocalhost parameter to AspireNewAsync helper

* Fix standalone dashboard tests and add dev.localhost otel logs test

- Fix grep regex to use [a-f0-9]+ for token to avoid Spectre Console link duplication
- Remove AppHost otel traces tests (covered by OtelLogs tests)
- Add OtelLogsReturnsStructuredLogsFromStarterApp_DevLocalhost test

* Use DASHBOARD__FRONTEND__BROWSERTOKEN instead of parsing URL from logs

Spectre Console OSC 8 escape sequences in redirected output cause grep
to capture a doubled URL. Instead, set a known browser token via env var
and construct the dashboard URL directly.

* Fix AspireStartAsync sed pattern to match *.localhost dashboard URLs

The sed pattern for extracting dashboardUrl from JSON only matched
'localhost' literally. With dev.localhost subdomains (e.g.
dashboard.dev.localhost:18888), the pattern failed to match, causing
'aspire start did not return a dashboard URL'. Broadened to [a-z.]*localhost.

* Preserve original *.localhost hostname in display URLs for --dashboard-url path

The --dashboard-url code path was normalizing the URL and using it for
both HTTP requests and JSON output hyperlinks. Now it preserves the
original hostname (e.g. dashboard.dev.localhost) for display URLs while
still normalizing to localhost for HTTP requests, matching the
backchannel path behavior.

Also adds remarks to NormalizeDashboardUrl explaining the RFC 6761 DNS
resolution motivation, and tests for the --dashboard-url display URL
preservation.

* Address review comments: normalize URL in StaticDashboardInfoProvider, fix error messages, fix E2E test

- Normalize apiBaseUrl in StaticDashboardInfoProvider so aspire agent mcp
  --dashboard-url with *.dev.localhost URLs works correctly
- Use displayDashboardUrl in error messages so users see the URL they typed
- Fix E2E test to pass frontendUrl to aspire otel traces, actually exercising
  the NormalizeDashboardUrl code path end-to-end

* Add test asserting error messages show original *.dev.localhost URL

* Add E2E tests for aspire agent mcp list_structured_logs

* Rename DashboardOtelTracesTests to DashboardRunTests and add agent mcp tests

- Rename class and file to DashboardRunTests
- Add E2E tests for aspire agent mcp --dashboard-url against standalone dashboard
- Extract CallAgentMcpToolAsync helper to CliE2EAutomatorHelpers
- Use shared helper in AgentMcpLogsTests

* [release/13.3] Fix aspire init template install for non-stable CLI builds (#16654) (#16672)

* [release/13.3] Fix aspire init template install for non-stable CLI builds (#16654)

�spire init ran `dotnet new install Aspire.ProjectTemplates@<cliVersion+sha>`
with `nugetConfigFile: null` and `nugetSource: null`, bypassing the channel
feed wiring used by `aspire new`. For non-stable CLI builds (staging/daily/PR),
`Aspire.ProjectTemplates@<cliVersion+sha>` is only available on a per-commit
darc feed (e.g. `darc-pub-microsoft-aspire-<sha8>`), so install failed with
exit code 103 in any C# repo containing a `.sln`.

Extract the channel-aware template package resolution and install logic out of
`DotNetTemplateFactory.ApplyTemplateAsync` and into `TemplateNuGetConfigService`
as `ResolveTemplatePackageAsync` and `InstallTemplatePackageAsync`. Both
`DotNetTemplateFactory` and `InitCommand` now consume the helper. The
existing `aspire new` install path is preserved bit-for-bit (extraction is
mechanical; `IncludePrHives: true` keeps PR-hive widening behavior).

For `aspire init` this means:
- The version sent to `dotnet new install` is now the channel-resolved one
  (e.g. `13.3.0`), not the raw `+sha` build metadata.
- Init now honors the global `channel` configuration, matching `aspire new`.
- On install failure, captured stdout/stderr is displayed before the error.
- `ChannelNotFoundException` and `EmptyChoicesException` produce friendly
  errors instead of bubbling to the top-level "unexpected error" handler.
- PR hives are intentionally NOT included in init's channel discovery so a
  developer with stale `~/.aspire/hives/*` doesn't get a different template
  than they'd get on a clean machine.

Notes:
- `TemplateNuGetConfigService` is a singleton; `IDotNetCliRunner` is
  transient and is therefore passed as a method parameter to
  `InstallTemplatePackageAsync` instead of being injected.
- New regression tests cover: explicit channel passes the temp NuGet config,
  implicit channel leaves it null, PR hives don't widen init, and channel
  resolution failures produce friendly errors.

Fixes #16654

Co-authored-by: Copilot <[email protected]>

* Address PR review feedback (#16672)

Multi-model code review caught the following issues:

1. Restore original order of operations in DotNetTemplateFactory.ApplyTemplateAsync.
   The first refactor moved extraArgsCallback ahead of template package resolution,
   which changed prompt/error precedence for `aspire new` (extra-args prompts
   like Redis-cache, test-framework, xUnit-version would now run before channel
   lookup, and answers would be discarded if resolution failed afterward).
   Restored the BEFORE order from release/13.3: ResolveTemplatePackageAsync
   first, then extraArgsCallback, then InstallTemplatePackageAsync. Updated the
   in-source comment to be accurate.

2. Catch NuGetPackageCacheException in InitCommand.DropCSharpProjectSkeletonAsync.
   The pre-extraction init code went straight to `dotnet new install` and
   never invoked a NuGet search, so feed search failures (offline, inaccessible
   feed, etc.) couldn't bubble up. After the extraction init now performs the
   search and was missing the catch, surfacing the failure as an unhandled
   "unexpected error". Added the catch with the same friendly-error treatment
   as ChannelNotFoundException / EmptyChoicesException.

3. Use TemplatingStrings.TemplateInstallationFailed in InitCommand for parity
   with `aspire new`. The previous ad-hoc string omitted the log file path,
   making post-mortem diagnosis harder.

4. Added a comment in InstallTemplatePackageAsync clarifying that the temporary
   NuGet config is intentionally disposed at the end of the install (only
   `dotnet new install` consumes it; the subsequent `dotnet new <template>`
   call uses the already-installed template hive and ambient NuGet config).

5. Added regression test InitCommand_WhenChannelTemplateSearchFails_DisplaysFriendlyError
   covering the new NuGetPackageCacheException catch.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* Make AtsJsonCodeWriter shared internal helper (#16752)

Move the JSON code writer out of Aspire.TypeSystem so it is not exposed as public API. Link the shared internal helper into each CLI and code generation project that uses it.

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Validate TypeScript AppHosts before startup (#16755)

* Validate TypeScript AppHost before start

Add a pre-execute runtime hook and use it to run TypeScript type validation before starting or publishing TypeScript AppHosts. Watch mode validates on every restart so startup is not blocked by existing errors while editing.

Co-authored-by: Copilot <[email protected]>

* Address TypeScript AppHost review feedback

Clarify the PreExecute contract and make Bun typecheck/watch commands use project-local binaries via bun run instead of bun x.

Co-authored-by: Copilot <[email protected]>

* Fix TypeScript AppHost E2E type checks

Use Yarn run for project-local TypeScript tools so arguments are forwarded correctly, and update the TypeScript publish E2E fixture to use the typed dashboard options shape.

Co-authored-by: Copilot <[email protected]>

* Fix Kubernetes TypeScript E2E type check

Update the Kubernetes TypeScript deploy E2E fixture to use the generated withHelm options shape so it passes runtime type validation.

Co-authored-by: Copilot <[email protected]>

* Use project-local Bun nodemon in watch

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Sebastien Ros <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Update dependencies from https://github.com/microsoft/dcp build 0.23.4 On relative base path root Microsoft.DeveloperControlPlane.darwin-amd64 , Microsoft.DeveloperControlPlane.darwin-arm64 , Microsoft.DeveloperControlPlane.linux-amd64 , Microsoft.DeveloperControlPlane.linux-arm64 , Microsoft.DeveloperControlPlane.linux-musl-amd64 , Microsoft.DeveloperControlPlane.windows-amd64 , Microsoft.DeveloperControlPlane.windows-arm64 From Version 0.23.3 -> To Version 0.23.4 (#16757)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [release/13.3] Fix HostUrl with container tunnel (#16786)

* Fix HostUrl with container tunnel

Co-authored-by: Copilot <[email protected]>

* Scope HostUrl matching to host endpoints

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: David Negstad <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Avoid AppHost discovery when config path is valid (#16680)

* Avoid AppHost discovery when config path is valid

Validate configured AppHost paths before using them and skip recursive discovery for normal CLI resolution when the configured path is already a valid AppHost. Preserve candidate listing behavior so extension commands can still enumerate all AppHost candidates.

Co-authored-by: Copilot <[email protected]>

* Restore silent: true for fast-path settings lookup

Reverts an unintended verbosity change so users with a stale legacy
.aspire/settings.json don't see a 'AppHost was specified but doesn't
exist' warning on every aspire run when the CLI is going to fall
back to discovery anyway.

Co-authored-by: Copilot <[email protected]>

* Add ProjectLocator tests for fast-path coverage requested in review

- Add Throw-mode variant of UseOrFindAppHostProjectFileUsesValidSettingsWithoutScanning
  to prove recursive discovery is also skipped for non-interactive/JSON callers.
- Add fast-path test with a configured guest AppHost (apphost.ts) and a throwing
  language discovery to cover the production guest-AppHost scenario from the issue.
- Add a parameterized fallback test that verifies an existing-but-invalid configured
  AppHost (IsUnsupported / IsPossiblyUnbuildable) falls back to discovery.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: adamint <[email protected]>

* [release/13.3] Reject Yarn Classic for TypeScript AppHosts (#16792)

* Reject Yarn Classic for TypeScript AppHosts

Yarn Classic is not supported for TypeScript AppHosts because its command behavior differs from supported package managers and can break Aspire argument forwarding.

Detect Yarn Classic through packageManager declarations and Yarn v1 lockfiles, then fail early with guidance to use Yarn 4 or later, npm, pnpm, or Bun.

Co-authored-by: Copilot <[email protected]>

* Update yarn tests to v4

* Update tes dockerfiles

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix dashboard error in .NET 11 preview 4 (#16761)

* Run dashboard in .NET 11

* Update

* Update

* Fix Aspire new empty AppHost language picker (#16666) (#16776)

* Fix Aspire new empty AppHost language picker

Keep a single interactive Empty AppHost template entry while retaining direct language-specific subcommands for non-interactive creation. Filter the language picker by enabled AppHost languages and add missing Python/Rust shortcut template IDs. Update NewCommand tests and E2E helper selection for the new flow.



* Address empty AppHost prompt review feedback



* Include hidden templates in non-interactive suggestions



* Stop persisting new command language selection



* Allow language option on new subcommands



---------



(cherry picked from commit 8bd4b60535047220a6b396e99ad16f25036b39ce)

Co-authored-by: Maddy Montaquila (Leger) <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Fix Python debug working directory in VS Code (#16575) (#16779)

* Fix Python debug working directory in VS Code (#16575)

When a Python app runs under the VS Code Aspire extension's debugger, os.getcwd() returned the AppHost directory instead of the Python app directory, and .WithWorkingDirectory(...) only updated the dashboard without affecting the actual debug cwd.

Add a working_directory field to PythonLaunchConfiguration that flows through DCP to the VS Code extension, where it now sets debugConfiguration.cwd. Path computation is moved inside the WithDebugSupport annotator lambda so a later .WithWorkingDirectory(...) override is respected at debug time.

Also drops the previous Module-entrypoint hack that smuggled the working directory through program_path.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Address Copilot review feedback for Python debug working directory

- Keep ProgramPath populated with the working directory for non-Script
  (Module + Executable) entrypoints to preserve backward compatibility
  with older VS Code extensions that derive cwd from program_path and
  don't yet understand the new working_directory field.
- Update the comment to mention both Module and Executable entrypoints.
- Update the existing module test to reflect the kept ProgramPath value.
- Add Executable-entrypoint coverage: one test asserting working_directory
  flows through and another asserting WithWorkingDirectory overrides are
  respected on the launch configuration.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Adam Ratzman <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Adam Ratzman <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Fix notification action closure over scoped services (#16763)

* [release/13.3] Fix Foundry hosted agent endpoint resolution (#16809)

* Fix hosted agent endpoint resolution

Resolve hosted-agent environment endpoint references through compute environment deployment expressions during publish so aspire deploy does not wait on endpoint allocation snapshots. Throw for unsupported internal referenced endpoints and add regression coverage for direct and nested endpoint expressions.

Co-authored-by: Copilot <[email protected]>

* Address hosted agent review comments

Fix endpoint resolution diagnostics, reuse the shared formatting helper, keep upgraded endpoint TLS values consistent with the effective scheme, and document endpoint property resolution behavior.

Co-authored-by: Copilot <[email protected]>

* Refine endpoint property documentation

Clarify that compute environment endpoint property expressions are generally useful whenever callers need environment-specific reference expressions, not only for deployment publishers.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Require --yes with --non-interactive for destroy cmd (#16806)

Added validation to enforce --yes when --non-interactive is used with the destroy command, returning a localized error if omitted. Introduced a new NonInteractiveRequiresYes resource and updated all localization files. Expanded DestroyCommandTests to cover new validation, multiple CLI permutations, and error scenarios for failed destroy activities.

Fix #16623

Co-authored-by: Eric Erhardt <[email protected]>

* Consolidate Helm chart options on WithHelm(...) (#16759) (#16802)

* Drop nuget.config alongside single-file apphost.cs in `aspire init` (#16636) (#16822)

* chore: whitespace change to trigger deployment test repro



* Drop nuget.config alongside single-file apphost.cs in `aspire init`

Deployment E2E tests on main were failing 12 of 13 with:

    Unhandled exception: The SDK 'Aspire.AppHost.Sdk/<v>' specified
    could not be found. /tmp/.../apphost.csproj
    The package installation failed with exit code 5.

After PR #15918 redesigned `aspire init` to drop a single-file
`apphost.cs` (with `#:sdk Aspire.AppHost.Sdk@<version>`) and an
`aspire.config.json` instead of a full `.csproj` project, the
generated workspace contains no `nuget.config`. The local hive
(where the dev SDK lives, e.g. `~/.aspire/hives/local/packages`)
is therefore invisible to MSBuild, so the SDK directive cannot be
resolved.

Any subsequent operation that triggers MSBuild restore fails:

* `aspire add <pkg>` (which runs `dotnet package add --file
  apphost.cs`) — this is the failure mode the deployment E2E tests
  hit.
* `dotnet run --file apphost.cs`
* `aspire start`

Fix: when `aspire init` drops the single-file C# skeleton, also
drop a workspace-local `nuget.config` listing every local hive
under `~/.aspire/hives/<name>/packages` as a NuGet package source.
We don't add package source mapping restrictions, so transitive
dependencies still resolve from inherited sources (typically
nuget.org) via the normal NuGet source hierarchy. Behavior for
users without any local hive is unchanged (no `nuget.config` is
written).



* Use shared TemplateNuGetConfigService for init nuget.config

Address PR review feedback (davidfowl, radical) by replacing the inline
ad-hoc nuget.config creation in InitCommand with a call to the shared
TemplateNuGetConfigService — the same path used by 'aspire new' for
template output.

This delegates to NuGetConfigMerger, which:

* Resolves the user's configured channel (from 'aspire config get channel'),
  so it works for any non-stable hive — local-*, dev-*, pr-*, run-*,
  staging — not just channels named 'local'.
* Creates a new nuget.config or merges missing sources into an existing
  one, so additional hives added later (e.g. via subsequent aspire
  commands) are handled the same way they are for templates.
* No-ops for stable/implicit channels, matching prior behavior of doing
  nothing for the default user case.



* Add silent CreateOrUpdateNuGetConfigWithoutPromptAsync overload

The previous refactor used PromptToCreateOrUpdateNuGetConfigAsync, which
in the in-place case (workingDir == outputPath, the case for aspire init)
prompts the user with 'Create NuGet.config for selected channels?'. The
existing E2E and unit tests for aspire init don't expect any prompt, so
they hung waiting for the next expected text.

Add a new public method CreateOrUpdateNuGetConfigWithoutPromptAsync that
always uses the silent merge path, and switch InitCommand to call it.
This keeps the same shared NuGetConfigMerger create-or-merge semantics
without changing the interactive UX of aspire init.

Also register TemplateNuGetConfigService in the test DI container so
InitCommand can resolve it from CliTestHelper.



* Avoid 'NuGet.config' substring in init's confirmation message

The AspireInitAsync E2E test helper detects the NuGet.config Y/n prompt
by looking for the literal substring 'NuGet.config' on screen. The shared
NuGetConfigPrompter (used in the silent path) emits a confirmation message
that also contains 'NuGet.config', causing the helper to false-match the
message as a prompt and get out of sync with subsequent prompts (most
notably the agent-init Y/n).

Fix: in TemplateNuGetConfigService.CreateOrUpdateNuGetConfigWithoutPromptAsync,
bypass NuGetConfigPrompter and call NuGetConfigMerger directly so no
built-in confirmation message is emitted. Return a bool indicating whether
a config was written, and let InitCommand emit a neutral message
('Created package sources file') that does not contain the trigger
substring.



* Quarantine flaky StopNonInteractiveTests E2E tests

Three consecutive PR CI reruns failed with different transient timeouts in:
  - StopNonInteractiveMultipleAppHostsShowsError (3m timeout on 'AppHost started successfully')
  - StopAllAppHostsFromUnrelatedDirectory (8m20s timeout on success prompt)

Both go through 'aspire new' + 'aspire start' (unrelated to the init/nuget.config changes in this PR). Tracking issue: #16643.



---------

Co-authored-by: Copilot <[email protected]>

* [release/13.3] Honor configured channel in 'aspire update' (#16808)

* Honor configured channel in 'aspire update'

'aspire update' previously consulted only the explicit --channel/--quality
option and otherwise silently selected the implicit channel (or prompted only
if PR hives were present). The local and global 'channel' configuration values
were never read, so a user who ran 'aspire config set channel staging' (or had
it saved by 'aspire update --self') would still get the implicit/NuGet-config
based channel on subsequent 'aspire update' runs.

UpdateCommand.ExecuteAsync now resolves the channel using the documented
precedence:

  1. explicit --channel / hidden --quality
  2. local app config 'channel' (aspire.config.json / .aspire/settings.json)
  3. global config 'channel' (~/.aspire/settings.global.json)
  4. interactive channel prompt when PR hives are present
  5. implicit/default channel as the documented fallback

Local-vs-global precedence comes for free because RegisterSettingsFiles loads
the global settings file before the local one, so IConfiguration (and
IConfigurationService.GetConfigurationAsync) returns the local value when both
exist. A configured channel that does not match any available channel now
surfaces a ChannelNotFoundException instead of being silently ignored.

The existing UpdateCommand_WithoutHives_UsesImplicitChannelWithoutPrompting
test is preserved (no configured channel still falls back to the implicit
channel) and joined by new regression coverage:

  * UpdateCommand_LocalConfiguredChannel_IsUsed
  * UpdateCommand_GlobalConfiguredChannel_IsUsed
  * UpdateCommand_ExplicitChannelOverridesConfiguredChannel
  * UpdateCommand_LocalConfiguredChannel_OverridesGlobalConfiguredChannel
  * UpdateCommand_WithoutHives_ConfiguredChannel_TakesPrecedenceOverImplicitFallback
  * UpdateCommand_ConfiguredChannelNotInChannelList_ThrowsChannelNotFound

Fixes #16650

Co-authored-by: Copilot <[email protected]>

* Resolve `aspire update` channel config relative to AppHost project directory

Addresses Copilot reviewer feedback on PR #16716. The previous fix moved
channel resolution to read from `IConfiguration`, but `IConfiguration` is
rooted at `Environment.CurrentDirectory` at startup via
`ConfigurationHelper.RegisterSettingsFiles`. That means
`aspire update --apphost <path-to-other-app>/AppHost.csproj` ignored the
target app's local `aspire.config.json` and read config from the caller's
cwd tree instead, so the documented "local app-config in the project tree"
precedence was still broken for explicit `--apphost` updates.

Add `IConfigurationService.GetConfigurationFromDirectoryAsync(key, startDirectory)`
which walks up from a caller-supplied directory for the nearest
`aspire.config.json`, then falls back to the global settings file. The
process-wide IConfiguration is intentionally not consulted, so the lookup
is never anchored to the launch cwd.

`UpdateCommand` now passes `projectFile.Directory` to scope the channel
lookup to the resolved AppHost project's tree.

Three new tests cover:
- Project in another directory uses its own local config
- Project-local config wins over cwd config
- Project-local config without `channel` falls back to global

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Mitch Denny <[email protected]>
Co-authored-by: Copilot <[email protected]>

* [release/13.3] Use plain dotnet run for extension Run Without Debugging (#16803)

* Use plain dotnet run for extension Run Without Debugging

* Honor IDE-advertised SupportedLaunchConfigurations for project resources

ExtensionUtils.SupportsDebugging treated 'project' launch type as implicitly supported by every IDE, even when the IDE explicitly advertised a SupportedLaunchConfigurations list that did not include 'project'.

This caused project resources to fail to start in VS Code when the C# extension was not installed: the AppHost routed them to the extension via DCP, and the extension returned 400 UnsupportedLaunchConfiguration because it has no project debugger registered without C#.

Now the implicit-project rule only applies when the IDE did not send DEBUG_SESSION_INFO at all (the Visual Studio scenario). When the IDE sent an explicit list, honor it for every launch type including 'project' — IDEs that can launch project resources must advertise 'project' in their list. The VS Code extension already does this correctly when C# is installed.

Resources whose launch type is not in the advertised list now fall to ExecutionType.Process, so the AppHost spawns dotnet itself and the resource starts (without a debugger attached, which is correct since the IDE has no debugger to attach).

* Remove NoExtensionLaunch flag

DotNetAppHostProject only needed NoExtensionLaunch to prevent the
extension from launching the apphost during pipeline (publish/exec)
flows. Since the extension launch path now uses plain 'dotnet run' for
Run Without Debugging, the flag is unused — pipeline commands already
take a different code path.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Adam Ratzman <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Backport CLI AppHost debug console output fixes (#16795) (#16816)

Backports the CLI portions of #16795 to release/13.3.

Includes AppHost summary formatting for extension-host output, serialized extension interaction output, and guest AppHost pre-launch failure surfacing.

* Fix #15986: emit apphost.run.json from aspire init single-file skeleton (#16812) (#16821)

* Add CLI E2E repro for #15986: dotnet run apphost.cs after aspire init

Demonstrates that 'dotnet run apphost.cs' against the single-file C#
AppHost dropped by interactive 'aspire init' fails because the launch
profile env vars (ASPNETCORE_URLS, ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL,
ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL) are missing — aspire init does not
write apphost.run.json and the .NET file-based runner only honours that
file (not aspire.config.json) for launch profiles.

This commit intentionally adds a failing test; the fix follows in a
subsequent commit on the same PR.



* Fix #15986: emit apphost.run.json from aspire init single-file skeleton

After 'aspire init' drops the C# single-file AppHost ('apphost.cs' +
'aspire.config.json' + 'NuGet.config'), running 'dotnet run apphost.cs'
crashed at startup because no launch profile was applied:

  Failed to configure dashboard resource because ASPNETCORE_URLS
  environment variable was not set.
  Failed to configure dashboard resource because
  ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL and
  ASPIRE_DASHBOARD_OTLP_HTTP_ENDPOINT_URL are not set.

The dashboard / OTLP / resource service env vars normally come from a
launch profile. When the AppHost is launched via 'aspire run' the CLI
injects them from 'aspire.config.json'. When launched via the .NET
file-based runner ('dotnet run apphost.cs') only '<file>.run.json'
(here 'apphost.run.json') is honoured, and the init flow was not
producing it.

Fix: in InitCommand.DropCSharpSingleFileSkeletonAsync, generate the
profile ports once and pass them into both the existing
'aspire.config.json' writer and a new 'apphost.run.json' writer so the
two files agree on the dashboard URLs. The 'apphost.run.json' shape
mirrors the existing aspire-apphost-singlefile MSBuild template
(commandName=Project, dotnetRunMessages=true, launchBrowser=true,
ASPNETCORE_ENVIRONMENT/DOTNET_ENVIRONMENT=Development, dashboard /
OTLP / resource service URLs).

The aspire-apphost-singlefile MSBuild template is unaffected since it
already ships 'apphost.run.json' alongside its other artifacts. No
other call site of DropAspireConfig is changed (the new ports parameter
is optional and defaults to the previous self-generation behaviour).

Adds InitCommand_SingleFileSkeleton_CreatesAppHostRunJsonWithDashboardEnvVars
unit test and updates the SingleFileAppHostInitDotnetRunTests E2E
repro added in the previous commit.

Fixes #15986



* Add CLI E2E test for #15986: aspire init then dotnet run apphost.cs

Drives the user-facing flow that #15986 broke:

1. `aspire init` (interactive, default C# selection).
2. Inspect the bind-mounted workspace from the host: assert
   `apphost.cs`, `aspire.config.json`, and `apphost.run.json` all
   exist, and that `apphost.run.json`'s `https` profile carries the
   dashboard / OTLP / resource-service env vars (full schema is covered by
   `InitCommand_SingleFileSkeleton_CreatesAppHostRunJsonWithDashboardEnvVars`).
3. `dotnet run apphost.cs` and wait for
   `Distributed application started.`.
4. Ctrl+C and exit cleanly.

Before the fix, `apphost.run.json` was never written, the precondition
in step 2 fails fast with an explicit pointer to #15986, and step 3
would crash at startup with the dashboard `OptionsValidationException`
about missing `ASPNETCORE_URLS` / `ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL`
(verified on this branch — the test-only commit pushed earlier failed in
CI with exactly that error before the fix landed in this PR).



* Trigger CI revalidation (whitespace only)

* Address PR feedback: shared JSON options + ports always agree

James review feedback on #16812:

1. Use shared JsonSourceGenerationContext.RelaxedEscaping (which already has WriteIndented = true and UnsafeRelaxedJsonEscaping) instead of inline 'new JsonSerializerOptions { WriteIndented = true }' at both ToJsonString call sites in InitCommand.

2. Make divergence between aspire.config.json and apphost.run.json impossible by construction. DropAspireConfig now returns the effective ports (newly generated, or read back from a pre-existing profiles section), and DropCSharpSingleFileSkeletonAsync threads those into DropAppHostRunJson — so even if aspire.config.json was hand-edited or pre-existed, both files always describe the same dashboard / OTLP / resource service endpoints.

Added unit test InitCommand_SingleFileSkeleton_AppHostRunJsonAdoptsPortsFromExistingAspireConfig that pre-seeds aspire.config.json with profiles and asserts apphost.run.json adopts those exact ports.

Also dropped the E2E 'Distributed application started.' wait timeout from 7 minutes to 1 minute — even a cold dotnet build of the bare single-file AppHost completes well inside that budget; if it's not started by then, fail fast.



* Strengthen inline comments at JSON literals (PR #16812 review nits)

James left two nit comments asking for short explanatory comments at the JSON literal blocks. Beef up the comment at the apphost.run.json literal in DropAppHostRunJson explaining what shape it mirrors and why; the existing comment in DropAspireConfig now also calls out that each profile carries the dashboard URL plus the OTLP / resource-service env vars consumed by DashboardOptionsValidator at AppHost startup.



* Address PR feedback: preserve user profiles + use KnownConfigNames

Two more JamesNK review comments on PR #16812:

1. Behavioural regression (line 481): the previous patch overwrote any pre-existing 'profiles' section in aspire.config.json whenever TryReadAppHostProfilePorts couldn't parse all six expected ports (e.g. user-customised config, https-only setup, missing one of the env vars). The original implementation preserved existing profiles unconditionally — this is restoring that safety. New behaviour:

  - profiles is null -> write fresh, return those ports

  - profiles parses cleanly -> adopt those ports, return them (existing behaviour)

  - profiles exists but doesn't match the expected shape -> PRESERVE the user's profiles untouched, generate fresh ports just for apphost.run.json (accepted edge-case divergence — better than silent data loss)

Added InitCommand_SingleFileSkeleton_PreservesUnparseableExistingProfiles to lock the preservation behaviour in.

2. Use KnownConfigNames constants (line 546): replaced literal 'ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL', 'ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL', 'ASPIRE_ALLOW_UNSECURED_TRANSPORT' strings throughout InitCommand.cs (in DropAspireConfig, DropAppHostRunJson, and TryReadAppHostProfilePorts) with KnownConfigNames.DashboardOtlpGrpcEndpointUrl / .ResourceServiceEndpointUrl / .AllowUnsecuredTransport. Test fixtures keep literal strings since they document the on-disk JSON shape from the user's perspective.



---------

Co-authored-by: Copilot <[email protected]>

* Bump patch version from 13.3.0 to 13.3.1 (#16951)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joperezr <[email protected]>

* [create-pull-request] automated change (#16602)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update dependencies from https://github.com/microsoft/dcp build 0.23.5 On relative base path root Microsoft.DeveloperControlPlane.darwin-amd64 , Microsoft.DeveloperControlPlane.darwin-arm64 , Microsoft.DeveloperControlPlane.linux-amd64 , Microsoft.DeveloperControlPlane.linux-arm64 , Microsoft.DeveloperControlPlane.linux-musl-amd64 , Microsoft.DeveloperControlPlane.windows-amd64 , Microsoft.DeveloperControlPlane.windows-arm64 From Version 0.23.4 -> To Version 0.23.5 (#16944)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [release/13.3] Skip compute env validation in run mode (#16940) (#16952)

* Skip Azure compute env validation in run mode (#16940)

The validate-azure-container-apps and validate-azure-app-service pipeline
steps run in 'before-start', which fires for both 'aspire run' and publish.
In run mode, AddAzureContainerAppEnvironment/AddAzureAppServiceEnvironment
do not add their environment resources to the model. Any compute resource
that ends up with a PublishAs* customization annotation (for example via
WithAnnotation) therefore trips the 'no environment resources' branch at
'aspire run' time, even though the user did add an environment.

PublishAs* annotations only affect publish/deploy output, so skip the
validation entirely when ExecutionContext.IsPublishMode is false.

Fixes #16940.

Co-authored-by: Copilot <[email protected]>

* Fix Docker and K8s too

---------

Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Backport of https://github.com/microsoft/aspire/pull/16988 into release/13.3 (#16993)

* Fix WaitFor() for tunnel-dependent containers

# Conflicts:
#	src/Aspire.Hosting/Dcp/ContainerCreator.cs
#	src/Aspire.Hosting/Dcp/DcpExecutor.cs
#	tests/Aspire.Hosting.Tests/Dcp/TestKubernetesService.cs

* Fix code review issues

* Do not dispose externally-provided ContainerCreator instance

* Add application cancellation token for container tunnel creation

* Improve error reporting for container tunnel (#16537)

* Improve error reporting for container tunnel

Fixes https://github.…
@joperezr

Copy link
Copy Markdown
Member Author

On second thought, removed the patch-bump-PR addition from this PR (commits scrubbed via interactive rebase — diff is back to just the 5 in-scope files). Two reasons:

  1. Scope creep: the dynamic-version mechanism and the release workflow change are independent improvements, and bundling them makes the PR harder to review.
  2. 13.3 servicing risk: if we end up shipping another 13.3 servicing release before this PR''s dynamic-version mechanism is backported (which it won''t be — it''s a forward-only change), the auto-bump on release/13.3 would try to roll a patch on a branch that still has hardcoded Directory.Packages.Helix.props. Better to keep the release workflow stable for old branches and add the auto-bump as a separate change that we land at a time of our choosing.

Filed as follow-up #17342 with the design notes and a pointer to the draft commit on this branch (the implementation is ready to revive when we decide to land it). Pre-emptively addressed for review at that time.

PR description updated to reflect the reduced scope.

@radical Ankit Jain (radical) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assuming internal build works, LGTM!

Issue microsoft#15335 / fixes the manual workaround pile that 13.1, 13.2, 13.3 stabilization PRs
had to maintain.

PR ci.yml: pass /p:DotNetFinalVersionKind=prerelease alongside the existing
/p:VersionSuffix=pr.NNNNN.gSHA so PR builds keep producing unique prerelease versions
even when StabilizePackageVersion=true is flipped on a release branch. Together with
the dynamic Helix package-version computation in this PR, that removes the need to
manually strip the compute_version_suffix step at stabilization time.

stabilization_check job: a new PR-only gate that runs ./build.sh -pack with
StabilizePackageVersion=true, runs the version/channel/template-pinning subset of
Aspire.Cli.Tests under that build, and runs an aspire init + aspire restore smoke
against the locally-built stable feed. Catches NU5104 (stable depends on preview)
and the restore-time failures that historically forced 13.x stabilization PRs to
hand-skip whole test classes. Job is wired into results: needs so branch protection
enforces it from day one; on push events the job runs but no-ops so the results:
contains(needs.*.result, ''skipped'') check doesn''t fire.

The smoke script lives at eng/scripts/stabilization-smoke-init-restore.sh and is
runnable locally for repro (see prerequisites at the top of the script).

Co-authored-by: Copilot <[email protected]>
Comments describe what the code does, not which PR/issue they were authored under.

Co-authored-by: Copilot <[email protected]>
STABILIZATION_SMOKE_CONFIGURATION (default: Debug) and STABILIZATION_SMOKE_FEED
(default: artifacts/packages/<config>/Shipping) let local users point the smoke at
a Release-config pack or a custom feed path without editing the script.

Co-authored-by: Copilot <[email protected]>
Exercises the user-visible 'create a project' flow, the templates package, and
template version-pinning end-to-end. Uses a source-mapped NuGet.config so Aspire.*
packages are pinned to the local stable feed (so a missing or preview-only Aspire dep
fails restore here) while non-Aspire transitives flow from the public dotnet feeds.

Verification accepts either single-file (apphost.cs) or project-based (.AppHost.csproj)
layout, since the CLI's template-resolution may map aspire-empty to either shape over time.

Co-authored-by: Copilot <[email protected]>
Two issues found via the dummy validation PR (microsoft#17320) CI run:

1. SDK 10.0.x dotnet test requires --project <path>, not a positional project arg.
2. --no-build caused MTP to report 'Zero tests ran' even when the assembly
   was built in the previous step. Dropping it lets dotnet test handle the
   build itself (no-op when nothing changed, as is the case here).

Co-authored-by: Copilot <[email protected]>
aspire end-users only configure nuget.org by default — the smoke should match
that shape. Drops the dotnet-public / dotnet-eng / dotnet9 / dotnet10 internal
mirrors that were copied from tests/Shared/nuget-with-package-source-mapping.config
(those are needed for Helix-internal builds, not for a consumer-facing smoke).

Locally verified: aspire new aspire-empty + aspire restore both succeed against
this simpler config.

Co-authored-by: Copilot <[email protected]>
RootCommand.NonInteractiveOption is declared Recursive=true so it applies to all
subcommands. Adding it in the run_aspire helper covers both 'aspire new' and
'aspire restore' (and any future commands) and provides defense in depth against:
  * future prompts added without a matching suppression flag (would now fail fast
    instead of silently defaulting or hanging on stdin)
  * ambient prompts like the certificate-trust check that appeared during local
    repro and isn't covered by the per-command --language / --suppress-agent-init /
    --localhost-tld flags.

The explicit suppression flags are kept for the known prompts so the chosen values
are deterministic regardless of what defaults the CLI picks under non-interactive.

Co-authored-by: Copilot <[email protected]>
1. eng/scripts/stabilization-smoke-init-restore.sh (CRITICAL fix):
   - run_aspire helper used to wrap its body in a subshell that did
     `cd $REPO_ROOT`, which overrode the caller's CWD on the way to the
     spawned aspire process. That meant aspire new --output was being
     resolved against the repo root (writing MyAspireApp/ into the repo
     working tree) and the NuGet.config walk found the repo's config
     instead of the temp-dir source-mapped one we carefully wrote.
   - Drop the inner cd, document why, and pass an absolute --output so
     CWD is irrelevant for path resolution. dotnet.sh resolves the local
     SDK via $scriptroot independently of CWD, so we don't lose SDK
     discovery.
   - Tighten the stable-feed sanity check to actually exclude prerelease
     suffixes (the previous bash glob matched -dev/-preview too).
   - Clarify in comments that today the smoke validates the SDK reference
     path only (aspire-empty resolves to single-file apphost.cs with no
     PackageReferences); per-integration restore coverage comes from the
     pack-time NU5104 check.

2. .github/workflows/ci.yml (medium):
   - Add --no-build --no-restore to the Aspire.Cli.Tests step so it
     consumes the previous pack step's build outputs instead of doing a
     differently-fingerprinted rebuild. The previous step already builds
     test projects (SkipTestProjects=false) under StabilizePackageVersion=true,
     so the assemblies are present.

3. tests/Shared/RepoTesting/Aspire.RepoTesting.targets (hardening):
   - Add an Error after the FindInList that pulls Aspire.AppHost.Sdk so a
     rename/un-pack of that project fails clearly here instead of
     surfacing as an opaque NuGet "Sdk Version=\"\"" error downstream.

4. src/Directory.Build.targets (hardening):
   - Document that ReturnPackageVersion reads $(PackageVersion) declaratively
     so a future Arcade bump that moves PackageVersion into a target body
     would be flagged.

Also picked up 10 commits worth of main via rebase (DCP 0.24.3 etc.).

Co-authored-by: Copilot <[email protected]>
SDK 10 dotnet test driver requires its own restore-equivalent evaluation pass to
detect the Microsoft.Testing.Platform runner. With --no-restore it falls back to
VSTest detection and exits non-zero because global.json mandates MTP.

The fingerprint-stability concern the previous comment raised is real but the cure
(skipping restore) is worse than the disease. Document why we deliberately let
dotnet test re-restore.

Co-authored-by: Copilot <[email protected]>
Radical pointed out my new target name (ReturnPackageVersion) clashed
with one already in src/Aspire.Dashboard/Aspire.Dashboard.csproj that has
a different signature (Returns="$(PackageVersion)" string vs my item-shape).

It turns out src/Directory.Build.targets already has a GetPackageName
target with literally the exact shape I needed — Returns="@(PackageName)"
with PackageId as Include and PackageVersion as WithPackageVersion
metadata, gated on IsPackable=true. It is already used by
tests/Shared/Aspire.Templates.Testing.targets.

Switched the Helix versions generator to call GetPackageName instead of
adding a new target, and dropped my ReturnPackageVersion target.
Side-benefits:
- No name clash with Aspire.Dashboard.Aspire.Dashboard.csproj (which keeps
  its local ReturnPackageVersion intended for eng/Publishing.props blob
  publishing — different shape, different purpose).
- One target instead of two doing nearly the same thing.
- Reuses an already-established convention rather than introducing
  a parallel one.

Validated end-to-end by triggering _GeneratePackagesVersionsProps on
Aspire.Cli.Tests; the generated Directory.Packages.Versions.props has
the right entries (Aspire.AppHost.Sdk, Aspire.Hosting.Foundry et al with
correct stable/preview semantics, plus AspireAppHostSdkVersion property).

Co-authored-by: Copilot <[email protected]>
Derive the Aspire.AppHost.Sdk version directly from the local feed
(Aspire.AppHost.Sdk.<X>.nupkg filename), pass that exact version via
`aspire new --version <X>`, then assert the generated apphost.cs
contains `#:sdk Aspire.AppHost.Sdk@<X>` before running restore.

Catches the failure mode where the CLI's template-version resolution
silently picks a different SDK version than the one we just packed —
without this assertion that would surface much later as a confusing
"package not found in local-stable feed" restore error instead of a
clear "wrong SDK version emitted in AppHost."

Also covers the project-based AppHost template shape (Sdk="Aspire.AppHost.Sdk/<X>"
in .csproj) for the day the aspire-empty template flips back to multi-project.

Co-authored-by: Copilot <[email protected]>
1. Stable-nupkg sanity check: switch from a "filter out known prerelease
   suffix labels" allowlist (which missed -rc1 / -alpha2 / etc. because
   they have no dot between the label and digits) to "match only
   Aspire.Hosting.MAJOR.MINOR.PATCH.nupkg exactly". Any SemVer prerelease
   shape (-dev., -preview.X.Y., -rc1, -rc.1, -alpha, etc.) now fails the
   check, matching the intent.

2. Apply the same stable-only pattern to the Aspire.ProjectTemplates check
   (was only verifying any version-shaped name existed).

3. Fix the stabilization_check job comment in ci.yml: said the script runs
   `aspire init -> aspire restore`, but it actually runs `aspire new
   aspire-empty -> aspire restore` (and has done since b96c436). Updated
   to match what the script actually does.

Co-authored-by: Copilot <[email protected]>
@joperezr

Copy link
Copy Markdown
Member Author

Queued https://dev.azure.com/dnceng/internal/_build/results?buildId=2981187&view=results and it is passing native and managed build which would be the pieces impacted. I'll go ahead and merge. Thanks Ankit Jain (@radical)

@joperezr
Jose Perez Rodriguez (joperezr) merged commit eb43ee0 into microsoft:main May 21, 2026
306 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.4 milestone May 21, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate version stabilization: dynamically compute package versions instead of hardcoding

3 participants