Repository navigation
Flatten dashboard persistence directory layout - #20006
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20006Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20006" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Critical storage collisions and migration gaps must be resolved before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Flattens dashboard persistence into shared runs and resumes directories while preserving application identification.
Changes:
- Adds application marker files for run discovery.
- Relocates resume databases and locks.
- Renames the working-directory property and updates tests.
File summaries
| File | Description |
|---|---|
tests/Aspire.Dashboard.Tests/Model/DashboardDataSourceTests.cs |
Updates persistence and discovery tests. |
tests/Aspire.Dashboard.Tests/Integration/StartupTests.cs |
Adjusts failed-startup cleanup coverage. |
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs |
Implements the flattened layout. Outstanding issues include run-ID collisions, missing run/resume migration compatibility, and outdated persistence documentation. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 4
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Constructor failure cleanup must prevent orphaned run directories, and the security documentation must be made consistent.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
docs/specs/dashboard-persistence.md:95
- This new permission/layout contract contradicts the unchanged Security and privacy section below: line 330 still says data is under
<ASPIRE_HOME>/dashboard/<application-directory>, and line 332 says the Dashboard does not set Unix file modes. Update that section to describe the sharedruns/resumespaths and clarify which directories are repaired to0700versus which root/file permissions remain the operator's responsibility.
On Unix, the shared `runs` and `resumes` directories are created with owner-only (`0700`) permissions. Resume application directories are also restricted to that mode before persistent data is accessed. Existing directories are repaired to that mode. On Windows, directories are created without Unix permission flags and use inherited ACLs.
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Tests selector9 / 99 PR test projects · 3 PR jobs · 1 advisory-only target, from 3 changed files. Selected PR test projects (9 / 99)
Selected PR jobs (3)
Advisory workflow impact (1)
How these were chosen — grouped by what changed🔧 📦 affected project 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
Existing persisted runs and resume databases become inaccessible without migration or legacy-layout fallback.
Review details
Suppressed comments (1)
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:568
- These new roots have no compatibility path for data written in the existing layout. After an upgrade, historical runs under
<data-root>/<application-key>/runsare no longer discovered or pruned, and Resume mode silently starts a new database instead of reopening<data-root>/<application-key>/dashboard.db. Add a one-time migration or legacy-layout fallback (under the existing locks) so changing the directory structure does not make persisted data disappear.
internal static string GetRunsDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "runs");
internal static string GetResumesDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "resumes");
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
There was a problem hiding this comment.
Non-blocking follow-up: we should think about run isolation for agentic coding with multiple worktrees. My primary concern is an agent querying telemetry from previous runs without realizing that it came from a completely unrelated worktree. Worktrees of the same AppHost commonly share an application name, so an agent could mistake another worktree’s logs or traces for evidence about the code it is currently changing and draw the wrong conclusions.
That is why I think isolation by worktree is the better default, with cross-worktree telemetry access being explicit and clearly identifying the originating worktree and commit. Metadata is useful, but relying on the agent to notice it is weaker than keeping unrelated runs out of its default query scope. Not a blocker for this layout change.
Reflects the flattened storage layout from microsoft/aspire#20006: run snapshots now live directly under a shared runs directory (with an application storage-key marker file for discovery), and Resume-mode databases live under a shared resumes directory. Co-authored-by: Copilot <[email protected]>
|
Pull request created: #1657
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1657 targeting Updated the Aspire dashboard persistence documentation to reflect the flattened storage layout introduced in #20006:
No new pages were created. Note This draft PR needs human review before merging. |
Description
Dashboard persistence currently nests historical runs under an application-specific directory. This makes the storage hierarchy harder to inspect and prevents all run snapshots from sharing one predictable location.
This change:
runsdirectory.run.json.resumesdirectory.CurrentWorkingDirectory.User-facing usage
No configuration changes are required. With a configured dashboard data directory, persisted data now has this shape:
Security considerations
Persisted dashboard data can contain telemetry, environment variables, and console logs. The shared
runsandresumesdirectories and resume application directories are restricted to owner-only permissions (0700) on Unix. Windows uses inherited ACLs. Temporary mode usesDirectory.CreateTempSubdirectory, which creates an owner-only directory on Unix and inherits the current user's temporary-directory ACL on Windows.Validation:
The focused failed-startup cleanup test also passed with the shared runs directory.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?