Skip to content

Add a connect command per resource to aspire describe and MCP list_resources - #22633

Open
Sébastien Ros (sebastienros) wants to merge 11 commits into
mainfrom
sebros/describe-connect-entry-per-resource
Open

Sébastien Ros (sebastienros) wants to merge 11 commits into
mainfrom
sebros/describe-connect-entry-per-resource

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Description

An agent (or a person) confirming a diagnosis at a dependency needs the container, the credential variables, the port that speaks the plain protocol, and the client tool. Today aspire describe --format Json gives the container ID and variable names, but whether the vendor's client works depends on the integration (TLS on the default port, no client in the image, renamed clients, HTTPS on a documented HTTP port...), so every skill carries per-integration workarounds.

This PR adds a connect entry per resource to aspire describe --format json (and --follow NDJSON) and to the MCP list_resources output: the command that reaches the resource with its own client. Each hosting integration declares its own entry, because only it knows its client, ports, TLS setup and credential variables. Resources without a declaration have no connect.

Fixes #22505
Part of #22511

User-facing usage

Output from a local run of an AppHost with these integrations (container names are the real DCP names; commands were executed successfully with the appended arguments shown below):

"connect": {
  "command": "docker exec pg-ejkccphh sh -c 'PGPASSWORD=\"$POSTGRES_PASSWORD\" exec psql -w -h 127.0.0.1 -p 5432 -U \"$POSTGRES_USER\" -d postgres \"$@\"' sh",
  "runs": "container",
  "tool": "psql",
  "append": "<psql options>, for example -c 'SELECT 1'"
}
"connect": {
  "command": "env AZURE_STORAGE_CONNECTION_STRING='DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8...GMGw==;BlobEndpoint=http://127.0.0.1:15974/devstoreaccount1;QueueEndpoint=http://127.0.0.1:15975/devstoreaccount1;TableEndpoint=http://127.0.0.1:15976/devstoreaccount1;' az storage",
  "runs": "host",
  "tool": "az",
  "append": "<command group and options>, for example container list",
  "note": "Requires the Azure CLI on the host. The account key is Azurite's well-known development key."
}
Integration runs tool Verified locally with
PostgreSQL container psql -c 'SELECT 1'
MySQL container mysql -e 'SELECT 1'
Redis (plain port; switches to the non-TLS secondary endpoint when TLS is enabled) container redis-cli PING, and SET/GET with WithPassword(null)
Valkey container valkey-cli PING
SQL Server (follows the WithRepl sqlcmd path) container sqlcmd -Q 'SELECT 1'
MongoDB (adds --tls + CA bundle when TLS is on) container mongosh --eval 'db.runCommand({ ping: 1 })' (over TLS)
RabbitMQ container rabbitmqctl list_queues
Azure Storage emulator (Azurite) host az container list -o table
Azure Cosmos DB emulator (vNext) host curl -i (HTTP gateway, WithoutHttpsCertificate())

Custom resources can declare their own entry. C# AppHost:

var nats = builder.AddContainer("nats", "nats")
    .WithEndpoint(targetPort: 4222, name: "tcp");

nats.WithConnectCommand(
    "nats",
    ConnectCommandLocation.Host,
    ReferenceExpression.Create($"nats --server nats://localhost:{nats.GetEndpoint("tcp").Property(EndpointProperty.Port)}"),
    append: "<command>, for example server info");

TypeScript AppHost:

await container.withConnectCommand("nginx", ConnectCommandLocation.Container, refExpr`exec nginx`);
await dockerContainer.withConnectCommand("curl", ConnectCommandLocation.Host, refExpr`curl -sS http://localhost:${endpointPort}/`, { append: "<curl options>", note: "Requires curl on the host." });

Design

  • Hosting API (experimental, ASPIRECONNECT001): ConnectCommandAnnotation, ConnectCommandLocation { Container, Host }, and WithConnectCommand(tool, location, command, append?, note?) (ATS-exported; last call wins). command is a ReferenceExpression that ends where the client's own arguments go.
    • Container: the command is a shell script. Tooling renders <docker|podman> exec <container-name> sh -c '<script> "$@"' sh, using the configured container runtime and the container name (not the 64-char ID), single-quote-escaping the script so appended arguments are forwarded to the client. Credentials are read from the container's own environment variables.
    • Host: the command is a host command line, usually using the published endpoint port.
  • Resolution in the AppHost (ConnectCommandResolver, called when building backchannel resource snapshots): adds ResourceSnapshot.Connect. The CLI maps it to ResourceJson.Connect (describe) and McpResourceJson.Connect (MCP; omitted rather than truncated when the command exceeds 2048 characters). Older CLIs ignore the new field; newer CLIs with older AppHosts see no connect.
  • Scope: container-backed integrations, including local Azure emulators (same container case). Designed for, not implemented: provisioned Azure cloud resources (no container, Entra ID/connection-string auth, az-style host tools); runs: host with endpoint references can express them. Follow-ups: NATS, Qdrant, Garnet (no client in image → host), Kafka (renamed client, unreachable advertised listener), Keycloak, Seq, Service Bus/Event Hubs emulators, and Azure cloud resources.
  • The audit's SQL Server SSL_CERT_DIR failure did not reproduce with sqlcmd -C on the current image (the in-container SSL_CERT_DIR list is set and SELECT 1 succeeds), so no workaround is included.
  • Related drafts touching nearby code: Flag OTLP-configured resources that have sent no telemetry in describe and MCP list_resources #22579 (telemetryReceived in describe JSON / list_resources) and MCP: compact default responses for list_traces, list_structured_logs, list_console_logs and list_resources #22580 (compact MCP list_resources); this PR only appends a field and a one-line preamble, so conflicts should be trivial.

Security considerations

The AppHost generates shell command lines that tooling prints and agents execute. To keep secrets out of them, the resolver only accepts commands whose ReferenceExpression references literals and endpoint values (recursively, including conditional branches); any parameter (secret or not), connection string or other value provider causes the entry to be omitted. Credentials are referenced by in-container variable name only. Scripts are single-quote escaped when wrapped in sh -c; integration scripts are authored by the integration and treated as trusted. The Azurite entry prints Azurite's publicly documented development account key. Endpoint values are resolved only when already allocated, so snapshot streaming never blocks on allocation.

