Repository navigation
Remove unnecessary friend assembly declarations - #19620
Conversation
Audit InternalsVisibleTo usage and remove grants that no longer have internal-member consumers. Move Kubernetes process helpers into the consuming assembly and expose the Radius endpoint metadata needed across the assembly boundary. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1f56fecd-4fc8-419a-bfb7-b27c346f506a
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19620Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19620" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Reduces unnecessary friend-assembly access while preserving Kubernetes and Radius integration behavior.
Changes:
- Removes redundant
InternalsVisibleTodeclarations. - Shares process helpers through the Kubernetes assembly.
- Exposes HTTPS launch-default metadata to external integrations.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting/Aspire.Hosting.csproj |
Removes five friend assemblies. |
src/Aspire.Hosting/ApplicationModel/ProjectLaunchDefaultsAnnotation.cs |
Makes HTTPS endpoint metadata public. |
src/Aspire.Hosting.Testing/Aspire.Hosting.Testing.csproj |
Removes CLI test friendship. |
src/Aspire.Hosting.Redis/AssemblyInfo.cs |
Removes redundant source-level friendship. |
src/Aspire.Hosting.Kubernetes/Aspire.Hosting.Kubernetes.csproj |
Compiles shared process and utility helpers. |
src/Aspire.Hosting.Dotnet/Aspire.Hosting.Dotnet.csproj |
Removes test friendship. |
src/Aspire.Hosting.Docker/AssemblyInfo.cs |
Removes redundant source-level friendship. |
src/Aspire.Hosting.CodeGeneration.TypeScript/Aspire.Hosting.CodeGeneration.TypeScript.csproj |
Removes CLI friendship. |
src/Aspire.Hosting.CodeGeneration.Rust/Aspire.Hosting.CodeGeneration.Rust.csproj |
Removes CLI friendship. |
src/Aspire.Hosting.CodeGeneration.Python/Aspire.Hosting.CodeGeneration.Python.csproj |
Removes CLI friendship. |
src/Aspire.Hosting.CodeGeneration.Java/Aspire.Hosting.CodeGeneration.Java.csproj |
Removes CLI friendship. |
src/Aspire.Hosting.CodeGeneration.Go/Aspire.Hosting.CodeGeneration.Go.csproj |
Removes CLI friendship. |
src/Aspire.Hosting.Azure.Kubernetes/Aspire.Hosting.Azure.Kubernetes.csproj |
Uses Kubernetes-provided process helpers. |
src/Aspire.Hosting.Azure.ContainerRegistry/Aspire.Hosting.Azure.ContainerRegistry.csproj |
Removes Azure test friendship. |
Keep the endpoint identity readable by deployment integrations while reserving mutation for Aspire.Hosting. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1f56fecd-4fc8-419a-bfb7-b27c346f506a
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 50 / 102 test projects · 5 jobs, from 14 changed files. Selected test projects (50 / 102)
Selected jobs (5)
How these were chosen — grouped by what changed
🔧 show 28
🔧 🔧 🔧 🔧 🔧 🔧 📦 affected project 🔧 🔧 🔧 🔧 🔧 🔧 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/Aspire.Hosting/ApplicationModel/ProjectLaunchDefaultsAnnotation.cs:30
- Making this getter public exposes framework-generated launch-default state solely for first-party integration access. The only production consumers outside
Aspire.Hostingare the Kubernetes and Radius integrations, so this trades two scoped friendships for a publicly consumable implementation detail—even though the containing type is experimental. Keep it internal and retain those friendships, or introduce a deliberately reviewed public abstraction for identifying synthetic endpoints.
public EndpointAnnotation? DefaultHttpsEndpoint { get; internal set; }
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (1): Evidence reviewed: The five Other changes in the PR (removing No documentation changes are needed for this PR. |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |
Radius reads internal members of Aspire.Hosting that have no public equivalent -- ProjectLaunchDefaultsAnnotation.DefaultHttpsEndpoint is the clearest example. Main removed the Aspire.Hosting.Radius friend declaration in #19620 as unnecessary, which was true of Radius as it stood on main, but the backing-resource work in this PR reintroduced the dependency. Because the branch never modified that hunk, the three-way merge took main's deletion, so the merged tree failed to build even though the branch built on its own. Merging main and restoring the entry here records the decision in branch history instead of leaving it to be silently dropped again. This also replaces the earlier attempt to pull KnownRelationshipTypes and EnvironmentVariableNameEncoder in as $(SharedDir) Compile items. That fixed the merged build but broke the branch-only build with CS0436, because those types were then defined in two places; it also could not have addressed DefaultHttpsEndpoint, which is not shared source. Co-authored-by: Copilot <[email protected]>
Main removed the Aspire.Hosting -> Aspire.Hosting.Kubernetes friend assembly declaration (#19620), which this branch's cross-assembly volume design depended on. Restructure so Kubernetes needs exactly one public type instead of three internal ones: - Add public VolumeMountBindingAnnotation, replacing the internal VolumeEnvironmentVariableAnnotation and VolumeMountPathResolverAnnotation. It carries the declared environment variable, the deployed mount path, and an optional run-mode host path resolver, and exposes ResolvePath so the inner/outer-loop decision stays in one place. - Move VolumeMountPathResolver to src/Shared and compile it into both Aspire.Hosting and Aspire.Hosting.Kubernetes, matching how main shared-sourced the process helpers. - Drop the internal WithVolumeCore/AddRunModePathResolver seam from Kubernetes; it now declares annotations directly. Also carries the TypeScript projector capability-collision fix forward onto main's AssignOptionsInterface. Widening now collapses WithProjectVolumeOptions and WithExecutableVolumeOptions into the shared WithVolumeOptions, with no numeric-suffix interfaces. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c14c394f-3a84-4e28-a6a6-9faceabbb7fa
Radius reads internal members of Aspire.Hosting that have no public equivalent -- ProjectLaunchDefaultsAnnotation.DefaultHttpsEndpoint is the clearest example. Main removed the Aspire.Hosting.Radius friend declaration in #19620 as unnecessary, which was true of Radius as it stood on main, but the backing-resource work in this PR reintroduced the dependency. Because the branch never modified that hunk, the three-way merge took main's deletion, so the merged tree failed to build even though the branch built on its own. Merging main and restoring the entry here records the decision in branch history instead of leaving it to be silently dropped again. This also replaces the earlier attempt to pull KnownRelationshipTypes and EnvironmentVariableNameEncoder in as $(SharedDir) Compile items. That fixed the merged build but broke the branch-only build with CS0436, because those types were then defined in two places; it also could not have addressed DefaultHttpsEndpoint, which is not shared source. Co-authored-by: Copilot <[email protected]>
…upgrade to Radius 0.60 (#19555) * Project Radius backing resource connections from recipe outputs Fixes #18935. `RadiusEnvironmentResource.GetHostAddressExpression` applied the Radius container recipe's ClusterIP Service rule (`{name}-{name}.<ns>.svc.cluster.local`) to every endpoint resolved for a Radius consumer. Backing resources (Redis, PostgreSQL, MongoDB, SQL Server, RabbitMQ) are provisioned by a Radius *recipe* rather than as a `Radius.Compute/containers` workload, and the recipe names its own Service, so those addresses never resolved. Aspire also composed its own locally-generated password parameters into the connection strings, which the recipes never receive. The blast radius was wider than the issue described: a single `WithReference` emits both `ConnectionStrings__x` and the splatted `X_HOST`/`X_PORT`/ `X_PASSWORD`/`X_URI` connection properties, so guarding only the connection string would have left most of them broken. Substitute at the value-provider level instead, so connection strings, URIs, splatted properties and `services__*` all compose correctly without this package duplicating any connection-string format: * host/port -> `<resource>.properties.host` / `.port`, wrapped in `string(...)` when standalone since the port output is an int and env values are strings. * password on legacy `Applications.*` types -> `<resource>.listSecrets().password`. * password/username/database on `Radius.*` UDTs -> passed into the recipe as `recipe.parameters`, so both sides agree by construction. These are required recipe inputs that were previously never emitted at all. Fail fast rather than emit a silently unreachable value: backing-resource endpoints resolved through the compute-environment helpers, references across Radius environments, types with no host/port output, more than one database on a server resource, and a credential parameter shared with a `listSecrets()` owner. The new exception deliberately does not derive from `InvalidOperationException` so the existing "skip unresolvable endpoint" catch cannot swallow it. Projected values resolve their Bicep identifier lazily and are re-emitted after `ConfigureRadiusInfrastructure` callbacks when a target was renamed, rejected when it was removed, and left alone when the callback set the value itself. Co-authored-by: Copilot <[email protected]> Copilot-Session: 720998b6-ff9f-4ec9-9ad9-460909f7a186 * Address review findings on Radius backing resource projection Fixes the findings from the code-review, hosting-integration-authoring and architecture reviews of the backing-resource projection change. Error handling. The env-var loop's `catch (InvalidOperationException)` was positional rather than structural: it silently dropped every value produced by an Azure Bicep output, at Debug level, because that is the type `BicepOutputReference.Value` happens to throw. The two conditions the publisher genuinely means to skip -- a value only knowable after another deployment, and a reference to an endpoint the target does not declare -- are now raised as `RadiusUnresolvableValueException` and logged at Warning; everything else fails the publish. Exception contract. `RadiusBackingResourceEndpointException` is now public and lives in `Aspire.Hosting.Radius`, because it reaches authors using the Kubernetes, Container Apps and App Service publishers through the shared endpoint resolver. Its message is written for that audience. Schema table. The `(string? PasswordSecret, bool TakesCredentialRecipeParameters)` pair could express "credential handled by neither mechanism" -- the shape of the bug this change fixes -- so it is replaced by a closed credential mode. Radius types with no verified schema are removed rather than left to project values that may not exist, and a test fails if an emitted type has no entry. Credentials. A user name supplied as a parameter is now projected from the recipe's output like the password already was, so the connection string no longer names a user the recipe never created. Replacing a credential the AppHost author chose is reported, since its value never reaches the cluster. Databases. The multi-database failure is scoped to databases consumers actually reference; a server with no database child publishes with a warning. Recipe inputs are resolved through a substitution-free path so a recipe cannot be fed its own output, and are rebuilt when a `ConfigureRadiusInfrastructure` callback swaps the construct they target. URI escaping. Values a reference expression marked as URI components are emitted as `uriComponent(...)`, so a recipe-generated password containing `@` or `/` cannot corrupt the URI it is placed in. Co-authored-by: Copilot <[email protected]> Copilot-Session: b3bee2e4-d5fd-4325-a4e7-090e4598c5e1 * Add a usage example to the public Radius endpoint exception The exception is the one piece of public API this change introduces, and catching it is the whole reason it is public, so show that. Co-authored-by: Copilot <[email protected]> Copilot-Session: b3bee2e4-d5fd-4325-a4e7-090e4598c5e1 * Write UDT credentials to schema properties and fix Postgres recipe Address the second round of review feedback on the Radius backing resource projection: - Credentials for Radius.* resource types are now written to the required top-level schema properties (username/password/database) instead of properties.recipe.parameters. The resource type manifests in radius-project/resource-types-contrib declare these as required properties and the recipes read them via context.resource.properties.<name>, so the previous shape would have failed schema validation at deploy time. - Point Radius.Data/postgreSqlDatabases at ghcr.io/radius-project/kube-recipes/postgresqldatabases:latest. The recipes/local-dev/postgresqldatabases artifact is not published. - Only skip an environment variable when the failing value provider is an IManifestExpressionProvider, so an InvalidOperationException from an arbitrary provider fails the publish instead of silently dropping the variable. - Add a KinD deployment end-to-end test that deploys a Radius Postgres backing resource and verifies the projected connection information. - Fix stale test class and method references in docs, and scope the README credential-replacement warning to legacy Applications.* resources. Co-authored-by: Copilot <[email protected]> Copilot-Session: 62ae7028-e315-4b1d-9d85-e7b58bc1e1f0 * Make the Radius Postgres deploy E2E install the contrib type rad install kubernetes registers only the built-in namespaces, and the pinned bicep extension does not carry Radius.Data/postgreSqlDatabases, so the resource compiled to a classic ARM resource and the deployment engine routed it to the Azure provider. Register the type with the control plane and import a locally published extension so the type is deployable, then deploy the published artifacts directly and assert the password projected into the consumer both matches the parameter and authenticates. Co-authored-by: Copilot <[email protected]> Copilot-Session: 62ae7028-e315-4b1d-9d85-e7b58bc1e1f0 * Address review feedback on Radius credential and type mapping - Map SqlServerServerResource to the legacy Applications.Datastores/sqlDatabases type with a listSecrets() projection. Radius.Data/sqlDatabases is not a real UDT (contrib defines Radius.Data/sqlServerDatabases) and its kube recipe is not published, so the emitted type could not resolve at deploy time. - Reject a parameter used as both the user name and the password of one backing resource. Substitutions are keyed by parameter identity, so the later user name assignment silently overwrote the password projection. - Register user-name parameters as recipe credentials on the schema-property path so sharing one with a listSecrets()-substituted resource is caught, and unwrap nested pass-through ReferenceExpressions when extracting a credential parameter (PostgreSQL exposes its user name that way). - Fail the publish when several databases are declared and none is referenced through WithReference, instead of picking the first child; a WithEnvironment callback consumer records no annotation, so the choice cannot be proven. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba * Renumber backing-resource diagnostics to ASPIRERADIUS069-074 The secret-store work that landed on main claimed ASPIRERADIUS061-068, which collided with the 060-065 range this branch used for backing-resource projection. Move the backing-resource codes to the free 069-074 range so each diagnostic still identifies exactly one condition. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba * Address automated review feedback on backing-resource connections Detect unrelated uses of a substituted credential parameter where the substitution is actually applied, during environment resolution, instead of by pre-scanning ResourceRelationshipAnnotations. The pre-scan could not see a parameter that only appears inside an EnvironmentCallbackAnnotation lambda, so that form silently received another resource's recipe secret. Values splatted from a referenced resource's own connection properties are matched back to their owner by manifest expression so they are not reported. Convert a numeric projection to a string before applying a string format in the composite-expression path. A `:uri`-formatted Radius port previously emitted uriComponent(resource.properties.port), which fails Bicep type checking; the lone-projection path already did the conversion. Name ASPIRERADIUS070 in the unrelated-use warning so it can be mapped to the diagnostics table, and reject one parameter used as both the user name and the password on the RecipeInputProperties path. RegisterRecipeCredential only rejects sharing across different owners, so PostgreSQL previously published successfully despite the documented restriction. Correct the Radius Postgres deploy E2E comment: `database` is optional in the pinned manifest and defaults to postgres_db. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba * Resolve conditional reference expressions to the selected branch A conditional ReferenceExpression carries an empty Format and exposes the union of both branches' value providers. The publisher's splice therefore resolved both branches — which can fail the publish on the inactive one — and then appended no parts, emitting the environment variable as an empty string. Select the branch first, matching ReferenceExpression.GetValueAsync and ExpressionResolver.EvalExpressionAsync. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba * Address review feedback: endpoint guard scope, Postgres database fallback, README Narrows the ASPIRERADIUS069 backing-resource guard to address properties only. Scheme and TlsEnabled are read from the endpoint declaration and describe no address, so a Radius-owned backing resource can answer them; rejecting them broke Kubernetes/ACA/App Service consumers that ask only for the scheme. Only Port and TargetPort need an explicit guard - the other four address properties reach it through GetHostAddressExpression via the lazy host. Service-port resolution is now lazy because it allocates a port as a side effect. Emits the user name as the Postgres 'database' property when a server declares no AddDatabase(...) child. The server-level connection string carries no database name, so clients default it to the user name while the recipe would have defaulted to postgres_db - a consumer with a custom user opened a database the recipe never created. Corrects the README claim that legacy rabbitMQQueues is undeployable because Aspire omits 'queue'. The property is optional and the built-in recipe defaults it to the Radius resource name. Adds a regression test for a portless non-HTTP endpoint, confirming the narrowed catch in the container environment loop does not drop the variable. Co-authored-by: Copilot <[email protected]> Copilot-Session: 75005945-442c-4e01-bcb8-130f4d6cd1cd * Report SQL databases the recipe does not create, document Postgres prerequisites The legacy Applications.Datastores/sqlDatabases recipe takes a `database` parameter but only echoes it back: the workload it deploys is a SQL Server with the `sa` login and nothing that runs CREATE DATABASE. AddDatabase(...) creates the database in run mode only, so a referenced AddSqlServer("sql").AddDatabase ("appdb") handed the consumer a connection string naming a database the deployment does not contain, with nothing in the output to explain it. Publishing now warns, scoped to *referenced* database children so an inert AddDatabase(...) stays silent (matching the ASPIRERADIUS072 precedent). It is a warning rather than a failure because the publisher cannot provision the database, the contrib Radius.Data/sqlServerDatabases type that could has no published Kubernetes recipe, and models whose application creates its own database (EF Core Migrate/EnsureCreated) deploy successfully today. Also documents that the PostgreSQL type registration steps are prerequisites rather than conveniences: against Radius 0.59, a model containing AddPostgres cannot be deployed by `aspire publish` + `aspire deploy` alone. Radius 0.60 carries Radius.Data/postgreSqlDatabases in the pinned Bicep extension and registers it by default, so both steps - and the E2E's artifact patching - disappear once the pinned extension version moves to 0.60. Co-authored-by: Copilot <[email protected]> Copilot-Session: 75005945-442c-4e01-bcb8-130f4d6cd1cd * Report server references that point at a database the recipe does not create A consumer that references a PostgreSQL server rather than one of its databases receives a connection string with no database name, so it opens the client's default - the database named after the user - while the recipe creates the AddDatabase(...) child instead. Run mode hides the mismatch because the Postgres image creates a database named after POSTGRES_USER alongside the ones Aspire creates per child, but a recipe provisions exactly one, so the reference is left pointing at a database that will not exist. Warns rather than failing, and leaves the child selection alone: the existing ASPIRERADIUS072 failure exists to protect consumers composed through a WithEnvironment callback, which record no reference annotation, and picking the user name here instead would silently break them. Also corrects the Radius 0.60 notes. Both the README and the E2E comment implied 0.60 makes a PostgreSQL model deploy untouched; it removes the Bicep extension and type registration steps, but the type is still absent from the default Kubernetes recipe pack (resource-types-contrib#276), so a recipe registration is still required. Co-authored-by: Copilot <[email protected]> Copilot-Session: 75005945-442c-4e01-bcb8-130f4d6cd1cd * Address review feedback on backing resource connections - Redis: the local-dev recipe deploys an unauthenticated server and emits no `secrets` output, so `listSecrets().password` would fail at deploy time. Model it as a new `NoCredential` credential mode that projects an empty password and warns with ASPIRERADIUS075. - Fail the publish (ASPIRERADIUS076) if a recipe input schema does not accept the credential properties we must supply, and fall back to schema-property assignment when the password is not a bare parameter. - Only throw for multiple unreferenced databases when the model actually has a resource that could have consumed one. - Reject secondary endpoints explicitly (ASPIRERADIUS077) instead of silently projecting them, and split the endpoint diagnostics into 071/077/079 so the failure mode is identifiable. - Resolve conditional ReferenceExpression conditions without declaring unused Bicep parameters; surface unresolvable conditions as ASPIRERADIUS078 and skip just that variable. - Make the RadiusResourceTypeConstruct credential properties internal and document why; add the inner-exception constructor to RadiusBackingResourceEndpointException. - Document the listSecrets()/@secure() trade, the Redis limitation, and the new diagnostics in the README. - E2E: pass the Postgres password through an owner-only ARM parameters file rather than the command line, and align the psql retry budget with the wait timeout. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3a1574a-b750-4a9c-afb0-d952485d6b73 * Derive env value provenance from the reference injection Structural equality of a ReferenceExpression does not establish where the value came from: an AppHost author can build the same expression, and `ReferenceExpression.Create($"{shared}")` renders identically to the owner's `password` connection property when `shared` is that parameter. Treating equal values as proof of origin suppressed ASPIRERADIUS070 for exactly the case it exists to report - a user's value silently replaced by the recipe credential. Provenance is now taken from the name the connection-property splat produces for a reference the resource actually declares. The connection name can be aliased and `WithReference` records the override nowhere, so the alias is recovered from the `ConnectionStrings__<name>` entry the same call injects - keeping an aliased reference attributable without accepting an arbitrary prefix. The value is still compared, as a second condition rather than the only one. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3a1574a-b750-4a9c-afb0-d952485d6b73 * Fail the publish for a TLS-enabled backing endpoint Scheme and TlsEnabled describe the container Aspire would have run locally, while the recipe decides what the deployed workload speaks - and no mapped Radius type publishes a transport-security output. `local-dev/rediscaches` starts plain Redis on 6379, so a TLS-enabled endpoint emitted `rediss://` and `ssl=true` against a plaintext server: a run-time handshake failure that points at neither the recipe nor the AppHost. Unlike a credential the recipe overrides, there is no value here that becomes correct at deploy time, so this fails the publish with ASPIRERADIUS081 rather than warning. Only the properties carrying the decision are rejected (Scheme, TlsEnabled, and Url, which embeds the scheme); Host, Port, and HostAndPort still project, since the address is right regardless of transport. Replaces the previously documented "TLS is read from the Aspire model" limitation in the README. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3a1574a-b750-4a9c-afb0-d952485d6b73 * Upgrade Radius to 0.60 and publish credential env vars as secret references Two related changes to the Radius publisher. Radius 0.60 renames the recipe-pack properties `recipeKind`/`recipeLocation` to `kind`/`source`. The API server silently drops unknown fields, so the old spelling produces an empty recipe pack with no publish error and no deploy failure — only a real cluster surfaces it. The rename ships together with the version pins for that reason. Also on 0.60: Redis and RabbitMQ move off the legacy `Applications.*` portable types onto their `Radius.*` UDTs, the RabbitMQ type is `Radius.Messaging/rabbitMQ` (not `rabbitMQQueues`), and credentials that a UDT consumes by resource ID are carried by a new `Radius.Security/secrets` resource. The legacy `Applications.Core/environments` shape is deliberately not renamed — it still uses `templateKind`/`templatePath`. RabbitMQ now requires an explicit user name (ASPIRERADIUS082). The 0.60 schema restricts `guest` to loopback connections, so a broker provisioned with the Aspire default would reject every workload pod, and a default user name reaches the publisher as literal text inside the connection string with no value to rewrite — so the broker and the connection string cannot be made to agree. Separately, container environment variables were always emitted as `env: { NAME: { value: ... } }`. Routing a credential through an `@secure()` Bicep param keeps it out of the published artifact, but the resolved string still lands in the Kubernetes Deployment spec and its rollout history, readable by anyone with `get deployment` in the namespace. Credential-bearing values are now emitted as `valueFrom.secretKeyRef` against a per-container `Radius.Security/secrets` resource. The whole composed expression moves into the secret rather than the container referencing a secret-backed fragment through kubelet's `$(VAR)` expansion. Aspire applies per-fragment percent-encoding via Bicep `uriComponent()` at deploy time, whereas `$(VAR)` substitutes at pod start — a password containing `@`, `:` or `/` would silently corrupt a connection string. Keeping composition in Bicep preserves the escaping exactly. `Radius.Security/secrets` is recipe-backed, so emitting one obliges the pack to carry its recipe. The pack is built before container environments are resolved, so registration is reconciled afterwards (and again after callbacks, which can add a secret of their own) rather than pre-scanned — resolving an environment runs the resource's environment callbacks, and a pre-pass would run every user callback twice. New diagnostics: ASPIRERADIUS082 (RabbitMQ `guest` user name), ASPIRERADIUS083 (credential in a variable whose name is not a valid Kubernetes secret key), and ASPIRERADIUS084 (a ConfigureRadiusInfrastructure callback removed a secret, or a key, that a container reads a credential from). The KinD end-to-end test now asserts the `secretKeyRef` shape, that the plaintext is absent from the Deployment JSON, and that the pod process actually receives the value. It could not be run locally; CI must prove it. Co-authored-by: Copilot <[email protected]> * Address review feedback on TLS, secret keys, and the deploy test Three review threads. `IComputeEnvironmentResource.GetEndpointPropertyExpression` answered Scheme, TlsEnabled and Url off the local EndpointAnnotation for a backing resource, so a Kubernetes/ACA/App Service consumer could be told `rediss`/`TlsEnabled=True` for a broker whose Radius recipe provisions plaintext transport — the same mismatch the publisher already rejects as ASPIRERADIUS081. The guard now runs on this path too, scoped to TLS-enabled endpoints, since no mapped Radius type publishes a transport-security output for the value to be derived from. `ToSecretKey` validated Kubernetes Secret data keys with a bare `[-._a-zA-Z0-9]+` character class, which accepts keys longer than 253 characters as well as `.`, `..` and `..`-prefixed names — all rejected by the API server. It now reuses `KubernetesName.IsValidSecretDataKey`, which already carries the complete contract, so an invalid key fails at publish time rather than when the Secret reaches the cluster. The PostgreSQL deployment test read `APPDB_PASSWORD` from `.value`, but credential-bearing variables are now published as `valueFrom.secretKeyRef`, so that read yields an empty password and psql would fail as an authentication error. It resolves the referenced Secret name and key and decodes the value, matching the RabbitMQ test. Co-authored-by: Copilot <[email protected]> * Pin the Redis and RabbitMQ recipes to a tag that exists The Radius deploy E2E failed with RecipeDownloadFailed for both `ghcr.io/radius-project/kube-recipes/rediscaches:latest` and `ghcr.io/radius-project/kube-recipes/rabbitmq:latest`: neither tag exists. resource-types-contrib publishes an immutable `<sha>` tag on every push to main, refreshes the floating `edge` tag alongside it, and moves `:latest` only when a recipe ships in a stable release. Its own workflow documents `<sha>` as "the tag Radius pins against". Both of these recipes post-date the last stable release, so they have `edge` and SHA tags and no `:latest` — the reference resolved to a 404, which the publisher cannot detect and which surfaces only when the deployment engine tries to pull the recipe. Both are now pinned to ebdeec95, the newest publish carrying both recipes ("Make RabbitMQ password optional"), which is byte-identical to `edge` today: the manifest digests match for both repositories. `edge` itself is not usable here because it floats, and an artifact must keep deploying the recipe it was published against. The other types keep `:latest`, which resolves for them. Documented in the README as a known limitation, since the SHA is visible in the recipe pack the publisher emits. Co-authored-by: Copilot <[email protected]> * Address review feedback on the recipe table, diagnostics coverage, and stale comments - Drop the Radius.Data/mongoDatabases row from s_defaultRecipeTemplates: it pointed a UDT at a legacy recipes/local-dev/ recipe, which both fails to pull and ignores the credentials Aspire sets. LegacyMongoDatabases is what the mapper emits, and its row already covers it. - Add EveryEmittedBackingType_HasADefaultRecipeWithAMatchingPrefix so the recipe table is held to the same contract as the connection-schema table: total over the emitted backing types, with each recipe prefix matching its namespace. That catches the Mongo pairing mechanically instead of by inspection. - Split setup from assertion in the no-plaintext-credential deploy check. `||` bound to the whole `&&` chain, so any setup failure short-circuited straight to the NOPLAINTEXT_OK marker and reported success without running the grep. - Cover ASPIRERADIUS086 (an unresolvable connection property fails the publish, unlike the container env-var skip) and pin ASPIRERADIUS080's code in the SQL database warning test. - Correct the sqlserverdatabases comment (the ghcr repo does not exist; it does not return 403) and the rabbitMQQueues -> rabbitMQ type name in the RadiusResourceTypeConstruct doc, and explain why the unreferenced legacy Redis and RabbitMQ constants are kept. Co-authored-by: Copilot <[email protected]> * Detect callback-only database consumers and correct impossible remediations Two review findings on #19555. ASPIRERADIUS080 only saw consumers recorded by a ResourceRelationshipAnnotation, so `WithEnvironment(ctx => ctx.EnvironmentVariables["CS"] = db)` — which builds its value inline and records no annotation — silently received a connection string naming a database the legacy `sqldatabases` recipe never creates. The warning is now driven off the union of the annotations and the connection strings actually resolved during the publish, which means it has to run after every container's environment has been built rather than inline with credential wiring. Separately, several diagnostics pointed at a remediation that cannot be followed: `username`/`password`/`database` are internal schema properties, so a ConfigureRadiusInfrastructure callback cannot set them, and RecipeParameters is not a substitute because it emits under a different part of the resource body. ASPIRERADIUS074 (secret removed, and the projected-property site, which also called a schema property a "recipe parameter") and ASPIRERADIUS086 now say what is actually possible. The container env var sites keep their advice: `Env` is public and genuinely settable from a callback. Co-authored-by: Copilot <[email protected]> * Lowercase the emitted Radius secret names The Kubernetes secrets recipe uses the Radius resource name verbatim as the core/Secret metadata.name (`name: secretName`, where `secretName = context.resource.name`), and a Kubernetes object name must be an RFC 1123 subdomain. The container recipe normalizes for itself (`var normalizedName = toLower(resourceName)`), so a mixed-case Aspire resource name deployed fine as a workload and broke only on the secret: AddContainer("MyApi", ...) with a credential-bearing variable emitted `MyApi-env-secret`, which the API server rejects at apply time. Both emitted secret names — the per-container env secret and the credential secret for a backing resource — now go through a single helper that lowercases. Aspire resource names are already limited to ASCII letters, digits, and non-trailing hyphens starting with a letter, so lowercasing is the only transformation RFC 1123 needs. Co-authored-by: Copilot <[email protected]> * Validate container env var forms after infrastructure callbacks ContainerEnvVarConstruct documents Value and SecretName/SecretKey as mutually exclusive, but nothing enforced it. A ConfigureRadiusInfrastructure callback could leave both forms set (or half a secretKeyRef) and the publisher would emit Bicep that Kubernetes rejects at deploy time. Add ValidateContainerEnvVarForms to the post-callback invariant checks, failing with new diagnostic ASPIRERADIUS087, and document why the ASPIRERADIUS071 backing-type throw stays a hard failure. Co-authored-by: Copilot <[email protected]> * Address review feedback: database-child provenance, Redis password docs, secret construct doc - Canonicalize connection-string provenance through ResolveToParent so a database child's connection string is attributed to the server that owns the recipe credential, and match splatted connection properties against the referenced resource's own properties while attributing them to that server. A normal AddDatabase(...) reference now only receives ASPIRERADIUS080. - README: distinguish an Aspire-generated Redis password (ASPIRERADIUS075) from an explicitly supplied one (ASPIRERADIUS085 publish failure). - RadiusSecuritySecretConstruct: document container env var secrets as a current use rather than later work. Co-authored-by: Copilot <[email protected]> * Address second review round: exception name, child-expression provenance - Rename RadiusBackingResourceEndpointException to RadiusBackingResourceProjectionException. It is also thrown for schema and credential failures (required username/password, RabbitMQ 'guest', ASPIRERADIUS086), so the 'Endpoint' name misdescribed what a caller catches. The type is new in this PR and not in the shipped API baseline. - Close the ASPIRERADIUS080 gap for a callback that assigns a database child's ConnectionStringExpression directly: the resolved expression is matched against each child's own and feeds the same consumption signal, so such a consumer now receives the diagnostic. Matching on the value is sound for this diagnostic because it is a statement about the value, not about provenance. Co-authored-by: Copilot <[email protected]> * Address round-3 review feedback on Radius backing resources Fixes the nine findings from review, plus three defects found while verifying them: - Re-register the secrets recipe through the same construction path as the first pass, so a callback that drops the entry gets it back with the environment-wide and type-scoped recipe parameters applied. - Narrow the conditional-condition catch to MissingParameterValueException and InvalidOperationException from a manifest expression, so unrelated failures are no longer swallowed. - Validate the final Kubernetes Secret name and data keys after callbacks (ASPIRERADIUS088), rather than letting the API server reject them at deploy. - Reject a Radius.Security/secrets credential whose key was removed or whose value was changed after the credential was already composed into consumers' connection strings (ASPIRERADIUS089), and run the callback-ownership check first so handing the property off stays legal. - Fail publish when two Radius resources resolve to one Kubernetes Secret and at least one of them creates it (ASPIRERADIUS090). Sealed stores claim through their validated manifest, because the apply step selects them from the application model and applies them even when a callback removed the emitted construct. - Reject a ContainerEnvVarConstruct left with nothing set (ASPIRERADIUS087). - Re-enable the AKS Radius deployment test and extend the kind end-to-end test with MongoDB, which is the only live coverage of listSecrets() password and username projection. Co-authored-by: Copilot <[email protected]> * Address round-4 review feedback on Radius backing resources The round-3 guards each fell short of what their own comments claimed. - Classify a conditional's condition by shape instead of by marker. Gating the ASPIRERADIUS078 skip on `Condition is IManifestExpressionProvider` was nearly vacuous: IExpressionValue derives from that marker, so a parameter, a reference expression or a connection string all carried it, and a genuine failure inside one was still downgraded to a warning that dropped the environment variable. IsDeploymentSubstituted mirrors the type dispatch in ResolveEnvPartsAsync, where the marker test is meaningful because it sits in the default arm. A conditional expression's ValueProviders is the union of its two branches and excludes its own Condition, so a nested conditional needs a dedicated case; a visited set keeps the walk terminating on a cyclic connection string and answers false there, so an incomplete traversal is never the reason a variable is dropped. ContainerImageReference is excluded from the default arm because it carries the marker but resolves eagerly, so its failure names a real configuration error. - Compare the credential entry's encoding alongside its value (ASPIRERADIUS089). The encoding decides how the recipe interprets the value, so flipping `string` to `base64` provisions a server with a credential no consumer holds while leaving the value byte-identical. - Validate an inline secret store's final StoreName (ASPIRERADIUS088). The collision pass already treats it as the Kubernetes object name, and ASPIRERADIUS049 only guards the pre-callback model name. Existing and sealed stores are excluded because they name their object through `resource`, matching the gate the collision pass uses. Co-authored-by: Copilot <[email protected]> * Address PR review feedback on Radius backing resources - Catch a parameter-supplied `guest` RabbitMQ user name in the ASPIRERADIUS082 guard. The guard only compared the rendered Bicep, which is a literal only for a literal user name — so supplying a parameter, the very remediation the diagnostic recommends, routed users around it. The parameter's value is now resolved at publish time. - Turn the silent Radius v0.59 incompatibility into a loud failure. A new `verify-radius-control-plane-{env}` pipeline step reads `rad version --output json` and fails with ASPIRERADIUS091 when the control plane is older than v0.60, before credential registration or sealed-secret apply mutate anything. An unreadable version is allowed through so the gate cannot become a new way for valid deploys to fail. - Mark DeployRadiusRedisRabbitMqAndMongoBackingResourcesToKind as [OuterloopTest]: three KinD + Radius control-plane installs per PR run exceeded the per-PR CI budget. - Replace the discouraged Assert.DoesNotContain checks in the CLI E2E test with a single assertion over the complete emitted resource type set. - Correct the comment on UnauthenticatedBackingResource_DoesNotLeakAspireGeneratedPasswordParameter: Redis's recipe publishes no credential output, so the projected values are empty rather than reading listSecrets(). - Fix the "Securitity" test name typo. Co-authored-by: Copilot <[email protected]> * Address second-round Radius review feedback Control plane version gate now inspects the right cluster (blocking). `rad version` accepts no context flag and leaves the CLI's KubeContext unset, so the gate was reading whatever context the ambient kubeconfig happened to point at rather than the cluster `rad deploy` targets — it could approve an unsupported 0.59 cluster or reject a supported one. Extracted the workspace kube-context resolver out of SealedSecretApplyStep into a shared RadiusWorkspaceKubeContext (including the ASPIRE_RADIUS_KUBE_CONTEXT override) and had the gate flatten that single context into a throwaway kubeconfig with `kubectl config view --minify`, pointing the child `rad version` at it via KUBECONFIG. An unresolvable context now skips the gate rather than falling back to ambient state: a verdict about the wrong cluster is worse than no verdict. Fix ASPIRERADIUS056 on a valid model. One parameter used by both WithEnvironment and a type-scoped recipe parameter allocated two Bicep params for one Aspire parameter, because only GetOrAddEnvParameter reused the other allocator's declaration. Made the reuse bidirectional, and unified both allocators on BicepPostProcessor.SanitizeIdentifier — the SDK's NormalizeBicepIdentifier does not reserve `radius`, so a parameter by that name emitted a bare `param radius` colliding with the `extension radius` alias. Fix ASPIRERADIUS090 false positive. Two stores populated from one sealed manifest — the documented way to split a multi-key manifest — were reported as colliding writers. Byte-identical manifests are now coalesced and the diagnostic is reserved for distinct manifests targeting one object, which really do clobber each other. Reject a security secret with no name. An unset SecretName rendered as null, which the DNS-1123 check skipped, so publish emitted a Radius.Security/secrets block with no `name` that failed only at deploy. Add ASPIRERADIUS092 for kind/data-shape mismatches. Kind is public and freely mutable, so a callback could select basicAuthentication, certificate, azureWorkloadIdentity or awsIRSA without the keys those kinds require; the pinned recipe turns that into an invalid metadata.name at deploy. Literal recognized kinds are now validated; expression-valued and unrecognized kinds are left alone for forward compatibility. Also hardened the gate's process helper: cancellation kills the process tree, tolerates a refused kill, and reaps/observes the child under a bounded timeout so a child that will not die cannot hang a cancelled deploy. Co-authored-by: Copilot <[email protected]> * Separate the Radius.Security/secrets kind vocabulary from the legacy one, and validate the fields both types require Five findings from the second review pass. Radius.Security/secrets does not share the legacy Applications.Core/secretStores vocabulary. Its v0.60 kind enum is generic, certificate-pem, certificate-pkcs12, basicAuthentication, awsIRSA and azureWorkloadIdentity; the bare 'certificate' spelling belongs to the legacy type only. Validating the new type against the legacy table therefore missed certificate-pem's tls.crt/tls.key contract entirely while treating the invalid 'certificate' as recognized. RadiusSecuritySecretKinds is a separate table for the new type, TryParseRadiusTypeString stays the legacy parser, and ValidateSecretStoreTypeRequiredKeys gives it a post-callback caller so both surfaces are covered symmetrically. Both gates fail open on an unrecognized literal: a newer control plane may extend either enum, and there is no way for an AppHost author to opt out of a publish-time gate. The two legacy spellings are the exception -- 'certificate' as a kind and 'raw' as an encoding are not future values, they are the vocabulary this type replaced, so they are named and rejected with a message that points at the migration. ASPIRERADIUS087 now also checks a complete-but-invalid secretKeyRef. Both halves are copied verbatim into the pod spec, so a literal SecretName that is not a DNS-1123 subdomain, or a SecretKey that is not a valid Secret data key, previously passed publish and rad deploy and was rejected only when the API server created the pod. Expression-valued halves are still allowed: RewireContainerEnvSecrets assigns one on purpose. New ASPIRERADIUS093 covers the fields the type requires and the callback can drop. properties.environment and every data entry's value are required, and an unset BicepValue is simply omitted from the emitted Bicep rather than failing to compile, so the artifact published cleanly and failed only at Radius schema validation. A null or unset dictionary entry is rejected the same way; an entry whose whole wrapper is an expression still resolves at deploy time and is skipped. RadiusBackingResourceProjectionException deliberately does not take an [Experimental] attribute. ASPIRERADIUS004 gates the ConfigureRadiusInfrastructure escape hatch, but this exception is thrown from ordinary publish through the ungated AddRadiusEnvironment, so gating it would force a suppression purely in order to catch an exception an ungated API throws. The PR description claimed otherwise and has been corrected, along with a claim about a deployment test that was merged into the broader outerloop one. Co-authored-by: Copilot <[email protected]> * Repair credential secret scopes independently of their consumer RewireSecretResourceCredentials repaired a Radius.Security/secrets resource's EnvironmentId/ApplicationId inside the per-credential loop, after the guards that skip a credential whose consumer a callback removed or whose consumer property it reassigned. The secret outlives its consumer, though: it stays in options.SecuritySecrets and is still emitted. So a callback that renamed the environment and removed the consumer left the orphaned secret scoped to the symbol the rename retired, which reached the artifact as a dangling reference that only bicep compilation rejects, with nothing naming the callback responsible. Hoist the scope repair into an unconditional per-secret loop, mirroring RewireContainerEnvSecrets, which already had this shape. The repair is keyed per secret rather than per credential for the same reason called out there: the last-write-wins comparison only holds against the value the publisher wrote, so repairing once per credential would mis-detect on a second credential sharing a secret. Also split ASPIRERADIUS071, which covered two unrelated causes, so the diagnostic identifies which invariant broke. It now means only "an emitted Radius type has no connection schema row"; the two sites asserting that a credential-carrying secret has an environment to be scoped to move to ASPIRERADIUS094. Both README rows now state plainly that these are internal invariants an AppHost cannot trigger, rather than leaving readers hunting for an AppHost-side fix. Co-authored-by: Copilot <[email protected]> * Compile the shared types Radius uses into its own assembly Aspire.Hosting.Radius uses KnownRelationshipTypes and EnvironmentVariableNameEncoder but never included their source files, reaching them through InternalsVisibleTo on Aspire.Hosting instead. That is not a contract the shared sources offer, and main has since stopped granting it, so merging main into this branch fails the build with four errors: CS0122 on each of the three use sites, plus IDE0005 on the now-apparently-unused `using Aspire.Dashboard.Model`, which is the namespace KnownRelationshipTypes lives in. Include both files the way every other consumer does — Aspire.Hosting, Aspire.Hosting.Azure, Aspire.Hosting.DevTunnels and Aspire.Dashboard all take them as $(SharedDir) Compile items. That resolves all four errors, since the using becomes necessary again once the type resolves from source rather than from a referenced assembly. Co-authored-by: Copilot <[email protected]> * Revert "Compile the shared types Radius uses into its own assembly" This reverts commit 652281071639e8f3ea3b1e24656746419fb529a0. * Restore the Aspire.Hosting friend grant that Radius needs Radius reads internal members of Aspire.Hosting that have no public equivalent -- ProjectLaunchDefaultsAnnotation.DefaultHttpsEndpoint is the clearest example. Main removed the Aspire.Hosting.Radius friend declaration in #19620 as unnecessary, which was true of Radius as it stood on main, but the backing-resource work in this PR reintroduced the dependency. Because the branch never modified that hunk, the three-way merge took main's deletion, so the merged tree failed to build even though the branch built on its own. Merging main and restoring the entry here records the decision in branch history instead of leaving it to be silently dropped again. This also replaces the earlier attempt to pull KnownRelationshipTypes and EnvironmentVariableNameEncoder in as $(SharedDir) Compile items. That fixed the merged build but broke the branch-only build with CS0436, because those types were then defined in two places; it also could not have addressed DefaultHttpsEndpoint, which is not shared source. Co-authored-by: Copilot <[email protected]> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Validate RabbitMQ username at Radius deploy Co-authored-by: nellshamrell <[email protected]> * Isolate home kubeconfig for the Radius control plane gate Addresses review feedback: setting KUBECONFIG did not actually point `rad version` at the workspace's cluster. Parts of the Radius CLI load `clientcmd.RecommendedHomeFile` (~/.kube/config) directly through pkg/kubeutil and ignore KUBECONFIG, so a supported ambient cluster could let an unsupported workspace target pass the gate (or the reverse), reintroducing the silent broken deployment ASPIRERADIUS091 exists to prevent. The minified kubeconfig is now written to <temp>/.kube/config and the child `rad version` runs against that directory as its home: HOME and USERPROFILE are redirected and HOMEDRIVE/HOMEPATH are removed, covering every variable client-go's homedir.HomeDir() consults on Unix and Windows. KUBECONFIG still points at the same file for the loaders that do honor it, so every loader inside `rad` reaches the workspace cluster. RunAsync now treats a null environment value as "remove this variable" so HOMEDRIVE/HOMEPATH can be cleared rather than blanked. Co-authored-by: Copilot <[email protected]> * Reject databases consumed but not provisioned by the Radius recipe Addresses two review findings. Database selection for a recipe-backed resource has to run before any container environment is resolved, so it can only see WithReference annotations. A mixed model defeated that: `WithReference(first)` plus a `WithEnvironment` callback resolving `second.ConnectionStringExpression` selected `first`, while the consumer received a connection string naming `second` — a database the recipe never creates, failing at run time with nothing in the generated Bicep to explain it. The consumption set that would have caught it was only read by the SQL Server ASPIRERADIUS080 warning pass. The selection is now recorded and validated in a deferred pass that runs once every container environment has been resolved, alongside the existing warning pass, and rejects any consumed database child other than the selected one with ASPIRERADIUS072. The database-child expression map is now derived from the emitted-type table rather than from the sets filled during the credential pass. Those sets are populated while that same pass triggers the map's first lookup, so a resource wired before its own selection was recorded would have been missing from the map and its consumers left unobserved. Also drops the branch/PR history from the Aspire.Hosting.Radius InternalsVisibleTo comment, keeping it focused on why the grant exists. Co-authored-by: Copilot <[email protected]> * Skip deploy-time RabbitMQ user name validation for removed resources A ConfigureRadiusInfrastructure callback can drop a broker from options.ResourceTypeInstances after its user-name parameter was recorded. The parameter can still reach the deploy step through another consumer, so the stale mapping failed 'aspire deploy' with ASPIRERADIUS082 naming a broker the deployment does not contain. Only brokers whose construct survived the callbacks are validated now. Co-authored-by: Copilot <[email protected]> * Reject undeployable secret literals and group databases by deployed name The pinned 0.60 Radius extension models Radius.Security/secrets 'kind' and 'encoding', and Applications.Core/secretStores 'type', as closed unions of string literals in types.json. An unrecognized literal therefore fails 'bicep build' during rad deploy, and a newer control plane cannot make it valid because the compile step reads the pinned definitions. Publishing one only produced an artifact that cannot deploy, so reject it where the message can name the resource. Expression-valued fields keep their escape path. Separately, database selection counted child resources rather than distinct deployed database names, so aliases for one physical database - AddDatabase("orders-a", "orders") alongside AddDatabase("orders-b", "orders") - were rejected with ASPIRERADIUS072 even though the single recipe-provisioned database satisfies both consumers. Co-authored-by: Copilot <[email protected]> * Flatten the gate kubeconfig and keep every RabbitMQ user-name owner kubectl config view --minify emits file paths for client certificates, keys and token files rather than inlining them. kubeconfig resolves relative paths against the file's own location, so relocating the export under the temporary home broke them: rad version failed and the control plane gate skipped, letting an unsupported version through. --flatten makes the export self-contained. A user-name parameter shared by several brokers also overwrote earlier owners in a one-to-one map, so removing whichever broker was recorded last dropped the deploy-time guest check for the brokers that survived. Every owner is kept now and the check applies while any of them remains live. Co-authored-by: Copilot <[email protected]> * Validate the re-pointed secret key and select a referenced database child Addresses two review findings on RadiusInfrastructureBuilder. RewireContainerEnvSecrets only treated a changed `SecretName` as a callback re-point, then validated the key the *publisher* generated rather than the one the variable currently carries. A callback that changed only `SecretKey` slipped past both: the original key was still present, so the publish succeeded while the emitted `secretKeyRef` named a key that does not exist. Radius accepts that artifact and it surfaces only as a pod that never starts. The current key is now resolved and validated against the generated secret, with a message that distinguishes a re-point from a removed key. A key that renders as a Bicep expression resolves at deploy time and a cleared key is already covered by ASPIRERADIUS087, so both are left alone. The recipe database selection fell back to `databaseChildren[0]` unless exactly one child was referenced. Multiple referenced children are legal when they alias one physical database, and ASPIRERADIUS072 has already rejected the case where they do not, so any referenced child is a correct choice. Selecting the first declared child instead pointed the recipe at an unreferenced database and made the deferred check reject a supported alias model. Regression tests cover a re-point to a missing key, a re-point to a key the callback added, and aliased children declared after an unreferenced child. Co-authored-by: Copilot <[email protected]> * Pin the '..'-prefixed secret data key rule with a regression test Review feedback asked for the `StartsWith("..")` check to be removed from KubernetesName.IsValidSecretDataKey on the grounds that apimachinery's IsConfigMapKey rejects only the exact keys "." and "..". It rejects the prefix too: IsConfigMapKey delegates to hasChDirPrefix, whose third case is `strings.HasPrefix(value, "..")` -> "must not start with '..'". Removing the check would let Aspire publish a key the API server rejects, moving the failure from publish time to deploy time, which is what this validation exists to prevent. Keeping the behavior and pinning it instead: a regression test asserts that `..token` is rejected with ASPIRERADIUS083, and the comment on IsValidSecretDataKey now says why the prefix rule exists on top of the character class (the kubelet atomic-writer's `..data` symlink) and names hasChDirPrefix, since the character class alone reads as though `..token` were acceptable. Co-authored-by: Copilot <[email protected]> * Keep exec credential helpers working under the control-plane gate's isolated home The gate redirects HOME so the parts of `rad` that read ~/.kube/config directly resolve the workspace's minified kubeconfig instead of the ambient cluster. `--flatten` inlines file-backed certificates, keys and token files, but it carries kubeconfig `exec` entries through untouched, and those shell out at load time. Every managed cluster authenticates that way — kubelogin for AKS, `aws eks get-token` for EKS, gke-gcloud-auth-plugin for GKE — and each helper resolves its credentials under the home directory. Under a bare redirect they found an empty home, failed to authenticate and took `rad version` down with them; because the gate fails open on a version it cannot read, it then skipped silently for exactly the population it is most needed for, letting an unsupported 0.59 control plane through. Each helper's state is now pinned back to the real home through the variable it already documents for relocating it (AZURE_CONFIG_DIR, AWS_CONFIG_FILE, AWS_SHARED_CREDENTIALS_FILE, CLOUDSDK_CONFIG). The kubeconfig stays isolated, so the gate still inspects the workspace's cluster. A variable the user has already set is left alone, since the child inherits the ambient environment and an explicit value may deliberately point elsewhere, and nothing is pinned when no home can be resolved. Also documents that RadiusInfrastructureOptions.SecuritySecrets carries two kinds of entry: credentials a backing resource consumes by resource ID, and the per-container secrets backing credential-bearing environment variables. Nothing distinguishes them structurally, so a callback treating every entry as backing-resource state can remove the secret a container reads from. Co-authored-by: Copilot <[email protected]> * Cover the control plane version gate end to end The gate's supporting tests pinned version parsing, the diagnostic text, the isolated environment and step ordering, but nothing invoked the path that decides. The deployment tests install a supported v0.60 control plane, so a regression that mishandled a successful command result — reading the version as unknown and falling through the fail-open branch — would have kept every test green while doing exactly what the gate exists to prevent: letting a v0.59 cluster accept a deploy that silently discards the recipe pack. VerifyControlPlaneVersionAsync now takes the resolved Kubernetes context and a command runner, with the existing two-argument entry point composing the real resolver and process runner. Only the parts that need a live cluster are supplied by the caller; the decision itself runs unchanged, including exporting the kubeconfig to a temporary home and reading the version back. The new tests cover a 0.59 control plane failing with ASPIRERADIUS091 and 0.60 proceeding, that `rad` is run against the exported workspace kubeconfig rather than the ambient cluster, and that every way the environment can be uncooperative rather than unsupported still fails open. Verified against a deliberately regressed gate: the unsupported-control-plane test is the one that fails. Co-authored-by: Copilot <[email protected]> * Replace branch-local context in three comments with the durable reason Each of these explained the change rather than the code, so all three would have read as stale or unresolvable once merged. The legacy recipe map cited "a future PR" for why the inner map is keyed by recipe name. The durable reason is that Radius keys recipes by name within a type, so the map matches the schema whether or not more names are ever emitted. The legacy application comment attributed the shared `name:` to review feedback, which records how the shape was arrived at rather than why it is required: the legacy application is the same Radius application as the UDT one, and only the Bicep identifier is suffixed so the two declarations do not collide. The recipe-location test referenced the `L5`/`L1` design identifiers. It now describes the behavior under test, and says why the assertion looks for `source:` rather than the `RecipeLocation` member it sets. Co-authored-by: Copilot <[email protected]> * Resolve the Radius workspace through rad rather than the process HOME The workspace resolver read <process HOME>/.rad/config.yaml directly. `rad` has no configuration environment variable — the config is selected by the global `--config` flag — so that file describes the workspace only when `rad` runs with its default config. Anything that passes `--config`, including a shim wrapping `rad`, leaves the resolver inspecting an unrelated config or finding none. The Radius deployment E2E test is exactly that case: it shadows `rad` with a workspace-local shim that injects `--config <workspace>/.rad/config.yaml` and sets HOME inside the shim only, while the Aspire process keeps the real HOME. The version gate therefore resolved no context and skipped, so the test that is supposed to demonstrate the gate would have passed against a control plane the gate exists to reject — the gate fails open by design, and here it failed open silently in its own coverage. Resolution now asks `rad workspace show --output json` first, reading connection.context. That runs the same executable the deploy will spawn, found through the same PATH and therefore the same shim and config, so the answer describes the cluster actually being targeted. The config file is still read when `rad` is absent or cannot answer, preserving the previous behavior for the default-config case, and an explicit ASPIRE_RADIUS_KUBE_CONTEXT still wins. The sealed-secret step resolves through the same path. Both steps deliberately share this resolver so they cannot disagree about which cluster is being inspected, and fixing only the gate would have broken that. It matters more there than for the gate: a misresolved context makes it apply a SealedSecret to the wrong cluster, which writes, where the gate only reads a version. ProcessRunResult and the command-runner delegate move to namespace scope as RadiusCommandRunner, since they are now shared rather than gate-specific. Verified the coverage catches the regression: with the rad answer discarded so resolution falls back to the file, TryResolve_PrefersTheContextRadItselfReports fails. Full suite is 655 passing. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: nellshamrell <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: nellshamrell <[email protected]> Copilot-Session: 720998b6-ff9f-4ec9-9ad9-460909f7a186 Copilot-Session: b3bee2e4-d5fd-4325-a4e7-090e4598c5e1 Copilot-Session: 62ae7028-e315-4b1d-9d85-e7b58bc1e1f0 Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba Copilot-Session: 75005945-442c-4e01-bcb8-130f4d6cd1cd Copilot-Session: e3a1574a-b750-4a9c-afb0-d952485d6b73
Description
Reduces the repository's friend-assembly surface after auditing every
InternalsVisibleTodeclaration and verifying actual internal-member usage from each named assembly.This removes 15 unnecessary declarations, including redundant source-level attributes in the Docker and Redis integrations. Required declarations remain in place where removing them produced internal-access or analyzer failures. To remove the production friendships from
Aspire.Hostingto the Kubernetes and Radius integrations, the Kubernetes process helpers are now compiled directly intoAspire.Hosting.Kubernetes, andProjectLaunchDefaultsAnnotation.DefaultHttpsEndpointis public.Validation:
Build succeeded with 0 warnings and 0 errors.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?