Skip to content

Refactor settings file path handling #9951

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
Jun 23, 2025

Conversation

pdekkers
Copy link
Contributor

Description

The added method centralizes the logic for constructing the path to the settings JSON file.

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?

Introduce method to centralize the logic for constructing the path to the settings JSON file.
@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 12:16
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 refactors the logic for constructing the settings JSON file path by introducing a centralized helper method.

  • Replaces multiple inline usages of Path.Combine for ".aspire/settings.json" with a single helper method.
  • Updates various components across the project (ConfigurationHelper, ProjectLocator, Program, and ConfigurationService) to use the new method for consistency.

Reviewed Changes

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

File Description
src/Aspire.Cli/Utils/ConfigurationHelper.cs Introduces BuildPathToSettingsJsonFile to centralize settings file path creation.
src/Aspire.Cli/Projects/ProjectLocator.cs Refactors inline path building to use the new helper method.
src/Aspire.Cli/Program.cs Replaces path construction with the helper method.
src/Aspire.Cli/Configuration/ConfigurationService.cs Updates both settings file lookup and creation to use the centralized logic.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 19, 2025
@davidfowl davidfowl requested a review from mitchdenny June 20, 2025 07:50
Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution especially on a relatively new part of the code base!

@mitchdenny mitchdenny merged commit 1454d88 into dotnet:main Jun 23, 2025
253 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-cli 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