Skip to content

Implement publisher advertisement and CLI integration#8224

Merged
mitchdenny merged 13 commits into
mainfrom
mitchdenny/publishers-advertisement-over-backchannel
Mar 22, 2025
Merged

Implement publisher advertisement and CLI integration#8224
mitchdenny merged 13 commits into
mainfrom
mitchdenny/publishers-advertisement-over-backchannel

Conversation

@mitchdenny
Copy link
Copy Markdown
Member

@mitchdenny mitchdenny commented Mar 20, 2025

Introduce publisher advertisement events and enhance CLI functionality to retrieve publishers. Update the application to handle different execution modes and improve backchannel connection handling.

We now fire an event when the CLI asks the AppHost for publishers to advertise themselves. This is currently hooked up inside the AddPublisher method, and this will probably be where publishers declare the arguments that they accept and their mapping to options.

At the moment the GetPublishersAsync RPC call just returns an array of strings but once I start working on option mapping it will be a richer set of objects that are returned.

aspire-build-prompting.mp4

Copilot AI review requested due to automatic review settings March 20, 2025 22:17
@mitchdenny mitchdenny self-assigned this Mar 20, 2025
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 20, 2025
@mitchdenny mitchdenny requested a review from davidfowl March 20, 2025 22:17
@mitchdenny mitchdenny added this to the 9.2 milestone Mar 20, 2025
Copy link
Copy Markdown
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 implements publisher advertisement events and enhances CLI integration by adding new publisher-related functionality, updating the backchannel connection, and adjusting Azure provisioning modes. Key changes include:

  • Adding new tests and publisher advertisement events to support publisher discovery.
  • Updating backchannel and CLI components to enable fetching publishers via RPC calls.
  • Adjusting execution mode checks in Azure infrastructure and provisioners.

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Aspire.Hosting.Tests/Backchannel/AppHostBackchannelTests.cs Introduces tests for backchannel connectivity, ping responses, resource streaming, and publisher requests.
src/Aspire.Hosting/Publishing/PublisherAdvertisementEvent.cs Implements publisher advertisement event and related types.
src/Aspire.Cli/Program.cs Adds CLI integration for retrieving publishers asynchronously.
src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs Updates to include a new GetPublishersAsync method using publisher advertisement events.
src/Aspire.Cli/Backchannel/AppHostBackchannel.cs Adds IDisposable support and integrates process management for backchannel connections.
src/Aspire.Hosting/PublisherDistributedApplicationBuilderExtensions.cs Subscribes to publisher advertisement events when adding a publisher.
src/Aspire.Hosting.Azure.* Adjusts execution mode conditions in Azure infrastructure and provisioners.
playground/publishers/Publishers.AppHost/docker-compose.yaml Updates connection string for SQL Server configuration.
src/Aspire.Hosting.Azure/AzureResourcePreparer.cs Skips Azure resource preparation in inspect mode.
src/Aspire.Cli/DotNetCliRunner.cs Updates backchannel connection startup to include process information.
Files not reviewed (1)
  • playground/publishers/Publishers.AppHost/Properties/launchSettings.json: Language not supported

Comment thread src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs
Comment thread src/Aspire.Hosting/Publishing/PublisherAdvertisementEvent.cs Outdated
Co-authored-by: David Fowler <davidfowl@gmail.com>
Comment thread src/Aspire.Cli/Backchannel/AppHostBackchannel.cs
Comment thread src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppsInfrastructure.cs Outdated
Comment thread src/Aspire.Hosting/Publishing/PublisherAdvertisementEvent.cs
@mitchdenny mitchdenny requested a review from davidfowl March 21, 2025 13:31
@davidfowl
Copy link
Copy Markdown
Contributor

Conflcits!

@maddymontaquila
Copy link
Copy Markdown
Contributor

Fit n finish things either for this PR or a follow up issue -

  • When you don't specify a publisher, we shouldn't show the warning that " ' ' " wasn't found
  • When you do specify, it should prob be "Finding publisher..." or "Getting publisher..." instead of available ones because it makes me feel like you're searching for the whole list again
  • are you planning on caching so we don't have to look up every time?

Comment thread tests/Aspire.Hosting.Tests/Backchannel/AppHostBackchannelTests.cs Outdated
@mitchdenny mitchdenny merged commit a64904d into main Mar 22, 2025
@mitchdenny mitchdenny deleted the mitchdenny/publishers-advertisement-over-backchannel branch March 22, 2025 02:54
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants