Skip to content

Conversation

@DamianEdwards
Copy link
Member

Description

Make *.localhost resource endpoint URLs the primary endpoint URL so that callers of WithUrlForEndpoint update that URL instead of the localhost URL that isn't shown on the resources summary page.

Fixes #12465

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

Copilot AI review requested due to automatic review settings October 29, 2025 00:26
@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12466

Or

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the URL ordering behavior when the dashboard uses a *.dev.localhost address. The change ensures that WithUrlForEndpoint callbacks target the *.dev.localhost URL (which is displayed prominently in the dashboard) rather than the plain localhost URL.

Key changes:

  • Swapped URL ordering in ApplicationOrchestrator.cs so the *.dev.localhost URL is added as the primary URL before the localhost URL
  • Updated test to verify that WithUrlForEndpoint correctly targets the primary *.dev.localhost URL
  • Improved code comments to clarify the intent of URL swapping

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs Modified URL creation logic to swap primary and additional URLs, ensuring *.dev.localhost URLs are added first and targeted by WithUrlForEndpoint calls
tests/Aspire.Hosting.Tests/WithUrlsTests.cs Enhanced test to verify WithUrlForEndpoint applies customizations to the primary *.dev.localhost URL; refactored assertions from multiple Assert.Single calls to a single Assert.Collection for better readability

@DamianEdwards DamianEdwards enabled auto-merge (squash) October 29, 2025 00:54
@mitchdenny
Copy link
Member

/test-scenario smoke-test-dotnet

@mitchdenny
Copy link
Member

/test-scenario smoke-test-python

@github-actions
Copy link
Contributor

🤖 AI Agent Task Created

Scenario: smoke-test-dotnet

An AI agent has been assigned to execute this scenario.

📝 Issue: https://github.com/dotnet/aspire-playground/issues/78

Please navigate to the issue for more details and to track progress.

@github-actions
Copy link
Contributor

🤖 AI Agent Task Created

Scenario: smoke-test-python

An AI agent has been assigned to execute this scenario.

📝 Issue: https://github.com/dotnet/aspire-playground/issues/79

Please navigate to the issue for more details and to track progress.

@DamianEdwards DamianEdwards merged commit d48f286 into main Oct 29, 2025
296 checks passed
@DamianEdwards DamianEdwards deleted the damianedwards/fix-12465 branch October 29, 2025 01:09
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 29, 2025
radical pushed a commit that referenced this pull request Oct 29, 2025
)

* Make *.localhost resource endpoint URLs the primary endpoint URL
Fixes #12465

* Update test
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URLs added to resources for *.dev.locahost change perceived behavior of WithUrlForEndpoint

4 participants