Always register dashboard resource with ExplicitStartupAnnotation when disabled - #18746
Always register dashboard resource with ExplicitStartupAnnotation when disabled#18746Alex Crome (afscrome) wants to merge 11 commits into
Conversation
Instead of skipping dashboard resource registration entirely when DisableDashboard=true, always register the dashboard resource but mark it with ExplicitStartupAnnotation so it starts in NotStarted state. This allows the Aspire CLI to start the dashboard on demand via `aspire resource start aspire-dashboard`. Key changes: - DistributedApplicationBuilder: unconditionally registers dashboard services in run mode (previously gated on !DisableDashboard) - DashboardEventHandlers: applies ExplicitStartupAnnotation when DisableDashboard=true, preventing auto-start - DashboardServiceHost: removes early-exit for disabled dashboard (publish mode still skips as before) - AppHostRpcTarget: removes early-exit in GetDashboardUrlsAsync for disabled dashboard; DashboardUrlsHelper handles the unhealthy case via the resource health wait path - Tests updated: DashboardIsNotAddedIfDisabled renamed and assertions updated; backchannel tests use targeted resource lookups instead of Assert.Single over all resources since the dashboard is now present Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18746Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18746" |
There was a problem hiding this comment.
Pull request overview
Attempts to keep a disabled dashboard in the app model as an explicit-start resource, supporting later CLI startup.
Changes:
- Registers dashboard services unconditionally in run mode.
- Marks disabled dashboards for explicit startup.
- Updates dashboard URL handling and affected tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting/DistributedApplicationBuilder.cs |
Registers dashboard infrastructure in run mode. |
src/Aspire.Hosting/DistributedApplicationOptions.cs |
Clarifies disabled-dashboard semantics. |
src/Aspire.Hosting/Ats/CreateBuilderOptions.cs |
Aligns option documentation. |
src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs |
Adds explicit-start annotation. |
src/Aspire.Hosting/Dashboard/DashboardServiceHost.cs |
Hosts resource services when dashboard startup is disabled. |
src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs |
Delegates disabled-dashboard URL requests to the helper. |
src/Aspire.Hosting/Backchannel/DashboardUrlsHelper.cs |
Updates absent-resource documentation. |
tests/Aspire.Hosting.Tests/Dashboard/DashboardResourceTests.cs |
Verifies explicit-start dashboard registration. |
tests/Aspire.Hosting.Tests/Dashboard/DashboardEventHandlersTests.cs |
Supplies the new constructor dependency. |
tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelRpcTargetTests.cs |
Accounts for the additional dashboard resource. |
|
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. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
When DisableDashboard=true, the dashboard is now present in the model with ExplicitStartupAnnotation so it can be started on demand. In models with multiple compute environments, validation incorrectly treated this hidden explicit-start dashboard as an unbound compute resource. Update ValidateComputeEnvironmentBindings to skip the Aspire dashboard when it has ExplicitStartupAnnotation, so disabled dashboard scenarios do not fail compute environment validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
- Keep dashboard lifecycle controls hidden while still registering a Start command when DisableDashboard=true so Scanning for running AppHosts... ℹ️ No running AppHosts found in the current directory. Select from all running AppHosts. works. - Return dashboard URL state as unhealthy for explicit-start NotStarted dashboard snapshots instead of waiting for healthy indefinitely. - Remove the transport-validation bypass for DisableDashboard now that disabled means explicit-start rather than fully disabled services. - Regenerate TypeScript codegen API snapshot via AtsTypeScriptCodeGeneratorTests.TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder. - Add/adjust tests covering dashboard start command availability, NotStarted URL behavior, and transport validation behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
…bled When DisableDashboard=true, the dashboard resource is explicit-start and can remain unused during test scenarios. Logging a missing dashboard DLL as an error in this mode causes Playground tests to fail due to an expected missing local dashboard binary in CI environments. Log the condition as debug when auto-start is disabled, while keeping error logging for normal dashboard startup scenarios. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid waiting for dashboard health when the dashboard is explicit-start and in a non-runnable state (for example NotStarted, Waiting, Unknown, or null state). Only Starting/Building/Running continue through healthy wait. Adds regression coverage for explicit-start Waiting and Unknown states. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Treat explicit-start dashboard states without a runnable state (including null, Waiting, and Unknown) as unavailable in dashboard URL lookup. - Add regression coverage for Waiting/Unknown explicit-start dashboard states. - Add a non-validate command execution test that exercises the dashboard start callback path and verifies Waiting->Starting transition. - Align polyglot docs for DisableDashboard semantics in ATS and Python generator output (auto-start disabled, explicit start still available), including updated Python snapshots. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Limit the unbound compute-environment exception for explicit-start dashboard resources to run mode only, preventing unintended publish-mode bypass. - Add publish-mode regression coverage for an explicit-start resource named aspire-dashboard in multi-environment models. - Tighten disabled-dashboard lifecycle command test to assert the command set is exactly one command and that it is Start. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Update DistributedApplicationOptions.DisableDashboard XML doc to describe auto-start disabling with explicit start availability. - Regenerate TypeScript two-pass snapshot so CreateBuilderOptions docs reflect startup-only semantics for disableDashboard. - Remove Arrange/Act/Assert marker comments from the disabled-dashboard command test and keep exact single-command assertion for start-only behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update the non-validate dashboard start-command test to start from a real NotStarted snapshot (instead of forcing Waiting) and verify command execution moves the dashboard away from NotStarted. This exercises the start-command execution path for explicit-start dashboard resources without relying on the waiting-state short-circuit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Scope DisableDashboard summaries to run mode in public/ATS option docs. - Update Python generator docstring and regenerate Python snapshots. - Regenerate TypeScript two-pass snapshot so CreateBuilderOptions docs reflect the same run-mode-only explicit-start behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Description
Fixes #15999
When
DisableDashboard = true, the dashboard resource was previously excluded from the app model entirely, making it impossible for the Aspire CLI to start it on demand. This change always registers the dashboard resource but marks it withExplicitStartupAnnotationwhenDisableDashboard = true, so DCP setsSpec.Start = falseand the dashboard stays inNotStartedstate until explicitly started (e.g. viaaspire resource start aspire-dashboard).Key changes:
DistributedApplicationBuilder: dashboard service registration is now unconditional in run mode (previously gated on!DisableDashboard).DashboardEventHandlers: stampsExplicitStartupAnnotationonto the dashboard resource whenDisableDashboard = true, preventing auto-start.DashboardServiceHost: removes the early-exit for disabled dashboard; publish mode still skips as before.AppHostRpcTarget: removes the early-exit inGetDashboardUrlsAsyncfor disabled dashboard;DashboardUrlsHelperalready handles the unhealthy case via the resource health wait path.DistributedApplicationPipeline: excludes the explicit-start disabled dashboard from multi-compute-environment binding validation, soDisableDashboard=truedoes not require assigningaspire-dashboardto a compute environment.TransportOptionsValidatorandInteractionService.IsAvailableare intentionally unchanged -- transport validation and interaction availability remain gated onDisableDashboardbecause those only matter when the dashboard actually starts.Test updates:
DashboardIsNotAddedIfDisabledrenamed toDashboardIsAddedWithExplicitStartIfDisabledand updated to assert the dashboard resource is present withExplicitStartupAnnotation.Assert.Single(result)over all resources now useAssert.Single(result, s => s.Name == "myresource")since the dashboard resource is present (as explicit-start) in the testing builder context.ComputeEnvironmentValidationTests.MultipleComputeEnvironments_WithAllResourcesBound_DoesNotThrownow passes with the explicit-start disabled dashboard present.Checklist