Repository navigation
Show incompatible dashboard runs as disabled - #20082
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20082Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20082" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Pinning a newer-schema run can discard metadata fields unknown to the current dashboard.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Displays incompatible persisted dashboard runs as disabled selector items while preserving pin/unpin and retention behavior.
Changes:
- Discovers all non-pruned runs while restricting data access to compatible runs.
- Adds disabled incompatible-run UI with localized tooltip and pin action.
- Adds store, retention, and component coverage.
File summaries
| File | Description |
|---|---|
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs |
Expands discovery and compatibility filtering. |
src/Aspire.Dashboard/ServiceClient/DashboardDataSource.cs |
Restricts selection to compatible runs. |
src/Aspire.Dashboard/Components/Controls/DashboardRunSelect.razor.cs |
Renders incompatible runs as disabled. |
src/Aspire.Dashboard/Resources/Layout.resx |
Adds tooltip text. |
src/Aspire.Dashboard/Resources/Layout.Designer.cs |
Exposes the localized tooltip. |
src/Aspire.Dashboard/Resources/xlf/Layout.cs.xlf |
Updates Czech localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.de.xlf |
Updates German localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.es.xlf |
Updates Spanish localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.fr.xlf |
Updates French localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.it.xlf |
Updates Italian localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.ja.xlf |
Updates Japanese localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.ko.xlf |
Updates Korean localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.pl.xlf |
Updates Polish localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.pt-BR.xlf |
Updates Portuguese localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.ru.xlf |
Updates Russian localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.tr.xlf |
Updates Turkish localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hans.xlf |
Updates Simplified Chinese localization data. |
src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hant.xlf |
Updates Traditional Chinese localization data. |
tests/Aspire.Dashboard.Tests/Shared/TestDashboardDataSource.cs |
Aligns the test run store contract. |
tests/Aspire.Dashboard.Tests/Model/DashboardDataSourceTests.cs |
Covers discovery, pinning, and retention. |
tests/Aspire.Dashboard.Components.Tests/Shared/FluentUISetupHelpers.cs |
Updates component-test fakes. |
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs |
Verifies disabled rendering and pinning. |
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
- Files reviewed: 21/22 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The required DashboardDataSource.SelectRun regression test is still missing; documentation and menu-order assertion nits also remain.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/Aspire.Dashboard/ServiceClient/DashboardDataSource.cs:83
- Please add a regression test for this caller, not only for
GetRunById. A stale selection ID that refers to an incompatible run must be rejected here and leave the current run selected; the store test can still pass if this call accidentally usesonlyCompatible: false, allowing the data-source path to regress independently. Add aDashboardDataSource.SelectRuntest with an older or newer descriptor and assert that it falls back to the current run without acquiring the incompatible database.
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:42
- The return documentation no longer matches this lookup:
GetRunById(..., onlyCompatible: true)intentionally returns compatible runs that are currently owned by another dashboard, andTryAcquireRunLeaseperforms the authoritative lock check later. Please describe the result as a discovered non-pruned run (subject to the compatibility flag), rather than sayingnullmeans the run is unavailable.
/// <returns>The dashboard run, or <see langword="null"/> when the run is not available.</returns>
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs:364
Assert.DoesNotContainonly proves that the unavailable item is absent; it does not verify the complete menu contents or ordering, so a regression that drops the current run or adds an unexpected item could still pass. Assert the full current/divider/incompatible sequence instead.
Assert.DoesNotContain(items, item => string.Equals(item.Text, FormatHelpers.FormatTimeWithOptionalDate(
Services.GetRequiredService<BrowserTimeProvider>(),
unavailableRun.StartedAtUtc.UtcDateTime), StringComparison.Ordinal));
- Files reviewed: 21/22 changed files
- Comments generated: 0 new
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
940f668 to
a5189a3
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Add regression coverage for incompatible selection and leasing, and avoid unnecessary GetRuns() allocations.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
Suppressed comments (3)
src/Aspire.Dashboard/ServiceClient/DashboardDataSource.cs:83
- The new compatible-only lookup in
DashboardDataSource.SelectRunis the guard that prevents a stale session/URL from opening an incompatible SQLite database, but the added tests only cover store discovery and menu rendering. Please add aDashboardDataSourcetest with an incompatible run ID and assert that selection falls back to the current run without acquiring/opening a historical lease; otherwise this user-visible behavior can regress while the current tests still pass.
var selectedRun = runId is not null ? _runStore.GetRunById(runId, onlyCompatible: true) : null;
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:250
GetRuns()now materializes a new array on every call, even when no run is pruned. The previous implementation returned the cached lazy snapshot on that common path, and this method is used by the run selector and data-source lookup; keep the cached list when all entries are unpruned and only allocate a filtered array after pruning marks a descriptor.
public IReadOnlyList<DashboardRunDescriptor> GetRuns() =>
_runs.Value.Where(run => !run.IsPruned).ToArray();
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:331
- This compatibility guard is part of the safety boundary before
DashboardDataSourcePoolopens a historical SQLite database, but the added tests only exerciseGetRunByIddirectly. Add a regression test that attempts to select or acquire an incompatible persisted run and verifies it is treated as unavailable; otherwise removing thisonlyCompatible: truecheck could make the dashboard try to open an incompatible database while the current tests remain green.
var storedRun = GetRunById(run.RunId, onlyCompatible: true);
- Files reviewed: 21/22 changed files
- Comments generated: 0 new
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
a5189a3 to
0b9acef
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
- Files reviewed: 21/22 changed files
- Comments generated: 0 new
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Add the missing active-selection regression test and update the lookup documentation and persistence specification.
Get a fresh assessment by requesting another Copilot review.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
Suppressed comments (2)
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:43
GetRunByIdnow intentionally returns a compatible descriptor even whenIsSelectableis false (the run-lock check happens later inTryAcquireRunLease), so the return documentation sayingnullmeans the run is “not available” is no longer accurate. Clarify that this lookup only filters pruned/incompatible runs and that callers must acquire the lease to establish availability.
/// <param name="onlyCompatible"><see langword="true"/> to return only runs compatible with the current dashboard version; otherwise, <see langword="false"/>.</param>
/// <returns>The dashboard run, or <see langword="null"/> when the run is not available.</returns>
DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible);
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:250
- The persistence specification still says historical discovery excludes runs locked by another Dashboard and requires the current metadata schema (
docs/specs/dashboard-persistence.md:157-163). This change makes discovery return all non-pruned descriptors, including locked and incompatible runs, while the selector and lease acquisition apply those availability filters later; update the spec so it does not describe the opposite behavior.
public IReadOnlyList<DashboardRunDescriptor> GetRuns() =>
_runs.Value.Where(run => !run.IsPruned).ToArray();
- Files reviewed: 21/22 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Preserve the existing IDashboardRunStore public contract while adding compatible-only lookup.
Get a fresh assessment by requesting another Copilot review.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
- Files reviewed: 21/22 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
|
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.
🔵 Needs a closer look
The public IDashboardRunStore signature change is a blocking compatibility issue, and the persistence contract also needs updating.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
Suppressed comments (2)
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:43
- Changing this member from
GetRunById(string)toGetRunById(string, bool)is a breaking change to the publicIDashboardRunStorecontract: existing callers and any external implementations no longer compile, even though the PR checklist says there is no public API change. Preserve the existing method and keep the compatibility filter internal (or otherwise add the new behavior without replacing the public signature).
DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible);
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:389
- This changes discovery so incompatible runs are added without checking the run lock, but
docs/specs/dashboard-persistence.mdstill says historical discovery excludes runs locked by another dashboard and requires the current metadata schema. Please update that persistence contract to describe the new disabled/incompatible entries and the fact that locking is deferred to operations that need the run.
if (run.IsCompatible)
{
// Filter out in-progress runs that are owned by other Dashboard instances.
using var runLock = TryOpenRunLock(directory);
run.IsSelectable = runLock is not null;
}
else
{
run.IsSelectable = false;
- Files reviewed: 21/22 changed files
- Comments generated: 0 new
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
d3d7b6c to
c4803b5
Compare
Tests selector10 / 99 PR test projects · 3 PR jobs, from 22 changed files. Selected PR test projects (10 / 99)
Selected PR jobs (3)
How these were chosen — grouped by what changed
🔧 📦 affected project 📦 affected project 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
The public IDashboardRunStore change introduces a source and binary compatibility break.
Review details
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
Suppressed comments (1)
src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:43
IDashboardRunStoreis a public interface, so replacingGetRunById(string)with this required boolean parameter is a source/binary breaking change for existing callers and for any external implementation of the interface. The PR checklist says no public API change; preserve the existing member and add the compatible-only lookup without forcing implementers to update (for example, via a separate method or a compatible default-interface design), then update the internal callers.
DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible);
- Files reviewed: 21/22 changed files
- Comments generated: 0 new
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (1): Docs already cover this behavior verbatim, in
Both passages name every element of the PR's user-facing change: incompatible/disabled run items in the selector, the tooltip/hover explanation, the retained pin/unpin action, and continued participation in normal retention for unpinned incompatible runs. No gap remains to document, so no docs PR was drafted. |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |
Description
Persisted dashboard runs with an older or newer schema version are currently omitted from the run selector, making them invisible and preventing users from pinning them before normal retention removes them.
This change displays incompatible runs in the run selector as disabled items. Each item explains the incompatibility in a tooltip and retains its pin or unpin secondary action. Incompatible, unpinned runs continue to participate in normal retention.
Run discovery now returns all non-pruned runs, while consumers can request compatible-only lookup when opening a run. The active dashboard data source uses compatible-only lookup, and run locking remains the authoritative availability check.
User-facing usage
Open the dashboard run selector after the dashboard schema changes. Historical runs with an incompatible schema remain visible but cannot be selected; hover over one to see why it is disabled, or use its secondary action to pin it.
Screenshots / Recordings
Validation
Aspire.Dashboard.Tests: 1,734 passedAspire.Dashboard.Components.Tests: 358 passedFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?