-
Notifications
You must be signed in to change notification settings - Fork 709
Fix ParameterProcessor to use ExecutionContextOptions and skip excluded resources #11734
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
Fix ParameterProcessor to use ExecutionContextOptions and skip excluded resources #11734
Conversation
…ed resources - Use DistributedApplicationExecutionContextOptions constructor in CollectDependentParameterResourcesAsync - Copy ServiceProvider from existing execution context when available - Skip resources excluded from publish using IsExcludedFromPublish() - Add tests to verify ServiceProvider access and excluded resource filtering Co-authored-by: davidfowl <[email protected]>
Use the executionContext from constructor instead of creating a new publishExecutionContext Co-authored-by: davidfowl <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11734Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11734" |
tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs
Outdated
Show resolved
Hide resolved
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 fixes two issues in the ParameterProcessor to properly handle ExecutionContextOptions and skip resources excluded from publish during parameter collection.
- Fix ParameterProcessor to use existing executionContext instead of creating new one without proper options
- Add filtering to skip resources marked as excluded from publish using IsExcludedFromPublish() extension method
- Add comprehensive tests to verify both fixes work correctly
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting/Orchestrator/ParameterProcessor.cs | Modified CollectDependentParameterResourcesAsync to use existing executionContext and skip excluded resources |
| tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs | Added two new tests to verify ExecutionContextOptions usage and excluded resource filtering |
|
/backport to release/9.5 |
|
Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/18171696250 |
Summary of Changes
Code Changes
src/Aspire.Hosting/Orchestrator/ParameterProcessor.cs:executionContextfrom constructor instead of creating new execution contextIsExcludedFromPublish()extension methodTest Changes
tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs:InitializeParametersAsync_UsesExecutionContextOptions_DoesNotThrowtest to verify ServiceProvider access works without throwing InvalidOperationExceptionInitializeParametersAsync_SkipsResourcesExcludedFromPublishtest to verify resources marked withManifestPublishingCallbackAnnotation.Ignoreare skipped during parameter collectionTest Results
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.