Validation

  • dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": 2855 passed, 2 failed (PipelineOutputSelectionTests.GitMetadataOutsideConfiguredWorktreeUsesNonWorktreePolicy, git exit code 128 in this worktree environment; unrelated).
  • dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": 10600 passed, 2 failed (NuGetPackageOperationConfigurationTests.AllWritersMaterializeTheComposedSourceRestriction, PrebuiltAppHostServerTests.PrepareAsync_WithProjectReferencesAndExplicitChannel_...; machine-level nuget.org source leaking into expected source lists; unrelated).
  • New connect tests in Aspire.Hosting.{PostgreSQL,MySql,Redis,Valkey,SqlServer,MongoDB,RabbitMQ,Azure}.Tests (--filter-method per test): all passed.
  • Aspire.Hosting.CodeGeneration.{TypeScript,Go,Java,Python,Rust}.Tests (full): all passed after updating the generated-SDK snapshots for the new export.
  • Polyglot validation apphosts (tests/PolyglotAppHosts/Aspire.Hosting/*): aspire restore with the local CLI, then tsc --noEmit (TypeScript), pyright (Python), go build/go vet (Go), javac --enable-preview --source 25 (Java): all passed.
  • Manual end-to-end with Docker: started an AppHost with all integrations above via the local CLI, ran aspire describe --format json, and executed every connect.command with the appended arguments in the table: all succeeded. The Cosmos emulator with HTTPS could not start on this machine (macOS keychain refused exporting the dev-cert key), so HTTPS Cosmos was not validated end to end; the HTTP gateway was.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Hosting integrations can declare how to reach their resource with the
vendor's own client (ConnectCommandAnnotation / WithConnectCommand,
experimental ASPIRECONNECT001). The AppHost resolves the declaration into
the backchannel resource snapshot (container runtime, container name,
endpoint ports; parameters and connection strings are rejected so no
secret can appear) and the CLI surfaces it as 'connect' in
'aspire describe --format json' and MCP list_resources.

Declared for PostgreSQL, MySQL, Redis, Valkey, SQL Server, MongoDB,
RabbitMQ (in container) and the Azurite and Cosmos DB emulators (on host).

Relates to #22505 and #22511.

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

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

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

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

Or

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

@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Nov 24, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 24, 2026 23:28
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Focused review — problems only. The overall design (integration-owned declarations, endpoint-only allow-list, container name via DCP instance name, omission until allocation) is sound; I verified custom WithContainerName and the WSLc/Podman runtime names resolve correctly. Two issues below.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Connect-command resolution can abort or stall entire resource listings and watch streams instead of safely omitting unavailable commands.

6 open issues
What changed in this PR

Adds integration-declared connect commands to aspire describe JSON/NDJSON and MCP list_resources, helping users and agents query dependencies without maintaining per-integration connection recipes.

Changes:

  • Introduces experimental hosting APIs for container and host commands, including polyglot support.
  • Adds command declarations for seven container integrations and two Azure emulators.
  • Extends snapshot serialization, documentation, and tests for command resolution and output.
File Description
tests/​PolyglotAppHosts/​Aspire.Hosting/​TypeScript/​apphost.mts Exercises TypeScript connect declarations.
tests/​PolyglotAppHosts/​Aspire.Hosting/​Python/​apphost.py Exercises Python connect declarations.
tests/​PolyglotAppHosts/​Aspire.Hosting/​Java/​AppHost.java Exercises Java connect declarations.
tests/​PolyglotAppHosts/​Aspire.Hosting/​Go/​apphost.go Exercises Go connect declarations.
tests/​Aspire.Hosting.Valkey.Tests/​AddValkeyTests.cs Tests the Valkey client declaration.
tests/​Aspire.Hosting.Tests/​Backchannel/​ConnectCommandResolverTests.cs Tests resolution, filtering, quoting, and replacement.
tests/​Aspire.Hosting.Tests/​Backchannel/​AuxiliaryBackchannelRpcTargetTests.cs Tests connect metadata in resource snapshots.
tests/​Aspire.Hosting.SqlServer.Tests/​AddSqlServerTests.cs Tests sqlcmd paths and REPL alignment.
tests/​Aspire.Hosting.Redis.Tests/​AddRedisTests.cs Tests Redis plain-port selection with TLS.
tests/​Aspire.Hosting.RabbitMQ.Tests/​AddRabbitMQTests.cs Tests the rabbitmqctl declaration.
tests/​Aspire.Hosting.PostgreSQL.Tests/​AddPostgresTests.cs Tests the psql declaration.
tests/​Aspire.Hosting.MySql.Tests/​AddMySqlTests.cs Tests the MySQL client declaration.
tests/​Aspire.Hosting.MongoDB.Tests/​AddMongoDBTests.cs Tests mongosh commands with and without TLS.
tests/​Aspire.Hosting.CodeGeneration.TypeScript.Tests/​Snapshots/​HostingContainerResourceCapabilities.verified.txt Records the exported connect capability.
tests/​Aspire.Hosting.CodeGeneration.Rust.Tests/​Snapshots/​TwoPassScanningGeneratedAspire.verified.rs Records generated Rust connect APIs.
tests/​Aspire.Hosting.CodeGeneration.Python.Tests/​Snapshots/​TwoPassScanningGeneratedAspire.verified.py Records generated Python connect APIs.
tests/​Aspire.Hosting.CodeGeneration.Java.Tests/​Snapshots/​TwoPassScanningGeneratedAspire.verified.java Records generated Java connect APIs.
tests/​Aspire.Hosting.CodeGeneration.Go.Tests/​Snapshots/​TwoPassScanningGeneratedAspire.verified.go Records generated Go connect APIs.
tests/​Aspire.Hosting.Azure.Tests/​AzureStorageExtensionsTests.cs Tests Azurite commands and non-emulator omission.
tests/​Aspire.Hosting.Azure.Tests/​AzureCosmosDBExtensionsTests.cs Tests the Cosmos emulator gateway command.
tests/​Aspire.Cli.Tests/​Snapshots/​ResourceSnapshotMapperTests.MapToResourceJson_MapsConnectCommandAndOmitsItWhenAbsent.verified.json Records CLI connect JSON.
tests/​Aspire.Cli.Tests/​Snapshots/​ListResourcesToolTests.ListResourcesTool_PreservesCrossPageRelationshipsAndHiddenReplicaIdentity.verified.txt Updates the MCP guidance snapshot.
tests/​Aspire.Cli.Tests/​Snapshots/​ListResourcesToolTests.ListResourcesTool_ListsConnectCommandAndDropsCommandsThatWouldBeTruncated.verified.json Records MCP connect JSON.
tests/​Aspire.Cli.Tests/​Mcp/​ListResourcesToolTests.cs Tests MCP output and oversized-command omission.
tests/​Aspire.Cli.Tests/​Backchannel/​ResourceSnapshotMapperTests.cs Tests connect mapping and null omission.
src/​Shared/​Model/​Serialization/​ResourceJson.cs Defines the shared connect JSON shape.
src/​Aspire.Hosting/​ConnectCommandBuilderExtensions.cs Adds experimental WithConnectCommand.
src/​Aspire.Hosting/​Backchannel/​ConnectCommandResolver.cs Validates references and formats resolved commands.
src/​Aspire.Hosting/​Backchannel/​BackchannelDataTypes.cs Adds connect metadata to snapshots.
src/​Aspire.Hosting/​Backchannel/​AuxiliaryBackchannelRpcTarget.cs Resolves connect metadata during snapshot creation.
src/​Aspire.Hosting/​ApplicationModel/​ConnectCommandAnnotation.cs Defines command annotations and execution locations.
src/​Aspire.Hosting.Valkey/​ValkeyBuilderExtensions.cs Declares the valkey-cli command.
src/​Aspire.Hosting.SqlServer/​SqlServerBuilderExtensions.cs Declares sqlcmd and follows REPL customization.
src/​Aspire.Hosting.Redis/​RedisBuilderExtensions.cs Declares redis-cli using the plain-protocol endpoint.
src/​Aspire.Hosting.RabbitMQ/​RabbitMQBuilderExtensions.cs Declares the rabbitmqctl command.
src/​Aspire.Hosting.PostgreSQL/​PostgresBuilderExtensions.cs Declares psql with container credential variables.
src/​Aspire.Hosting.MySql/​MySqlBuilderExtensions.cs Declares mysql with container credential variables.
src/​Aspire.Hosting.MongoDB/​MongoDBBuilderExtensions.cs Declares mongosh with TLS-aware options.
src/​Aspire.Hosting.Azure.Storage/​AzureStorageExtensions.cs Declares a host Azure CLI command for Azurite.
src/​Aspire.Hosting.Azure.CosmosDB/​AzureCosmosDBExtensions.cs Declares a host curl command for the emulator.
src/​Aspire.Cli/​Mcp/​Tools/​ListResourcesTool.cs Exposes bounded connect metadata and usage guidance.
src/​Aspire.Cli/​Backchannel/​ResourceSnapshotMapper.cs Maps connect metadata into CLI JSON.
docs/​specs/​cli-output-formats.md Documents connect fields and shell usage.
docs/​list-of-diagnostics.md Documents the experimental API diagnostic.

Review effort: Balanced

- Integration defaults (Redis/MongoDB TLS refresh, SQL Server WithRepl) no
  longer replace a command the app declared with WithConnectCommand.
- Omit connect, rather than failing the snapshot, when the container runtime
  cannot be resolved or the command references an undefined endpoint.
- Reject target ports that are not fixed (DCP templates) and browser origins
  (which wait on URL callbacks).

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Unresolved issues can leave watched command metadata missing or stale, break MongoDB TLS connections for certificate paths containing spaces, and overwrite caller-defined connect commands in Azure integrations.

No open issues 🎉

3 previously missed issues

In code that hasn't changed since last review

Medium severity RunAsEmulator overwrites custom connect commands

src/​Aspire.Hosting.Azure.Storage/​AzureStorageExtensions.cs:216

Calling AddAzureStorage(...).WithConnectCommand(...).RunAsEmulator() replaces the caller's command with this integration default, contrary to the documented guarantee that defaults preserve AppHost declarations. Use the shared default-command helper and add regression coverage for a custom declaration before RunAsEmulator. The same issue occurs in src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs:223.

Medium severity Unquoted CA-file path breaks TLS when the path contains spaces

src/​Aspire.Hosting.MongoDB/​MongoDBBuilderExtensions.cs:218

The CA-file expansion is unquoted. With a supported CustomCertificatesDestination such as /custom certs, ContainerCreator supplies /custom certs/cert.pem, but this script passes /custom and certs/cert.pem as separate arguments to mongosh, so the TLS connection fails. Quote the inner CA-file variable while keeping --tlsCAFile a separate argument, and update the TLS command expectation to cover a path containing spaces.

Medium severity Referenced endpoint changes are not published in --follow mode

src/​Aspire.Hosting/​Backchannel/​AuxiliaryBackchannelRpcTarget.cs:1211

In --follow, a host command referencing another resource's endpoint can stay absent after allocation or retain an old port after reallocation, because only the referenced resource publishes an update. Track those endpoint changes and publish updated connect metadata for the command's owner, ensuring snapshot equality does not suppress the update. Add a watch regression test covering allocation and reallocation.

6 resolved since last review

Review effort: Balanced

…oints

- Azurite and Cosmos DB emulators declare their connect command with the
  shared default helper, so RunAsEmulator keeps an app-declared command.
- Quote the MongoDB CA bundle path so destinations with spaces stay one
  argument to mongosh.
- Only allow the resource's own endpoints in connect commands. The command is
  re-resolved when its own resource publishes a snapshot, so another
  resource's endpoint could otherwise stay missing or stale in watch streams.

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

Copy link
Copy Markdown
Contributor Author

Addressed the three issues from this review in c816a38:

  • RunAsEmulator overwrites custom connect commands: confirmed. Azurite and the Cosmos DB emulator now declare their command through the shared default helper, so a WithConnectCommand made before RunAsEmulator is kept. Tests: AzureStorageEmulatorKeepsAppDeclaredConnectCommand, CosmosDBEmulatorKeepsAppDeclaredConnectCommand.
  • Unquoted MongoDB CA-file path: confirmed (CustomCertificatesDestination flows into the bundle path). Now ${ASPIRE_MONGODB_REPL_CA_FILE:+--tlsCAFile "$ASPIRE_MONGODB_REPL_CA_FILE"}. Verified in the mongo image's /bin/sh (dash): CA='/custom certs/cert.pem' yields the two arguments --tlsCAFile and /custom certs/cert.pem, and nothing when unset. Updated the TLS expectation in MongoDBWithCertificateConnectCommandUsesTls.
  • Referenced endpoint changes not published in --follow: confirmed for endpoints of other resources. Instead of tracking cross-resource endpoint changes, connect commands may now reference only the resource's own endpoints. A connect command describes how to reach that resource, every in-repo declaration already uses only its own endpoints, and the owner republishes its snapshot when its endpoints change. Names are compared, so Azure emulator surrogate builders still work. Tests: OmitsCommandThatReferencesAnotherResourcesEndpoint, and WatchResourceSnapshotsAsync_RefreshesConnectCommandWhenOwnEndpointIsReallocated for a reallocation through the watch stream. The not-yet-allocated case is covered by OmitsCommandUntilEndpointIsAllocated. The docs and spec now state the rule.

…ct-entry-per-resource

# Conflicts:
#	src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelRpcTarget.cs
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The generated Docker command lacks exec -i, causing psql to exit instead of accepting queries and preventing piped SQL input; stdin support and corresponding snapshot coverage are needed.

1 open issue

Review effort: Balanced

Render container connect commands as 'exec -i' (without a TTY) so interactive
clients stay open and piped input reaches the client.

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because custom self-signed certificates can cause the advertised HTTPS connect command to fail host verification, despite trust being configured inside the emulator.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…ficate

The host-side curl command verifies the gateway certificate against the host's
trust store. Keep verification on and tell users to append --cacert for a
certificate the host does not trust, such as a custom self-signed one.

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

Copy link
Copy Markdown
Contributor Author

Re this review: the concern is valid. The Cosmos emulator's curl command runs on the host, so it checks the gateway certificate against the host's trust store, not the trust configured inside the container. The default Aspire dev certificate is normally trusted on the host, but a custom self-signed certificate from WithHttpsCertificate is not.

I kept certificate verification on instead of adding -k, because the advertised command is meant to be copied as-is by agents and people. The Cosmos connect.note now says to append --cacert <certificate file> when the host doesn't trust the certificate. CosmosDBEmulatorDeclaresHostCurlConnectCommandForGateway checks the note.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Faulted endpoint allocation can throw during validation outside the existing exception boundary, aborting resource listing or watch streams instead of omitting connect; validation needs to be covered by the catch and a regression test.

1 open issue

Review effort: Balanced

The orchestrator allocates custom resource endpoints asynchronously after
StartAsync returns, so reading AllocatedEndpoint directly raced on Windows CI.

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the connect-command handling presents critical command-injection and secret-disclosure risks.

1 open issue

Review effort: Balanced

A faulted allocation completes its snapshot, so inspecting it during
validation rethrew outside the resolver's exception boundary and aborted the
resource listing and watch stream. Validate inside that boundary.

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported that would block approval.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

…DB, notes

- Drop the absolute no-secrets claim from MCP guidance; document connect
  fields as public and omit an entry that contains a known secret value.
- State that connect.command is a POSIX sh command line.
- Reject endpoint references bound to networks other than localhost.
- Treat cancellation of the shared runtime probe by another caller as an
  optional-entry failure, retrying once.
- MongoDB reads credentials inside mongosh's --eval script, so they stay out
  of argv and dash-prefixed passwords work.
- Shorten the Cosmos note to fit the MCP text limit.

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical secret-filtering gaps allow apostrophe-containing credentials and secrets updated during runtime resolution to leak through published commands or notes.

2 open issues

Review effort: Balanced

Re-read the redaction history after connect resolution, which can await
container runtime detection, and also match secrets as they appear inside
the single-quoted container script.

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

Copy link
Copy Markdown
Contributor

Tests selector

56 / 101 PR test projects · 5 PR jobs, from 49 changed files.

Selected PR test projects (56 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Native.Core.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (5)

cli-starter-validation, extension-e2e, native-dashboard-validation, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 26 of the 56 selected test projects come from a single change — src/Aspire.Hosting/ApplicationModel/ConnectCommandAnnotation.cs.

🔧 src/Aspire.Hosting/ApplicationModel/ConnectCommandAnnotation.cs (changed source)
→ 26 via the project graph

show 26

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.EntraId.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Browsers.Tests (2 hops), Aspire.Hosting.Containers.Tests (2 hops), Aspire.Hosting.DevTunnels.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.Go.Tests (2 hops), Aspire.Hosting.Java.Tests (2 hops), Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests (2 hops), Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.Python.Tests (2 hops), Aspire.Hosting.Qdrant.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests (2 hops), Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🔧 src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.PostgreSQL.Tests
→ 3 via the project graph: Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.EntityFrameworkCore.Tests (2 hops), Aspire.Hosting.Kubernetes.Tests (2 hops)

🔧 src/Shared/Model/Serialization/ResourceJson.cs (changed source)
→ 4 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Testing.Tests

🧪 tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelRpcTargetTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests
→ 2 via the project graph: Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

🔧 src/Aspire.Hosting.Azure.CosmosDB/Aspire.Hosting.Azure.CosmosDB.csproj (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 1 via the project graph: Aspire.Hosting.Foundry.Tests (2 hops)

🔧 src/Aspire.Hosting.MongoDB/Aspire.Hosting.MongoDB.csproj (changed source)
→ 1 directly: Aspire.Hosting.MongoDB.Tests
→ 1 via the project graph: Aspire.Hosting.Radius.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureCosmosDBExtensionsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 1 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.Storage/Aspire.Hosting.Azure.Storage.csproj (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests

🔧 src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.MongoDB.Tests

🔧 src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.MySql.Tests

🔧 src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.RabbitMQ.Tests

🔧 src/Aspire.Hosting.Redis/Aspire.Hosting.Redis.csproj (changed source)
→ 1 directly: Aspire.Hosting.Redis.Tests

🔧 src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Redis.Tests

🔧 src/Aspire.Hosting.SqlServer/Aspire.Hosting.SqlServer.csproj (changed source)
→ 1 directly: Aspire.Hosting.SqlServer.Tests

🔧 src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.SqlServer.Tests

🔧 src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Valkey.Tests

🔧 src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs (changed source)
→ 1 via the project graph: Aspire.Hosting.Native.Core.Tests

🧪 tests/Aspire.Cli.Tests/Backchannel/ResourceSnapshotMapperTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Mcp/ListResourcesToolTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ListResourcesToolTests.ListResourcesTool_ListsConnectCommandAndDropsCommandsThatWouldBeTruncated.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ListResourcesToolTests.ListResourcesTool_PreservesCrossPageRelationshipsAndHiddenReplicaIdentity.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ResourceSnapshotMapperTests.MapToResourceJson_MapsConnectCommandAndOmitsItWhenAbsent.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureStorageExtensionsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.Go.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.Java.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.Python.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.Rust.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/HostingContainerResourceCapabilities.verified.txt (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.TypeScript.Tests

🧪 tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts (changed test)
→ 1 directly: Aspire.Hosting.CodeGeneration.TypeScript.Tests

🧪 tests/Aspire.Hosting.MongoDB.Tests/AddMongoDBTests.cs (changed test)
→ 1 directly: Aspire.Hosting.MongoDB.Tests

🧪 tests/Aspire.Hosting.MySql.Tests/AddMySqlTests.cs (changed test)
→ 1 directly: Aspire.Hosting.MySql.Tests

🧪 tests/Aspire.Hosting.PostgreSQL.Tests/AddPostgresTests.cs (changed test)
→ 1 directly: Aspire.Hosting.PostgreSQL.Tests

🧪 tests/Aspire.Hosting.RabbitMQ.Tests/AddRabbitMQTests.cs (changed test)
→ 1 directly: Aspire.Hosting.RabbitMQ.Tests

🧪 tests/Aspire.Hosting.Redis.Tests/AddRedisTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Redis.Tests

🧪 tests/Aspire.Hosting.SqlServer.Tests/AddSqlServerTests.cs (changed test)
→ 1 directly: Aspire.Hosting.SqlServer.Tests

🧪 tests/Aspire.Hosting.Tests/Backchannel/ConnectCommandResolverTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Valkey.Tests/AddValkeyTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Valkey.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Backchannel/ResourceSnapshotMapper.cs, src/Aspire.Cli/Mcp/Tools/ListResourcesTool.cs, src/Aspire.Hosting.Redis/Aspire.Hosting.Redis.csproj, src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs, src/Aspire.Hosting/ApplicationModel/ConnectCommandAnnotation.cs, src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelRpcTarget.cs, src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs, src/Aspire.Hosting/Backchannel/ConnectCommandResolver.cs, src/Aspire.Hosting/ConnectCommandBuilderExtensions.cs
• affected project Aspire.Cli
native-dashboard-validation affected project Aspire.Dashboard
polyglot • tests/PolyglotAppHosts/Aspire.Hosting/Go/apphost.go, tests/PolyglotAppHosts/Aspire.Hosting/Java/AppHost.java, tests/PolyglotAppHosts/Aspire.Hosting/Python/apphost.py, tests/PolyglotAppHosts/Aspire.Hosting/TypeScript/apphost.mts
• affected project Aspire.Cli
• affected project Aspire.Hosting.Azure.Provisioning.CosmosDB
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 0dce292.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because omitted findings identify critical host-side shell evaluation of custom container names and ineffective cancellation while awaiting a shared runtime probe.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire describe: a connect entry per resource with the command that reaches it with its own client

3 participants