Skip to content

API Review feedback#12644

Merged
eerhardt merged 15 commits intodotnet:mainfrom
eerhardt:APIReview
Nov 4, 2025
Merged

API Review feedback#12644
eerhardt merged 15 commits intodotnet:mainfrom
eerhardt:APIReview

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Nov 3, 2025

See comments in #12058

@eerhardt eerhardt requested a review from JamesNK November 3, 2025 23:15
Copilot AI review requested due to automatic review settings November 3, 2025 23:15
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 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 -- 12644

Or

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

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 pull request renames the property ServiceProvider to Services in the LoadInputContext class to align with naming conventions used elsewhere in the Aspire codebase (e.g., IDistributedApplicationBuilder.Services). Additionally, it refactors the WithAzureApplicationInsights extension methods to eliminate code duplication by introducing a parameterless overload that other overloads call.

  • Renamed LoadInputContext.ServiceProvider to LoadInputContext.Services for consistency
  • Refactored WithAzureApplicationInsights methods to reduce code duplication
  • Updated test code to use the new property name

Reviewed Changes

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

File Description
src/Aspire.Hosting/IInteractionService.cs Renamed LoadInputContext.ServiceProvider property to Services and updated its usage in LoadCallback instantiation
tests/Aspire.Hosting.Azure.Tests/ProvisioningContextProviderTests.cs Updated test code to use the renamed Services property in both LoadInputContext and InputsDialogValidationContext instantiations
src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs Refactored WithAzureApplicationInsights methods by extracting common logic into a parameterless overload
Comments suppressed due to low confidence (1)

src/Aspire.Hosting/IInteractionService.cs:515

  • The ServiceProvider property in InputsDialogValidationContext should be renamed to Services for consistency with the change made to LoadInputContext.Services and the pattern used throughout Aspire (e.g., IDistributedApplicationBuilder.Services). This improves naming consistency across the codebase.
    public required IServiceProvider ServiceProvider { get; init; }

/// <param name="builder">The AzureAppServiceEnvironmentResource to configure.</param>
/// <param name="applicationInsightsLocation">The location for Application Insights.</param>
/// <returns><see cref="IResourceBuilder{T}"/></returns>
public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithAzureApplicationInsights(this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, string applicationInsightsLocation)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the location even here? This feels pretty gross 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

My understanding from @ShilpiRach is that app insights isn't available in all locations that AppService is. So if you deploy your app service to a region that app insights isn't in, it would fail. So this allows you to pick a different region for your app insights.

@eerhardt eerhardt requested a review from ShilpiRach November 4, 2025 17:50
Replace should use ClearContainerFilesSources now.
@eerhardt eerhardt requested a review from mitchdenny as a code owner November 4, 2025 18:01
@eerhardt eerhardt merged commit 96879c8 into dotnet:main Nov 4, 2025
582 of 585 checks passed
@eerhardt eerhardt deleted the APIReview branch November 4, 2025 23:32
@eerhardt
Copy link
Member Author

eerhardt commented Nov 4, 2025

/backport to release/13.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19086152386

@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 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.

4 participants