Strip /login path from dashboard base URL in describe JSON output#15495
Strip /login path from dashboard base URL in describe JSON output#15495JamesNK wants to merge 1 commit intorelease/13.2from
Conversation
The describe command was passing BaseUrlWithLoginToken (e.g., http://localhost:18888/login?t=token) directly to the resource snapshot mapper, producing broken dashboard URLs like http://localhost:18888/login?t=token/?resource=redis. Reuse TelemetryCommandHelpers.ExtractDashboardBaseUrl to strip the /login?t=... path before combining with resource URLs.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15495Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15495" |
There was a problem hiding this comment.
Pull request overview
Fixes aspire describe --format json producing broken per-resource dashboardUrl values by stripping the /login?t=... portion from the dashboard URL before combining it with resource-specific paths.
Changes:
- Reuse
TelemetryCommandHelpers.ExtractDashboardBaseUrl(nowinternal) to derive a clean dashboard base URL inDescribeCommand. - Add integration tests covering both snapshot JSON output and
--followNDJSON output to verify correctdashboardUrlcomposition.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Commands/DescribeCommandTests.cs | Adds tests ensuring dashboard URLs in JSON/NDJSON output don’t include /login?t=... before resource URL composition. |
| src/Aspire.Cli/Commands/TelemetryCommandHelpers.cs | Makes ExtractDashboardBaseUrl internal so it can be reused by other commands. |
| src/Aspire.Cli/Commands/DescribeCommand.cs | Uses ExtractDashboardBaseUrl to avoid combining resource URLs onto /login?t=... dashboard URLs. |
|
🎬 CLI E2E Test Recordings — 54 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23423898514 |
|
Likley a dumb question, but won't you also need the token for deep linking to work on browsers where the main dashboard hasn't authenticated yet? In that case, should the fix be just to make it send the two query params (with the right |
Correct, you would need the token - the operating assumption is that the user would already be logged in when navigating to these pages |
|
Or you login after going to that page using the login screen. |
Description
The
aspire describe --format jsoncommand was usingBaseUrlWithLoginToken(e.g.,http://localhost:18888/login?t=token) directly as the dashboard base URL when building per-resource dashboard URLs.DashboardUrls.CombineUrlsimply concatenates strings, producing broken URLs likehttp://localhost:18888/login?t=token/?resource=redis.This change reuses
TelemetryCommandHelpers.ExtractDashboardBaseUrl(changed fromprivatetointernal) to strip the/login?t=...path before combining with resource URLs, producing correct URLs likehttp://localhost:18888/?resource=redis.Two new integration tests verify the fix for both snapshot and follow/NDJSON JSON output modes.
Fixes #15171
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: