Repository navigation
Fix empty required parameter startup recovery and diagnostics - #22124
Adam Ratzman (adamint) wants to merge 6 commits into
Conversation
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 -- 22124Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22124" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Dependency descriptions can omit blocking parameters or retain resolved ones, while repeated resource scans introduce quadratic rendering overhead.
3 open issues
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
What changed in this PR
Fixes startup recovery for empty required parameters while preserving required-value validation. Extends Dashboard diagnostics to name missing referenced parameters and documents the Aspire 17 migration.
Changes:
- Keeps missing required startup values pending so consumers can resume after Dashboard input.
- Adds dependency traversal for missing-parameter diagnostics, with replica and cycle handling.
- Adds regression tests and guidance distinguishing optional empty values from omitted values.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs | Tests recovery, optional values, and unavailable interaction. |
| tests/Aspire.Hosting.Tests/ExecutionConfigurationGathererTests.cs | Tests preservation of empty optional environment values. |
| tests/Aspire.Dashboard.Tests/Model/ResourceStateViewModelTests.cs | Tests missing-parameter diagnostics and dependency traversal. |
| src/Aspire.Hosting/Orchestrator/ParameterProcessor.cs | Validates initial values before completing consumer tasks. |
| src/Aspire.Hosting/ApplicationModel/ParameterResource.cs | Makes the existing validator available internally. |
| src/Aspire.Dashboard/Resources/xlf/Columns.zh-Hant.xlf | Adds diagnostic text awaiting Traditional Chinese translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.zh-Hans.xlf | Adds diagnostic text awaiting Simplified Chinese translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.tr.xlf | Adds diagnostic text awaiting Turkish translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.ru.xlf | Adds diagnostic text awaiting Russian translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.pt-BR.xlf | Adds diagnostic text awaiting Brazilian Portuguese translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.pl.xlf | Adds diagnostic text awaiting Polish translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.ko.xlf | Adds diagnostic text awaiting Korean translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.ja.xlf | Adds diagnostic text awaiting Japanese translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.it.xlf | Adds diagnostic text awaiting Italian translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.fr.xlf | Adds diagnostic text awaiting French translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.es.xlf | Adds diagnostic text awaiting Spanish translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.de.xlf | Adds diagnostic text awaiting German translation. |
| src/Aspire.Dashboard/Resources/xlf/Columns.cs.xlf | Adds diagnostic text awaiting Czech translation. |
| src/Aspire.Dashboard/Resources/Columns.resx | Defines missing-parameter diagnostic wording. |
| src/Aspire.Dashboard/Resources/Columns.Designer.cs | Exposes the diagnostic resource string. |
| src/Aspire.Dashboard/Model/ResourceViewModelExtensions.cs | Traverses dependencies to collect missing parameter names. |
| src/Aspire.Dashboard/Model/ResourceStateViewModel.cs | Appends missing-parameter guidance to blocked resource descriptions. |
| docs/tips-and-known-issues.md | Documents optional-value migration and startup recovery. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Final-head Dashboard/Components validation remains pending after the correction batch, including the new legacy Details refresh regression, so CI results must be confirmed before approval.
2 resolved since last review
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Final-head CI and Dashboard model/component validation remain pending, leaving dependency-only Details refresh, replica/active-wait traversal, and live parameter recovery unverified.
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Final-head Dashboard validation remains unverified: the new legacy Details regression has not run, and the reported live scenarios exercised the installed Dashboard rather than the modified UI.
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change allowing missing required startup parameters to be supplied through the Dashboard without restarting.
No open issues 🎉
1 resolved since last review
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
Review effort: Balanced
|
All three findings are addressed and verified, and the inline threads are resolved. Keeping this draft, unapproved and unmerged while final-head CI runs. 🤖 AI-authored reply via Agency Finish PR. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Updated State details in 44a7f98: the state stays separate, and the explanation is now “Missing parameter values: optional-selector. Set values in Parameters.” First screenshot: the required parameter is missing, API is Starting, and its consumer is Waiting. Second: entering 🤖 AI-authored reply via Agency Finish PR. |
Tests selector55 / 101 PR test projects · 5 PR jobs, from 26 changed files. Selected PR test projects (55 / 101)
Selected PR jobs (5)
How these were chosen — grouped by what changed
🔧 show 43
🧪 🔧 📦 affected project 📦 affected project 📦 affected project 🔧 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the resource pane still shows generic state tooltips instead of missing-parameter diagnostics, leaving the intended user-facing behavior incomplete.
No open issues 🎉
1 file not reviewed
src/Aspire.Dashboard/Resources/Columns.Designer.cs: Generated file
Review effort: Balanced
|
I checked the resource-pane concern in Copilot review PRR_kwDOKYQzfc8AAAABYKoflA. The navigation pane still uses its existing short state label; this correction does not change it. The resource grid and modern overview pass all resources to the missing-parameter diagnostic, and legacy Details uses the separate concise description. Richer navigation-pane tooltips would be a separate UI enhancement, not a regression in this correction. The live Details screenshots above show the requested behavior and recovery. 🤖 AI-authored reply via Agency Finish PR. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
The required-empty-value recovery fix can stand on its own. Please remove or defer the relationship-based dashboard diagnostic from this PR: it can miss real parameter waits, report inactive parameters as blockers, and miss reads before a resource reaches Starting. The inline comments describe the cases.
#22291 explores tracking actual pending parameter reads on the requesting resource, including early reads, as a more accurate way to address unresolved parameters in a future change. It does not replace the empty-value recovery fix here.
|
|
||
| foreach (var relationship in current.Relationships) | ||
| { | ||
| if (relationship.Type is not (KnownRelationshipTypes.Reference or KnownRelationshipTypes.WaitFor)) |
There was a problem hiding this comment.
This only finds parameters reachable through dashboard relationships or active waits, but actual parameter reads do not always create those relationships. For example, AddPostgres("postgres", password: password) uses the password in its connection string and environment callback without adding a Reference relationship to the parameter. If the password is missing, neither the server nor a resource waiting on it can find the cause through this walk. Custom environment callbacks have the same limitation.
Please defer this diagnostic or derive it from actual pending reads instead. If it stays here, a regression using a missing PostgreSQL password or a callback-only parameter would exercise the gap.
|
|
||
| if (current.IsParameter && current.KnownState is KnownResourceState.ValueMissing) | ||
| { | ||
| missingParameters.Add(current.Name); |
There was a problem hiding this comment.
A Reference relationship does not mean the parameter is currently being read. For example, a conditional reference expression exposes providers from both branches, so WithEnvironment can add relationships to both even though only one branch is evaluated. If both parameters are missing, this adds both names to the resource's explanation even though only the selected branch is blocking it.
Please avoid presenting all missing referenced parameters as the cause of the wait. If this diagnostic remains, a conditional-expression regression would cover the misleading result.
| private static string? GetMissingParameterDescription(ResourceViewModel resource, IStringLocalizer<Columns> loc, IEnumerable<ResourceViewModel>? allResources) | ||
| { | ||
| if (allResources is not null | ||
| && resource.KnownState is KnownResourceState.Starting or KnownResourceState.FailedToStart or KnownResourceState.Waiting) |
There was a problem hiding this comment.
A parameter read can block before the resource reaches Starting, such as while publishing a connection string during startup. When the resource's state is still unset, this condition skips the diagnostic even if a relationship to the parameter exists. The resource can therefore be stuck without an explanation until a state transition that the blocked read itself is preventing.
If the diagnostic remains in this PR, please cover a pending pre-start parameter read; #22291 explores tracking those reads directly.
Ella Hathaway (ellahathaway)
left a comment
There was a problem hiding this comment.
I reviewed the parameter initialization and recovery flow, along with the dashboard diagnostics and resource details.
I found two nonblocking issues in the dashboard diagnostic.
| <comment>{0} is a comma-separated list of dependency resource names.</comment> | ||
| </data> | ||
| <data name="StateColumnResourceMissingParameters" xml:space="preserve"> | ||
| <value>Missing parameter values: {0}. Set values in Parameters.</value> |
There was a problem hiding this comment.
When interactivity is disabled, the parameter has no set command and the dependent resource can already have failed to start, so this tells users to use a control they don't have. Consider only suggesting editing when it is available and otherwise directing users to configure the value and restart, with a regression test for the noninteractive case.
|
|
||
| internal static string GetResourceStateDescription(ResourceViewModel resource, IStringLocalizer<Columns> loc, IEnumerable<ResourceViewModel> allResources) | ||
| { | ||
| return GetMissingParameterDescription(resource, loc, allResources) |
There was a problem hiding this comment.
This replaces the existing state description whenever a missing parameter is found. If the resource is waiting on a and b, and only a is blocked by a missing parameter, the legacy details no longer show that it is also waiting on b. Consider including both the waiting dependencies and missing parameters, with a regression test for multiple dependencies.



Description
Fixes #21795.
An empty required startup parameter now stays pending for Dashboard input instead of faulting consumers before they can recover. State tooltips and Details name missing referenced parameters, including those behind waiting dependencies. The diagnostic follows Reference/WaitFor relationships and active waits, handles replicas and cycles, and only reads parameter names and state.
The required-value contract from #18108 is unchanged: required
null/empty values are invalid, including runtime updates. Startup now checks the existing validator before committing the initial value task, so interactive input can complete the original consumer task.User-facing usage
For an intentionally empty selector:
C#:
builder.AddParameter("optional-selector", "").WithOptional().An explicit empty optional value remains
""; an optional parameter without a configured value resolves tonulland omits the environment variable. Missing required startup values can be supplied in Dashboard Parameters without restarting the app. Existing troubleshooting guidance covers this migration. Website publication is a separate, nonblocking follow-up in microsoft/aspire.dev#2114; it has not been published by this PR.Screenshots
Captured from the rebuilt source Dashboard at
44a7f9889a. State remains separate from the explanation: Missing parameter values: optional-selector. Set values in Parameters.Missing required value: API is Starting and its consumer is Waiting.
After entering
selectedthrough Dashboard Parameters, both resources recover without restarting and the diagnostic clears.Validation
Before the fix, the initialization regression failed for all three explicit-empty cases (ordinary, secret, connection string); all three absent-value cases passed. The Hosting build and focused suite passed with zero warnings/errors and 203 tests passed:
Both current-source Dashboard builds below passed, including after the concise State details correction. The local workaround uses existing generated C# from unchanged protobuf inputs, disables native generation, and sets a fail-fast compiler path. It does not validate native regeneration. The earlier unbounded build was interrupted after macOS x86_64
protocstalled; that attempt did not pass. These managed builds report the existing ILCompiler NU1903 advisory.Passed on
44a7f9889a: 28 model tests and 74 related component tests, including both legacy regression cases:Localization regeneration also passed:
The legacy regression first reached its stale-description assertion against the old Dashboard binary, then passed against rebuilt current source. Its initial CI hang was missing viewport-size setup in the new test; managed stacks identified the splitter callback, and the correction initializes the dimensions without weakening the assertions or increasing the timeout.
Live, container-free TypeScript checks also passed:
ValueMissing, APIStarting, frontendWaiting. The rebuilt source Dashboard showedoptional-selectorin Details. Supplyingselectedthrough the real Dashboard input form recovered both resources toRunningwithout restarting and cleared the diagnostic. This was repeated for the concise State details correction shown above. The actual Dashboard process command pointed to this worktree's rebuilt DLL. The child emitted{"selector":"selected","selectorPresent":true,"absentPresent":false}.Running; the child emitted{"selector":"","selectorPresent":true,"absentPresent":false}. This earlier Hosting check used the installed Dashboard, not the modified UI.The samples used scoped
aspire start --no-build --isolated --format Json,aspire wait,aspire describe --format Json,aspire logs api --format Json, andaspire stopwith--apphostand--non-interactive. Browser automation exercised the actual source Dashboard. All samples stopped cleanly, and all heavy local work held the shared exclusive validation lock.Review and CI
Current head:
44a7f9889a20c45fc5e13d4d610ed685e7d91278. Copilot re-review and CI for this State details presentation correction are in progress.Actual GitHub Copilot reviews identified stale legacy Details after parameter-only updates, repeated resource scans, and implicit parent waits missing from static relationships. All three corrections have executed regressions, verified replies, and resolved inline threads. The previous-head Copilot re-review (5854466981, head
64d6cd49) reported No open issues in aCOMMENTEDreview, not an approval.The previous head's complete check set finished: 356 successful, 7 skipped, no failing or pending checks. CI run 42968191452, attempt 2 succeeded, including Hosting and Dashboard model/component tests on Windows and Ubuntu, all six native Dashboard platform validations, and all six starter platform validations. Native Dashboard coverage in CI includes normal generation/build paths, unlike the guarded local workaround above. These results do not stand in for the current head's pending checks.
That run's first attempt had an unrelated Windows extension
taskkilldeadline assertion and a Windows ARM64 starter diagnostics-uploadENOENTafter starter validation itself passed. Both cleared on the automatic rerun. The earlier head's component hang was an introduced test-harness issue, fixed and verified here, not an external CI failure. No approval or merge was performed by this agent.Checklist
<remarks />and<code />elements on your triple slash comments?