Make Aspire base port configurable to support parallel stacks across git worktrees#874
Draft
Make Aspire base port configurable to support parallel stacks across git worktrees#874
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary & Motivation
Centralize the local-development port allocation behind a single source of truth (
.workspace/port.txt) and propagate the base port through every layer that previously hardcoded9000and friends. Two motivations: enable running multiple Aspire stacks simultaneously from separate git worktrees (each stack on its own non-overlapping port range, with isolated Docker volumes), and remove the scattered hardcoded ports that drifted out of sync across rsbuild configs, test fixtures, the gateway, and the AppHost.PortAllocationin the shared kernel as the canonical source for the base port. Self-bootstraps.workspace/port.txtto9000on first read and computes derived offsets for Aspire dashboard, Postgres, Azurite, gateway, per-SCS API/static/workers, OTel, and MCPbasePortargument onpp run/pp restartand the corresponding MCP tools; written atomically to.workspace/port.txtbefore any code path lazily loadsPortAllocationplatform-platform-11000-postgres-data) so parallel Azurite and Postgres containers do not corrupt each other's statepp runandpp restartto operate in a fresh worktree (noport.txt) without false-positive collision warnings against another worktree's running stacklocalhost:9007) to stdio transport via the Aspire CLI so the integration works on any base port. The README prerequisites now include Aspire CLI install steps for Windows, macOS, and LinuxAspire.AppHost.Sdkpinned inAppHost.csprojblob-storage) so SCS clients honor the dynamic Azurite port instead of falling back to the SDK default127.0.0.1:10000run/restartsuccess messages to "Aspire is starting on ..." since the underlying CLI is fire-and-forget; callers should verify withget_portsorlist_apphostsget_portsMCP tool returning the full port allocation as JSON, and ignore.claude/worktreesfor local worktree managementChecklist