Skip to content

API review: WithHostPort should accept null for port param #9282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025

Conversation

Alirexaa
Copy link
Contributor

from API review: #8736 (comment)

@Copilot Copilot AI review requested due to automatic review settings May 13, 2025 14:29
Copy link
Contributor

@Copilot 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 updates the API for the WithHostPort extension methods in both the SQL Server and Redis hosting builders to allow a null value for the port parameter, enabling random port assignment.

  • Update WithHostPort signature to accept nullable integer (int? port) in SqlServerBuilderExtensions.cs.
  • Update WithHostPort signature to accept nullable integer (int? port) in RedisBuilderExtensions.cs.

Reviewed Changes

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

File Description
src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs Updated WithHostPort parameter from int to int? to allow null port.
src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs Updated WithHostPort parameter from int to int? to allow null port.

@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label May 13, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 13, 2025
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM.

@Alirexaa
Copy link
Contributor Author

Don't forget to backport.

@eerhardt eerhardt enabled auto-merge (squash) May 13, 2025 14:33
@eerhardt eerhardt merged commit 4851be5 into dotnet:main May 13, 2025
344 of 347 checks passed
@eerhardt
Copy link
Member

/backport to release/9.3

Copy link
Contributor

Started backporting to release/9.3: https://github.com/dotnet/aspire/actions/runs/15001384937

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages 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.

2 participants