Skip to content

Conversation

afscrome
Copy link
Contributor

@afscrome afscrome commented Feb 15, 2025

Description

  • Add EndpointProperty.HostAndPort
  • Update existing places that can now use HostAndPort instead of concatenating Host and Port themselves.

Fixes #7597

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
  • Does the change require an update in our Aspire docs?

Docs repo has a few places that could be optimised with EndpointProperty.HostAndPort once this is implemented
https://github.com/dotnet/docs-aspire/blob/212a101a3526d6b59823fc8406680f86826dc40a/docs/extensibility/snippets/MailDevResource/MailDev.Hosting/MailDevResource.cs#L27
https://github.com/dotnet/docs-aspire/blob/212a101a3526d6b59823fc8406680f86826dc40a/docs/extensibility/snippets/MailDevResourceAndComponent/MailDev.Hosting/MailDevResource.cs#L27https://github.com/dotnet/docs-aspire/blob/212a101a3526d6b59823fc8406680f86826dc40a/docs/extensibility/custom-hosting-integration.md?plain=1#L360
https://github.com/dotnet/docs-aspire/blob/212a101a3526d6b59823fc8406680f86826dc40a/docs/extensibility/snippets/MailDevResourceWithCredentials/MailDev.Hosting/MailDevResource.cs#L48

@afscrome afscrome requested a review from mitchdenny as a code owner February 15, 2025 09:57
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 15, 2025
- Add `EndpointProperty.HostAndPort`
- Update existing places that can now use `HostAndPort` instead of concatenating Host and Port themselves.
@davidfowl
Copy link
Member

The change is good. I don't see that any tests needed updating so that's a good sign. I think you should look to add an explicit one though.


Expressions = new()
{
{ "TwoFullEndpoints", ReferenceExpression.Create($"Test1={Endpoint1.Property(EndpointProperty.Scheme)}://{Endpoint1.Property(EndpointProperty.IPV4Host)}:{Endpoint1.Property(EndpointProperty.Port)}/;Test2={Endpoint2.Property(EndpointProperty.Scheme)}://{Endpoint2.Property(EndpointProperty.Host)}:{Endpoint2.Property(EndpointProperty.Port)}/;") },
Copy link
Member

Choose a reason for hiding this comment

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

Can you add more tests instead of changing these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do - may not be until later this week I'm afraid.

Copy link
Member

Choose a reason for hiding this comment

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

I can merge and you can follow up 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me.

@mitchdenny mitchdenny merged commit ba4dfcf into dotnet:main Feb 19, 2025
70 checks passed
@mitchdenny
Copy link
Member

@davidfowl wait for 9.2 for this one?

@davidfowl
Copy link
Member

Yep

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add EndpointProperty.HostAndPort
3 participants