Merge release13.2 into main#16007
Conversation
…oft#15495) The describe command was passing BaseUrlWithLoginToken (e.g., http://localhost:18888/login?t=token) directly to the resource snapshot mapper, producing broken dashboard URLs like http://localhost:18888/login?t=token/?resource=redis. Reuse TelemetryCommandHelpers.ExtractDashboardBaseUrl to strip the /login?t=... path before combining with resource URLs.
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/6a2f1f41-1660-4e0c-8d21-9fb0061809aa Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
… linux-arm64, linux-musl-x64) (microsoft#15529) * Fix cross-compiled bundles missing DCP for win-arm64, linux-arm64, linux-musl-x64 Bundle.proj's _RestoreDcpPackage target now maps TargetRid to BuildOs/BuildArch and passes them to the AppHost restore, ensuring the correct DCP NuGet package is downloaded for the target platform instead of the build machine's platform. CreateLayout now throws when DCP is not found instead of silently producing a broken bundle that would fail layout validation at runtime. Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/a71f0181-f863-4d63-b275-47c8eb198dee * Add validation for unrecognized RID patterns and document supported format Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/a71f0181-f863-4d63-b275-47c8eb198dee --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
…r winget CLI (microsoft#15541) * Enable CFSClean policies and use dotnet-public feed for winget CLI - Add networkIsolationPolicy: Permissive, CFSClean, CFSClean2 to the 1ES official pipeline template parameters - Switch winget CLI installation from PSGallery to dotnet-public Azure Artifacts feed to comply with CFSClean network restrictions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update eng/pipelines/templates/prepare-winget-manifest.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update eng/pipelines/azure-pipelines.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Matt Mitchell (.NET) <mmitche@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ankit Jain <radical@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…#15561) Read VersionPrefix dynamically from eng/Versions.props instead of hardcoding a specific version. For non-stabilized builds (all normal PR builds), also verify the commit SHA suffix for exact build identity. This replaces the hardcoded '13.2.0' check that was added for the stabilized 13.2.0 release build. Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n Windows (microsoft#15559) * Backport NpmRunner and SigstoreNpmProvenanceChecker changes from mad-skills * Clean up empty .playwright directory after skill installation * Add missing IsAvailable property to test INpmRunner implementations
) * Handle brownfield TypeScript aspire init Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use local tsx and semver-safe dependency merges Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Pre-add JavaScript hosting for brownfield init Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Incorporate release/13.2 ESLint and tsconfig.apphost.json updates - Update ts-starter template package.json build/watch scripts to use tsconfig.apphost.json - Add eslint.config.mjs scaffolding, ESLint deps, and engines constraint to CreatePackageJson - Add aspire:lint script to brownfield scaffolding - Update dependency versions to match release/13.2 baseline - Update test assertions for new dependency versions and eslint Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add CLI-side package.json merge for brownfield safety When aspire init is run on an existing JS/TS codebase, the scaffold RPC server returns package.json content that may not include brownfield merge logic (depending on the server package version loaded). This adds a safety net in the CLI's ScaffoldingService that deep-merges the scaffold output with the existing package.json on disk. The merge preserves all existing properties (name, version, scripts, dependencies) and only adds new properties from the scaffold. For nested objects like scripts and dependencies, existing values are never overwritten — only missing entries are added. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Extract PackageJsonMerger with smart script conflict handling Extract the package.json merge logic from ScaffoldingService into a dedicated PackageJsonMerger class with conflict-aware script handling. When scaffold scripts conflict with existing user scripts, they are added under the aspire: namespace prefix (a standard npm convention). For aspire:X scripts with no non-prefixed X equivalent, a convenience alias is added (e.g. "start": "npm run aspire:start"). This ensures all Aspire scripts are always present in the merged output regardless of whether existing scripts use the same names, and works correctly with both the updated server (aspire: prefixed) and stale server (non-prefixed) package versions. Also updates ts-starter template to consistently use aspire: prefixed scripts as canonical names with non-prefixed convenience aliases. Includes 14 unit tests covering conflicts, aliases, dependencies, edge cases, idempotency, and both stale/updated server scenarios. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add semver-aware dependency merging via shared NpmVersionHelper - Create src/Shared/NpmVersionHelper.cs with TryParseNpmVersion and ShouldUpgrade methods, file-linked into both Aspire.Cli and Aspire.Hosting.CodeGeneration.TypeScript - Update PackageJsonMerger.MergeDependencySection to upgrade existing deps when scaffold version is strictly newer (semver comparison) - Unparseable ranges (||, workspace:*, file:, link:) are preserved - Refactor TypeScriptLanguageSupport to use shared helper, removing ~50 lines of duplicated private methods - Add 6 new unit tests for semver-aware merging scenarios - Update 2 existing tests to reflect new upgrade-when-newer behavior Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Harden PackageJsonMerger and deduplicate E2E helpers - Add type guards (JsonValue + TryGetValue) before GetValue<string>() in MergeScripts and MergeDependencySection to prevent InvalidOperationException on non-string JSON values - Bump merge failure log level from Debug to Warning for visibility - Extract PrepareLocalChannel helper from TypeScriptPolyglotTests and TypeScriptStarterTemplateTests into shared CliE2ETestHelpers - Add 8 new robustness tests: non-string scripts, non-string deps, array dep section, JSON root as array, *, latest, pre-release version comparison Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add explicit engines.node overwrite and array property guard - Add MergeEngines() that overwrites engines.node with the scaffold's required Node version constraint (needed for ESLint 10 compatibility). Other engines sub-keys (e.g., npm) are preserved from existing. - Add guard in MergeObjects that throws InvalidOperationException if the scaffold template contains an array property — ensures developers add explicit merge logic rather than silently dropping data via DeepMerge. - Let InvalidOperationException propagate through the outer catch (it indicates a programming error, not a runtime merge failure). - Use 'as JsonObject' instead of .AsObject() to safely handle non-object JSON roots without throwing. - Add 4 new tests: engines overwrite, other keys preserved, engines added when missing, array property throws. - Update PreservesNonScriptProperties test for new engines behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix unicode escape in engines.node constraint on server side TypeScriptLanguageSupport used default JsonSerializerOptions which encodes >= as \u003E=. Add UnsafeRelaxedJsonEscaping (same as PackageJsonMerger) so the engines.node value is written as literal >=24 in the generated package.json. Add assertion to verify no unicode escapes appear in the raw scaffold output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR review findings: internal visibility, private:true, engines for brownfield, LoadExisting hardening - Revert TypeScriptLanguageSupport from public to internal - Add private:true to greenfield scaffold output - Move engines.node outside greenfield-only block so brownfield also gets it - Harden LoadExistingPackageJson with try-catch for malformed JSON - Fix duplicate <summary> XML doc in TypeScriptStarterTemplateTests - Add brownfield engines.node and private assertions to tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address James' review: indent, logger, JSON tolerance, split try/catch, log style - Explicitly set 2-space indent (npm standard) with explanatory comment - Make logger non-nullable; tests use NullLogger.Instance - Add JsonCommentHandling.Skip + AllowTrailingCommas for real-world package.json - Split Merge into parse phase and merge phase with separate try/catch blocks - End log messages with periods (style convention) - Add test for package.json with comments and trailing commas Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix array property merge crash for brownfield npm init The PackageJsonMerger threw InvalidOperationException when encountering array properties like 'keywords' in the existing package.json. These arrays get echoed through the server-side scaffold and both sides have them during merge. Instead of throwing, preserve the existing array (existing-wins semantics) and add scaffold-only arrays. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address remaining review feedback: migration, double-merge, EnsureObject logging - Add RuntimeSpec.MigrationFiles and auto-create tsconfig.apphost.json on first run for existing 13.2.0 projects (fixes tsconfig breaking change) - Remove LoadExistingPackageJson; scaffold now produces Aspire-only content so CLI-side PackageJsonMerger handles all merging (fixes double-merge ordering dependency) - Thread ILogger through PackageJsonMerger internals; EnsureObject now logs a warning when replacing non-object values (fixes silent data loss) - Add comprehensive tests for all three fixes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address review nits: non-nullable EnsureObject logger, GuestRuntime test helper - Make EnsureObject logger parameter non-nullable (consistent with Merge) - Add CreateRuntime helper to GuestRuntimeTests with ITestOutputHelper logging for better debuggability on test failures - Replace all NullLogger.Instance usages with the test logger Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…icrosoft#15598) * Add rebuild guidance to Aspire skill for per-resource code changes Update the skill content to teach agents when to restart the AppHost vs rebuild a single resource vs do nothing: - AppHost code changed → aspire start (full restart) - Compiled resource changed (C#, Go, etc.) → aspire resource <name> rebuild - Interpreted resource (JS, Python) → no action (file watchers handle it) Add 'aspire resource <resource> rebuild' to the CLI command reference table and reinforce the rule in Important rules section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Soften interpreted resource guidance per review feedback Acknowledge that not all JS/Python resources run in watch mode — suggest restarting the resource if no file watcher is configured. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Scope rebuild command to .NET project resources only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add aspire describe --format Json hint for command discovery Agents can check which commands a resource supports before attempting rebuild, since it is only available on .NET project resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Nudge agents to use aspire docs search instead of NuGet XML docs Users report Copilot digging through NuGet package caches for XML doc files instead of using the built-in aspire docs search/get commands. Add an explicit rule telling agents to never search local package folders for Aspire documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Soften docs rule to prefer instead of hard block Use medium-freedom 'prefer X over Y' pattern instead of 'Do NOT' for documentation lookup guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t trace IDs (microsoft#15613) * Simplify TelemetryApiService.GetTrace and support short trace IDs - Use TelemetryRepository.GetTrace instead of fetching all traces - Add early return in GetTraceUnsynchronized for IDs shorter than ShortenedIdLength - Add parameterized unit test for full, short, and nonexistent trace IDs * Use hex constant in GetTrace test for explicit trace ID relationship * Remove early return for short trace IDs in GetTraceUnsynchronized MatchTelemetryId already handles short IDs correctly with exact equality fallback, so the guard was preventing valid exact-match lookups. * Clean up
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
) When running 'aspire new' from the VS Code extension, OpenEditor was called immediately after template creation, which opened the new workspace and severed the CLI terminal connection before the 'configure AI agent environments' prompt could be shown. Move OpenEditor to after PromptAndChainAsync so the full CLI interaction completes before the workspace switches. Fixes microsoft#15551
…et (microsoft#15586) * Allow filtering endpoints from the default reference set (microsoft#15558) * Allow filtering endpoints from the default reference set * Update snapshots for codegen * Update the property to ExcludeReferenceEndpoint and make it false by default * Update test snapshot with outdated containerApps API version * release/13.2 --version check returns 13.2.1 now
…osoft#15637) * Fix guest apphost launch profile env propagation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Reuse launch profile env values Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Export more importable ATS hosting APIs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove legacy polyglot settings files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Unionize Foundry capability host export Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Unify addContainer ATS overloads Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refresh generated TS SDKs for addContainer union Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Regenerate polyglot codegen snapshots Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clarify TypeScript reference environment options Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Hide generated parameter ATS helper Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove stale addContainer remark Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Go polyglot keyword escaping Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix polyglot validation regressions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Preserve connection property ATS alias Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refresh polyglot codegen snapshots Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…fig.json (microsoft#15526) * Fix migration from .aspire/settings.json to aspire.config.json When the AppHost was found from legacy .aspire/settings.json, the UseOrFindAppHostProjectFileAsync method returned early without calling CreateSettingsFileAsync, so the migration to aspire.config.json never triggered. This fix ensures CreateSettingsFileAsync is called when createSettingsFile is true and the AppHost is found from settings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix migration test to use correct relative path Address Copilot review feedback: compute appHostPath relative to .aspire/ directory (not workspace root), normalize to forward slashes, and add a decoy project to ensure the legacy-settings resolution path is actually exercised rather than falling through to directory scanning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….3.amd64 (microsoft#15656) Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/b7e2024f-0d37-4adb-8b11-2b1845054540 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
…tings (microsoft#15686) * Deprecate Aspire.Hosting.NodeJs in CLI integration list Add Aspire.Hosting.NodeJs to the deprecated packages filter in both BundleNuGetPackageCache and NuGetPackageCache so it no longer appears in 'aspire add' integration listings. The replacement package is Aspire.Hosting.JavaScript. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Extract shared DeprecatedPackages static class Remove duplicated s_deprecatedPackages HashSet from both BundleNuGetPackageCache and NuGetPackageCache. Consolidate into a single DeprecatedPackages.All in NuGetPackageCache.cs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add Aspire.Hosting.NodeJs to deprecation filter tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use FrozenSet and IsDeprecated helper for immutability Replace mutable HashSet with FrozenSet and expose via DeprecatedPackages.IsDeprecated() to prevent accidental mutation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: David Fowler <davidfowl@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…/aspire (microsoft#15720) The darc-pub feed prefix changed from darc-pub-dotnet-aspire to darc-pub-microsoft-aspire when the repository moved to the microsoft org. Update the feed URL template and corresponding test assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/fc611917-02bd-4219-af17-9148bf5a7013 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
…rosoft#15599) * Add win-arm64 and linux-arm64 to CLI native archive build matrix Add native arm64 build targets to the CI pipeline so the dogfood script and release bundles include arm64 CLI binaries: - win-arm64 on windows-11-arm runner - linux-arm64 on ubuntu-24.04-arm runner Updates build-cli-native-archives.yml default matrix and adds per-OS build jobs in tests.yml following the existing pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use RID in job name to avoid duplicate names in Actions UI Address review feedback: with multiple targets sharing the same 'os' value, the job name 'Build CLI (ubuntu-latest)' appeared twice. Switch to matrix.targets.rids for unique names like 'Build CLI (linux-arm64)'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix RID detection to use runner.arch for arm64 support The RID computation hardcoded x64 for Linux and Windows, which would download wrong-arch NuGet packages if tests ever run on arm64 runners. Use runner.os + runner.arch to correctly map to the target RID. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Grpc.Tools to 2.80.0-pre1 for linux-arm64 compatibility Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/c45a0b4c-4ff5-4111-8d23-b713819a9ae4 Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com> * Change Grpc.Tools version to 2.68.1 Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/d4d41e10-f7c9-4607-9055-a79723c7bb5e Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com> * Update Grpc.AspNetCore and Grpc.Net.ClientFactory to 2.67.0 Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/44c9e832-0487-4919-ab10-676903a81175 Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com> * Update Grpc packages: AspNetCore/ClientFactory to 2.76.0, Tools to 2.68.1 via VersionOverride * Apply suggestion from @JamesNK --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com>
…rosoft#15726) * Skip name validation for ProjectRebuilderResource Rebuilder resources append '-rebuilder' to the parent resource name, which can exceed the 64-character limit. Since these resources are never deployed, skip validation by adding internal constructors to Resource and ExecutableResource that bypass ModelName.ValidateName. Fixes microsoft#15693 * Skip name validation for installer and venv creator resources JavaScriptInstallerResource, PythonInstallerResource, and PythonVenvCreatorResource also append suffixes to the parent resource name and could exceed the 64-char limit. These are never deployed, so skip validation for them as well. --------- Co-authored-by: James Newton-King <james@newtonking.com>
When a version range like >=0.1.1 matches multiple published versions, npm view returns multi-line output instead of a single version string. The existing code tried to parse the entire multi-line output as a single SemVersion, which failed. Extract the last (highest) version from the multi-line output format: @scope/pkg@version 'version' Also bumps the @playwright/cli version range from >=0.1.1 to >=0.1.3. Fixes microsoft#15738 Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…soft#15749) Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
…15709) * Fix SqlClient runtime asset layout on Unix Ensure bundled/prebuilt app hosts prefer runtime-specific assets when laying out NuGet packages so Microsoft.Data.SqlClient loads correctly on macOS and Linux. Add a regression test covering the runtime-target selection behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Prefer runtime-specific native assets Ensure LayoutCommand chooses the matching native runtime target for the output root even when a generic native asset with the same file name is also present. Extend the regression test to cover the override behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Cover RID target selection in layout tests Add regression coverage for project.assets.json files that contain both a base target and a runtime-specific target so LayoutCommand's RID-based target selection is validated directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address review feedback for RID fallbacks Derive portable RID aliases from the requested runtime identifier rather than the current process OS, fix Windows JSON escaping in the layout command tests, and add coverage for explicit RID fallback selection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address remaining PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address remaining review threads Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refactor layout command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clarify runtime graph source Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use restore RID targets for layout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix SQL Server native asset resolution Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Align SQL Server E2E with PR bundle flow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove redundant E2E wait text check Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Simplify layout target selection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Simplify E2E local channel setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Extract E2E local hive setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove redundant RID helper Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Negstad <David.Negstad@microsoft.com>
… trust (microsoft#15718) (microsoft#15722) * Use ASP.NET Core dev cert for DCP to avoid issues with ephemeral cert trust * Make using the dev cert for DCP configurable and opt-in * Update for DCP's new thumbprint based method of referencing a certificate from the cert store * Remove obsolete DcpHost TLS certificate tests The PrepareDcpTlsCertificateAsync implementation changed from writing PEM files to disk to storing a certificate thumbprint in memory (passed as --tls-cert-thumbprint to the DCP process). The 4 tests in DcpHostTests.cs were asserting PEM file existence which no longer applies. The method's logic is simple sequential early-returns with no complex branching, so these tests are not worth rewriting with log-based assertions. * Add support for testing DcpHost.CreateDcpProcessSpec * Update environment variable name --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… Functions and class library projects (microsoft#15714) (microsoft#15763)
… avoid binary level changes between runs (microsoft#15774) * Updated to cache pfx dev certs on Windows and Linux to avoid binary changes in persistent container usage * Fix garbled line * Update src/Aspire.Hosting/DeveloperCertificateService.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: David Negstad <David.Negstad@microsoft.com> Co-authored-by: David Negstad <50252651+danegsta@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16007Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16007" |
There was a problem hiding this comment.
Pull request overview
Merges release/13.2 into main, bringing forward updates across the Aspire CLI, polyglot apphost/codegen surface, and CI/build tooling (notably around RID-aware restore/layout and TypeScript scaffolding/templating).
Changes:
- Adds RID-aware NuGet restore/layout behavior (including runtime identifier graph usage) and strengthens bundle/layout validation requirements (DCP presence).
- Expands/adjusts ATS exports for polyglot app hosts and updates multiple polyglot validation apphosts/tests accordingly.
- Improves TypeScript scaffolding/templating (apphost-specific tsconfig, package.json merging) and updates CI workflows to build additional native CLI archives.
Reviewed changes
Copilot reviewed 104 out of 105 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/CreateLayout/Program.cs | Fail layout creation when DCP is missing to prevent invalid bundles. |
| tests/PolyglotAppHosts/Aspire.Hosting/TypeScript/apphost.ts | Extends TypeScript polyglot apphost coverage for new/updated capabilities. |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/TypeScript/apphost.ts | Adds Foundry polyglot coverage for capability host usage and parent access. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Sql/TypeScript/apphost.ts | Adds subnet + new output/lookup accessors coverage for Azure SQL polyglot. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.ServiceBus/TypeScript/apphost.ts | Adds parent/connection string expression coverage for Service Bus resources. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Redis/TypeScript/apphost.ts | Adds output reference/id coverage for Azure Redis polyglot surface. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Kusto/TypeScript/apphost.ts | Adds output reference coverage for Kusto cluster in polyglot apphost. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.EventHubs/TypeScript/apphost.ts | Adds parent/connection string expression coverage for Event Hubs hub resource. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.CognitiveServices/TypeScript/apphost.ts | Adds deployment parent/connection string expression coverage. |
| tests/Aspire.Hosting.Tests/ModelNameTests.cs | Adds regression coverage for long ProjectRebuilderResource names. |
| tests/Aspire.Hosting.RemoteHost.Tests/RestoreCommandTests.cs | New tests validating RID graph usage for portable runtime assets. |
| tests/Aspire.Hosting.RemoteHost.Tests/LayoutCommandTests.cs | New tests validating runtime-target preference and structured asset preservation. |
| tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj | Adds Aspire.Managed project reference for remote host tool command tests. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TypeScriptLanguageSupportTests.cs | New tests for TypeScript scaffolding output + runtime spec behavior. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/HostingContainerResourceCapabilities.verified.txt | Updates snapshot for newly exported container capabilities/dispatchers. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/HostingAddContainerCapability.verified.txt | Updates snapshot for addContainer union DTO support + source location. |
| tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/HostingAddContainerCapability.verified.txt | Updates Rust snapshot for addContainer union DTO + source location. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/HostingAddContainerCapability.verified.txt | Updates Python snapshot for addContainer union DTO + source location. |
| tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java | Updates generated Java snapshot for new DTOs and capability methods. |
| tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/HostingAddContainerCapability.verified.txt | Updates Java snapshot for addContainer union DTO + source location. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/HostingAddContainerCapability.verified.txt | Updates Go snapshot for addContainer union DTO + source location. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/AtsGoCodeGeneratorTests.cs | Adds test ensuring Go keyword parameters are sanitized in generated code. |
| tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| tests/Aspire.Cli.Tests/Projects/PrebuiltAppHostServerTests.cs | Adds test ensuring project-local config channel overrides global channel. |
| tests/Aspire.Cli.Tests/Projects/GuestRuntimeTests.cs | Improves logging test setup and adds migration-file creation tests. |
| tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectTests.cs | Adds test for merging launch profile env + additional env vars for guest runtime. |
| tests/Aspire.Cli.Tests/Projects/AppHostServerProjectTests.cs | Updates regression test comments + config format from legacy settings to aspire.config.json. |
| tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs | Updates expected staging feed URL template. |
| tests/Aspire.Cli.Tests/Packaging/PackageChannelTests.cs | Updates staging feed URL used in tests. |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Switches test to AspireConfigFile and asserts SDK version persistence. |
| tests/Aspire.Cli.Tests/BundleServiceTests.cs | Adds test verifying version fingerprint changes when CLI binary changes. |
| tests/Aspire.Cli.Tests/BundleNuGetServiceTests.cs | New test for bundle package hash changing when managed binary changes. |
| tests/Aspire.Cli.Tests/Agents/PlaywrightCliInstallerTests.cs | Minor formatting adjustment in test helper. |
| tests/Aspire.Cli.EndToEnd.Tests/TypeScriptStarterTemplateTests.cs | Improves SourceBuild E2E setup (bundle layout mount + local channel config). |
| tests/Aspire.Cli.EndToEnd.Tests/TypeScriptSqlServerNativeAssetsBundleTests.cs | New E2E validating native runtime assets with SQL Server polyglot scenario. |
| tests/Aspire.Cli.EndToEnd.Tests/TypeScriptPolyglotTests.cs | New E2E validating brownfield Vite repo augmentation at repo root. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs | Adds local channel preparation helpers and writing local channel settings. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs | Adds helper to mount local channel packages + relaxes version verification logic. |
| src/Shared/NpmVersionHelper.cs | Adds shared npm-style semver parsing/comparison helper. |
| src/Shared/BundleDiscovery.cs | Uses RuntimeInformation.RuntimeIdentifier for current RID detection. |
| src/Aspire.TypeSystem/RuntimeSpec.cs | Adds MigrationFiles to support runtime upgrade scenarios. |
| src/Aspire.Managed/NuGet/Commands/RestoreCommand.cs | Adds --rid support and uses embedded runtime identifier graph for restores. |
| src/Aspire.Managed/NuGet/Commands/LayoutCommand.cs | Adds --rid and updates layout logic to prefer runtime-specific targets/assets. |
| src/Aspire.Managed/Aspire.Managed.csproj | Embeds SDK runtime identifier graph as a managed resource. |
| src/Aspire.Hosting/ResourceBuilderExtensions.cs | Adds ATS dispatcher exports for connection properties, relationships, and reference env injection. |
| src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs | Exports addProjectWithoutLaunchProfile for polyglot app hosts. |
| src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs | Adds polyglot export for generated parameter default values. |
| src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs | Adds polyglot addContainer union overload + dispatcher exports for build args and cert paths. |
| src/Aspire.Hosting/Ats/ReferenceEnvironmentInjectionOptions.cs | New DTO for reference-environment injection options. |
| src/Aspire.Hosting/Ats/AddContainerOptions.cs | New DTO for addContainer image/tag options. |
| src/Aspire.Hosting/Aspire.Hosting.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| src/Aspire.Hosting/ApplicationModel/ParameterDefault.cs | Marks GenerateParameterDefault as an ATS DTO. |
| src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs | Adds polyglot capability-host exports and union-based capability host association. |
| src/Aspire.Hosting.Foundry/FoundryResource.cs | Exposes FoundryResource to ATS via AspireExport. |
| src/Aspire.Hosting.Foundry/FoundryDeploymentResource.cs | Makes Parent property available to polyglot app hosts. |
| src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs | Adds apphost tsconfig + package.json generation for greenfield/brownfield. |
| src/Aspire.Hosting.CodeGeneration.TypeScript/Aspire.Hosting.CodeGeneration.TypeScript.csproj | Adds shared NpmVersionHelper link + Semver package reference. |
| src/Aspire.Hosting.CodeGeneration.Rust/AtsRustCodeGenerator.cs | Sanitizes snake_case identifiers via existing identifier sanitizer. |
| src/Aspire.Hosting.CodeGeneration.Go/AtsGoCodeGenerator.cs | Uses sanitized local identifiers (keyword-safe) for parameters. |
| src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs | Adds union-based polyglot exports for existing-resource configuration. |
| src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs | Makes output references and DB dictionary available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs | Removes statement claiming method isn’t available in polyglot app hosts. |
| src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusTopicResource.cs | Makes Parent/ConnectionStringExpression available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusSubscriptionResource.cs | Makes Parent/ConnectionStringExpression available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs | Marks AzureServiceBusResource as exported to polyglot app hosts. |
| src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusQueueResource.cs | Makes Parent/ConnectionStringExpression available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.Redis/AzureManagedRedisResource.cs | Makes output references available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkResource.cs | Marks AzureVirtualNetworkResource as exported to polyglot app hosts. |
| src/Aspire.Hosting.Azure.Network/AzureSubnetResource.cs | Marks AzureSubnetResource as exported to polyglot app hosts. |
| src/Aspire.Hosting.Azure.Kusto/AzureKustoHealthCheckBuilderExtensions.cs | Refines AspireExportIgnore reason text. |
| src/Aspire.Hosting.Azure.Kusto/AzureKustoClusterResource.cs | Makes output references available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsResource.cs | Marks AzureEventHubsResource as exported to polyglot app hosts. |
| src/Aspire.Hosting.Azure.EventHubs/AzureEventHubResource.cs | Makes Parent/ConnectionStringExpression available to polyglot app hosts. |
| src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIResource.cs | Marks AzureOpenAIResource as exported to polyglot app hosts. |
| src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIDeploymentResource.cs | Makes Parent/ConnectionStringExpression available to polyglot app hosts. |
| src/Aspire.Dashboard/Aspire.Dashboard.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| src/Aspire.Cli/Templating/Templates/ts-starter/tsconfig.apphost.json | Adds apphost-specific tsconfig to TS starter template. |
| src/Aspire.Cli/Templating/Templates/ts-starter/package.json | Updates TS starter scripts to include aspire:* scripts and aliases. |
| src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs | Persists AspireConfigFile (SDK version + channel) before restore. |
| src/Aspire.Cli/Scaffolding/ScaffoldingService.cs | Merges package.json for brownfield TS scaffolds; pre-adds JS hosting package when needed. |
| src/Aspire.Cli/Scaffolding/PackageJsonMerger.cs | New package.json merge implementation for brownfield TypeScript scaffolding. |
| src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs | Uses RID-aware restore and prefers aspire.config.json channel before legacy settings. |
| src/Aspire.Cli/Projects/GuestRuntime.cs | Adds migration-file creation before executing guest runtimes. |
| src/Aspire.Cli/Projects/GuestAppHostProject.cs | Passes launch-profile env vars through to guest apphost execution. |
| src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs | Prefers aspire.config.json channel before legacy settings. |
| src/Aspire.Cli/Packaging/PackagingService.cs | Updates staging feed URL template to microsoft-aspire. |
| src/Aspire.Cli/NuGet/BundleNuGetService.cs | Adds RID/managed-binary fingerprint into restore cache hashing and passes RID to tools. |
| src/Aspire.Cli/Layout/LayoutProcessRunner.cs | Removes redundant RuntimeIdentifierHelper wrapper. |
| src/Aspire.Cli/Bundles/BundleService.cs | Improves bundle version fingerprinting to trigger re-extraction on binary changes. |
| src/Aspire.Cli/Aspire.Cli.csproj | Adds shared NpmVersionHelper compilation link and Semver reference usage support. |
| playground/TestShop/MyFrontend/MyFrontend.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| playground/TestShop/BasketService/BasketService.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| playground/Stress/Stress.TelemetryService/Stress.TelemetryService.csproj | Pins Grpc.Tools with VersionOverride/PrivateAssets. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure/ValidationAppHost/aspire.config.json | Adds polyglot validation apphost config for Azure hosting package. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/aspire.config.json | Adds polyglot validation apphost config for Azure SQL scenario. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/aspire.config.json | Adds polyglot validation apphost config for Cognitive Services package. |
| eng/Bundle.proj | Restores DCP package using TargetRid-derived BuildOs/BuildArch for cross-compilation correctness. |
| .github/workflows/tests.yml | Adds Linux ARM64 CLI archive build and updates dependencies for test jobs. |
| .github/workflows/run-tests.yml | Improves RID mapping by considering runner OS + architecture. |
| .github/workflows/build-cli-native-archives.yml | Expands default target matrix and improves naming to include additional RIDs. |
| catch (Exception ex) | ||
| { | ||
| logger.LogWarning(ex, "Failed to parse package.json content, using scaffold output as-is."); | ||
| return scaffoldContent; | ||
| } |
There was a problem hiding this comment.
In the error path, Merge() returns the scaffold content when parsing fails, which will cause ScaffoldingService to overwrite an existing on-disk package.json and potentially lose user content. Safer behavior is to preserve the existing file (return existingContent) or fail the scaffold operation with a clear error so the user can fix the JSON manually.
There was a problem hiding this comment.
@copilot - log a new issue to track this and #16007 (comment) feedback below.
| catch (Exception ex) | ||
| { | ||
| logger.LogWarning(ex, "Failed to merge package.json content, using scaffold output as-is."); | ||
| return scaffoldContent; | ||
| } |
There was a problem hiding this comment.
Similarly, if the merge operation throws, returning scaffoldContent will overwrite the user's existing package.json. Prefer returning the original existingContent (and warning) or surfacing an error to prevent data loss.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TypeScriptLanguageSupportTests.cs
Outdated
Show resolved
Hide resolved
Replace manual temp directory creation with the shared TestTempDirectory helper in GuestRuntimeTests and TypeScriptLanguageSupportTests for secure temp directory creation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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.
|
|
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.
|
The Java codegen's GenerateUnionOverloads previously skipped methods with more than one union parameter (e.g. runAsExisting(AspireUnion name, AspireUnion resourceGroup)), leaving only the AspireUnion-typed method exposed. Since AspireUnion.of() is package-private, user code could not call these methods. Extend the codegen to generate convenience overloads for all combinations of concrete types when multiple union parameters are present. For example, runAsExisting with two string|ParameterResource union params now generates four overloads: (String,String), (String,ParameterResource), (ParameterResource,String), (ParameterResource,ParameterResource) — each delegating to the AspireUnion version. Also restore the Java polyglot validation AppHost to use plain types instead of AspireUnion.of() wrapping. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@sebastienros - pay close attention to c313d90. Java code gen wasn't handling methods with multiple Union parameters. Now it does. |
NOTE: USE A MERGE COMMIT - DON'T SQUASH!
Merging the latest
release/13.2changes intomain.DcpExecutor.cs, which I just acceptedmainbecuase all changes in release/13.2 were already in main, and we did a major refactoring.