Honor explicit DCP config for polyglot apphosts#16734
Conversation
Ensure DcpPublisher configuration takes precedence over CLI-injected bundle paths so TypeScript apphosts can override the DCP executable via standard configuration environment variables. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16734Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16734" |
There was a problem hiding this comment.
Pull request overview
Adjusts DCP option resolution in Aspire.Hosting so that explicit DcpPublisher:CliPath / DcpPublisher:DashboardPath configuration (including env-var bound config) takes precedence over the bundle-discovery environment variables (ASPIRE_DCP_PATH, ASPIRE_DASHBOARD_PATH). This addresses polyglot AppHost scenarios where the CLI injects bundle defaults that were previously overriding user intent.
Changes:
- Reorders
DcpOptionsconfiguration precedence to prefer explicitDcpPublisher:*settings over bundle-discovery env vars. - Preserves bundle-discovery env vars as a fallback when explicit
DcpPublisher:*settings are not present. - Adds unit tests covering both “explicit overrides bundle” and “bundle populates when explicit is absent”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/Dcp/DcpCliArgsTests.cs | Adds tests validating precedence between explicit DcpPublisher:* config and bundle-discovery env-var paths. |
| src/Aspire.Hosting/Dcp/DcpOptions.cs | Updates resolution order for CliPath/DashboardPath so explicit DcpPublisher config wins over bundle-discovery env vars. |
Treat whitespace DCP path settings as unset and isolate bundle fallback tests from ambient DcpPublisher environment values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
/backport to release/13.3 |
|
Started backporting to |
|
🎬 CLI E2E Test Recordings — 75 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25347659605 |
|
Docs check: No documentation PR required. This is a bug fix that corrects priority ordering for DCP configuration resolution — explicit
|
Description
TypeScript and other polyglot apphosts launched through the CLI get bundle discovery settings such as
ASPIRE_DCP_PATHfrom the temporary AppHost server process. Those bundle defaults previously took precedence over explicitDcpPublisherconfiguration, so a command likeDcpPublisher__CliPath=/path/to/dcp aspire runcould still use the bundled DCP executable.This changes DCP option resolution so explicit
DcpPublisher:CliPathandDcpPublisher:DashboardPathsettings win over bundle discovery paths, while keepingASPIRE_DCP_PATHandASPIRE_DASHBOARD_PATHas fallbacks when no explicit DCP publisher setting exists.Fixes: #16443
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: