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 <95136+davidfowl@users.noreply.github.com>
davidfowl
reviewed
Sep 30, 2025
Copilot
AI
changed the title
[WIP] Fix ParameterProcessor publish execution context creation and skip excluded resources
Fix ParameterProcessor to use ExecutionContextOptions and skip excluded resources
Sep 30, 2025
Use the executionContext from constructor instead of creating a new publishExecutionContext Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Contributor
|
🚀 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" |
davidfowl
reviewed
Sep 30, 2025
tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
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 |
mitchdenny
approved these changes
Sep 30, 2025
Member
|
/backport to release/9.5 |
Contributor
|
Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/18171696250 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.