Skip to content

Self-contained dogfood installs under ~/.aspire/dogfood/#15951

Draft
radical wants to merge 9 commits intomicrosoft:mainfrom
radical:pr-dogfood-self-contained
Draft

Self-contained dogfood installs under ~/.aspire/dogfood/#15951
radical wants to merge 9 commits intomicrosoft:mainfrom
radical:pr-dogfood-self-contained

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented Apr 8, 2026

Description

Self-contained dogfood installs under ~/.aspire/dogfood/ — PR dogfooding and local-hive installs no longer overwrite the stable CLI or share directories with it.

Problem (Issue #15935)

PR dogfooding currently spreads artifacts across multiple shared locations (~/.aspire/bin/, ~/.aspire/managed/, ~/.aspire/dcp/, ~/.aspire/hives/). This causes contamination of the stable CLI, stale state from leftover PR hives, difficult cleanup, and channel pollution from aspire config set channel -g.

Changes

C# — Install root resolution (Program.cs, BundleService.cs)

  • Introduce GetInstallRootDirectory() that resolves the install root based on Environment.ProcessPath:
    • Stable layout (~/.aspire/bin/aspire) → install root is ~/.aspire/
    • Flat/dogfood layout (~/.aspire/dogfood/pr-1234/aspire) → install root is ~/.aspire/dogfood/pr-1234/
  • GetHivesDirectory() now uses the install root, so dogfood hives are discovered relative to the CLI's own directory
  • BundleService.GetDefaultExtractDir() uses the same resolution logic, with a filename guard ensuring both resolvers agree

Scripts (get-aspire-cli-pr.sh/.ps1, localhive.sh/.ps1)

  • CLI installs to <prefix>/dogfood/pr-{N}/ instead of <prefix>/bin/
  • Bundle and hives install under the same dogfood root
  • Removed aspire config set channel -g calls — no longer needed since the self-contained install discovers its own hives
  • Removed dead save_global_settings / Save-GlobalSettings function definitions

Docs (dogfooding-pull-requests.md)

  • Updated install paths, cleanup instructions, and safety notes

Tests (ProgramTests.cs, BundleServiceTests.cs)

  • Added regression tests covering all four resolver paths: stable bin/ layout, flat dogfood layout, null process path, non-aspire process fallback
  • Added test ensuring GetDefaultExtractDir returns null for non-aspire binaries (verifies resolver alignment)

Cleanup

Dogfood cleanup is now a single directory delete:

rm -rf ~/.aspire/dogfood/pr-1234

The stable CLI at ~/.aspire/bin/aspire is not affected by dogfood installs.

Fixes #15935

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

radical added 3 commits April 7, 2026 19:27
Move PR and local-dev installs to a flat layout under
~/.aspire/dogfood/{name}/ so each dogfood install is fully
self-contained (CLI + bundle + hives) and can be cleaned up
with a single directory delete.

- Program.cs: add GetInstallRootDirectory() that resolves
  the install root from Environment.ProcessPath (bin/ layout
  → parent dir; flat layout → CLI dir; fallback → ~/.aspire)
- BundleService: align GetDefaultExtractDir with the same rule
- Scripts: get-aspire-cli-pr.sh/.ps1 and localhive.sh/.ps1
  install to ~/.aspire/dogfood/{name}/ and no longer set
  the global channel
- Docs: update dogfooding-pull-requests.md for new layout
- Tests: cover both stable and dogfood layouts

Fixes microsoft#15935
- Add filename guard to BundleService.GetDefaultExtractDir so it returns   null for non-aspire binaries, matching Program.GetInstallRootDirectory - Make GetInstallRootDirectory accept an optional processPath parameter   for direct unit testing of all resolver code paths - Remove dead save_global_settings / Save-GlobalSettings functions from   get-aspire-cli-pr.sh and get-aspire-cli-pr.ps1 - Add 6 regression tests covering stable layout, flat layout, null path,   and non-aspire process fallback for both resolvers
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15951

Or

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

radical and others added 6 commits April 8, 2026 02:24
The dogfood install script places the CLI binary under
~/.aspire/dogfood/pr-<N>/ instead of ~/.aspire/bin/.
Update SourceAspireBundleEnvironmentAsync and
InstallAspireCliInDockerAsync to prepend the dogfood path
to PATH when a PR number is known.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Self-contained dogfood installs create a local hive that causes
'aspire new' to present a 'Select a template version' prompt.
Add handling in AspireNewAsync to detect this prompt and select
the PR-specific hive version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The search filter text caused Enter to be consumed by the filter
rather than selecting the highlighted item.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dogfood installs present a version selection prompt in 'aspire add'
commands. Add a shared helper that handles this prompt, and update
all affected E2E tests to use it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The version selection prompt appears at different points depending on
the template: after template selection (PythonReact) or after output
path (Starter). Add try/catch handlers at both positions so either
location is handled correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR dogfooding should isolate all artifacts under ~/.aspire/pr/{prNumber}/

1 participant