Skip to content

Dedupe shared backchannel types - #10058

Merged
Safia Abdalla (captainsafia) merged 4 commits into
mainfrom
safia/dedupe-backchannel-types
Jul 2, 2025
Merged

Dedupe shared backchannel types#10058
Safia Abdalla (captainsafia) merged 4 commits into
mainfrom
safia/dedupe-backchannel-types

Conversation

@captainsafia

Copy link
Copy Markdown
Contributor

Avoid have duplicate source declarations of the same RPC-transmitted types.

cc: Mitch Denny (@mitchdenny) Adam Ratzman (@adamint)

Copilot AI review requested due to automatic review settings June 26, 2025 06:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 deduplicates the shared backchannel types between the CLI and the Hosting projects to avoid maintenance of duplicate source declarations.

  • Merges the backchannel data types into a single shared file with conditional namespace directives.
  • Removes duplicate type definitions from the CLI project.
  • Updates the CLI project file to compile the shared backchannel file.

Reviewed Changes

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

File Description
src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs Added conditional directives to set the namespace based on build.
src/Aspire.Cli/Backchannel/BackchannelDataTypes.cs Removed duplicate type definitions now shared by the Hosting project.
src/Aspire.Cli/Aspire.Cli.csproj Updated project file to include the shared BackchannelDataTypes.cs.

Comment thread src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs
Comment thread src/Aspire.Cli/Backchannel/BackchannelDataTypes.cs Outdated
Comment thread src/Aspire.Cli/Backchannel/BackchannelDataTypes.cs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good for me, but probably Eric can confirm if AOT works fully with such a change

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will be good to get this in.

@captainsafia
Safia Abdalla (captainsafia) force-pushed the safia/dedupe-backchannel-types branch from 12407f7 to 95ec908 Compare July 2, 2025 15:20
Comment thread src/Aspire.Cli/Aspire.Cli.csproj Outdated
<PackageId>Aspire.Cli</PackageId>
<RollForward>Major</RollForward>
<PackageTags>aspire cli</PackageTags>
<DefineConstants>$(DefineConstants);CLI</DefineConstants>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
<DefineConstants>$(DefineConstants);CLI</DefineConstants>

This isn't necessary. It is set above.

/// <summary>
/// Specifies the type of input for a publishing prompt input.
/// </summary>
internal enum InputType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this stay just in the CLI? I see there is another "public enum InputType" in Aspire.Hosting, which is used on that side. Having 2 in Aspire.Hosting will probably be confusing.

@eerhardt Eric Erhardt (eerhardt) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just 2 nit-ish comments. Looks good beyond those!

Comment thread src/Aspire.Cli/Aspire.Cli.csproj Outdated
<Compile Include="$(SharedDir)PathNormalizer.cs" Link="Utils\PathNormalizer.cs" />
<Compile Include="$(SharedDir)CircularBuffer.cs" Link="Utils\CircularBuffer.cs" />
<Compile Include="$(SharedDir)StringComparers.cs" Link="StringComparers.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting\Backchannel\BackchannelDataTypes.cs" Link="Backchannel\BackchannelDataTypes.cs" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This causes problems in VS because there are 2 files with the same name in the same folder in the Solution Explorer. So only 1 file shows. Maybe rename src/Aspire.Cli/Backchannel/BackchannelDataTypes.cs => src/Aspire.Cli/Backchannel/CliBackchannelDataTypes.cs

Comment thread src/Aspire.Cli/Aspire.Cli.csproj Outdated
@captainsafia
Safia Abdalla (captainsafia) deleted the safia/dedupe-backchannel-types branch July 2, 2025 17:39
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants