- 
                Notifications
    You must be signed in to change notification settings 
- Fork 715
Added support for prompting for parameter values in run mode #10235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Handle prompting for parameters once they have all been processed. This also handles re-prompting until they have all been processed. - Introduced MissingParameterValueException to detect when parameters are have a missing value. - Moved all parameter processing logic into ParameterProcessor
…eraction handling
…ters and improve async handling
…ing and interaction service usage
…handling and parameter processing
…ingParameterValueException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes parameter handling into a new ParameterProcessor, introduces MissingParameterValueException for missing parameter values, and updates existing builders and orchestrator to use this new flow.
- Tests now expect MissingParameterValueExceptioninstead ofDistributedApplicationException.
- A ParameterProcessorclass encapsulates init/handling logic forParameterResource.
- The orchestrator and builder are updated to register and invoke the new processor upfront.
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 | 
|---|---|
| tests/Aspire.Hosting.Tests/WithReferenceTests.cs | Updated exception assertion to MissingParameterValueException. | 
| tests/Aspire.Hosting.Tests/WithEnvironmentTests.cs | Updated exception assertion to MissingParameterValueException. | 
| tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs | Added comprehensive tests for parameter initialization and unresolved handling. | 
| tests/Aspire.Hosting.Tests/Orchestrator/ApplicationOrchestratorTests.cs | Registered and passed ParameterProcessorin orchestrator factory helper. | 
| src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs | Threw MissingParameterValueExceptioninstead of generic. | 
| src/Aspire.Hosting/Orchestrator/ParameterProcessor.cs | New class with async init and interactive re-prompt loop. | 
| src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs | Injected and invoked ParameterProcessorduring startup. | 
| src/Aspire.Hosting/DistributedApplicationBuilder.cs | Registered ParameterProcessorin DI container. | 
| src/Aspire.Hosting/ApplicationModel/ParameterResource.cs | Extended to await a TaskCompletionSourcefor late-bound values. | 
| src/Aspire.Hosting/ApplicationModel/MissingParameterValueException.cs | New exception type with XML docs. | 
Comments suppressed due to low confidence (1)
src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs:440
- [nitpick] It would be beneficial to add a unit test in ApplicationOrchestratorTeststo verify thatParameterProcessor.InitializeParametersAsyncis invoked and correctly initializes parameters during orchestration startup.
        await _parameterProcessor.InitializeParametersAsync(_model.Resources.OfType<ParameterResource>()).ConfigureAwait(false);
| @@ -0,0 +1,375 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
    
      
    
      Copilot
AI
    
    
    
      Jul 3, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This test class is over 350 lines long, covering multiple scenarios. Consider splitting it into smaller, focused test classes (e.g., initialization tests vs. unresolved-parameter handling tests) to improve readability and maintainability.
…lse and change PrimaryButtonText to "Save"
| { | ||
| private readonly List<ParameterResource> _unresolvedParameters = []; | ||
|  | ||
| public async Task InitializeParametersAsync(IEnumerable<ParameterResource> parameterResources) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this take a cancellation token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Description
Screen.Recording.2025-07-03.010951.mp4
Missing features
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate