Skip to content

Conversation

@davidfowl
Copy link
Member

Description

Don't assume we have all of the endpoints up front. Support incrementally updating settings and appending ports to forward.

Fixes #11654

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?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

Copilot AI review requested due to automatic review settings September 25, 2025 08:06
@github-actions
Copy link
Contributor

github-actions bot commented Sep 25, 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 -- 11657

Or

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

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 25, 2025
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 PR refactors the Devcontainer port forwarding logic to support incremental port updates rather than batch processing all endpoints upfront. The main change introduces a channel-based asynchronous processing system that can handle port forwards as they become available.

  • Replaces synchronous batch processing with asynchronous channel-based updates
  • Switches from AfterEndpointsAllocatedAsync to event-driven processing via ResourceEndpointsAllocatedEvent
  • Adds proper resource disposal and background task management

Reviewed Changes

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

File Description
DevcontainerSettingsWriter.cs Implements channel-based processing, adds IDisposable, and refactors from batch to incremental port handling
DevcontainerPortForwardingLifecycleHook.cs Changes from lifecycle hook to event subscription model for processing individual resource endpoints

…tes and improve asynchronous processing.

- Don't assume we have all of the endpoints up front. Support incrementally updating settings and appending ports to forward.

Fixes #11654
@davidfowl davidfowl force-pushed the davidfowl/fix-devtunnels-in-devcontainers branch from 5301289 to fc3009b Compare September 29, 2025 04:07
@davidfowl davidfowl merged commit 5673cf5 into main Sep 30, 2025
311 checks passed
@davidfowl
Copy link
Member Author

/backport to release/9.5

@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev tunnels fails to run when in a dev container

2 participants