Skip to content
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

Making PathNormalizer a public class from Aspire.Hosting.Utils #6996

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaronpowell
Copy link
Contributor

@aaronpowell aaronpowell commented Dec 30, 2024

Description

When creating an integration that works with the local file system, it'd be ideal to use the PathNormalizer utility class so that custom integrations can behave consistently with Aspire "core" integrations. Currently, this class is internal and the only workaround is to copy it into your own codebase - which is not ideal.

This PR makes the class public, documents it, adds it to the unshipped API file, and removes the shared include from integrations that relied on it.

Contributes to #6807

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?
Microsoft Reviewers: Open in CodeFlow

This will help with the Community Toolkit, as we want to use the PathNormalizer too, as outlined in dotnet#6807
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 30, 2024
@davidfowl
Copy link
Member

err, do we need to make this public? It's like 4 lines of code.

@aaronpowell
Copy link
Contributor Author

I think it's better that integrations don't have to copy code out of the Aspire repo to have consistent behaviour.

Yes, it's four lines of code, but it's four LOC here, a handful there, and you keep having to come back to grab stuff.

@davidfowl
Copy link
Member

I can’t approve this one, doesn’t feel like something we need to expose. Use shared source in the community toolkit.

@eerhardt
Copy link
Member

eerhardt commented Jan 14, 2025

Is there a way we can build a source-only NuGet package in dotnet/aspire that includes a bunch of random internal helper classes.

Then in the community toolkit, we extract that NuGet package into the individual .cs files, and each community toolkit library can pick and choose individual files they want to include? Then the source wouldn't need to be duplicated, and when we updated these internal helper classes, the toolkit could update to the new version as well.

Like a "transport pack" for source files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants