-
Notifications
You must be signed in to change notification settings - Fork 704
[release/9.5] Fix CommandLineArgsCallbackContext ExecutionContext in AzureResourcePreparer and prevent WithVSCodeDebugSupport execution in publish mode #11788
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
Merged
Merged
Conversation
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
…reparer Set the ExecutionContext property when creating CommandLineArgsCallbackContext in AzureResourcePreparer.GetAzureReferences() to match how EnvironmentCallbackContext is created. This ensures callbacks receive the correct execution context (Publish vs Run mode), preventing WithVSCodeDebugSupport from incorrectly attempting to access ServiceProvider during manifest generation. Co-authored-by: davidfowl <[email protected]>
Add check at method level to only register WithArgs callback when builder.ApplicationBuilder.ExecutionContext.IsRunMode is true. This prevents the callback from being registered during publish mode, avoiding unnecessary callback evaluation during manifest generation. Co-authored-by: davidfowl <[email protected]>
Added tests to verify that WithVSCodeDebugSupport does not add the SupportsDebuggingAnnotation in publish mode, only in run mode. This ensures the debugging annotation is only added when appropriate. Co-authored-by: davidfowl <[email protected]>
- Reverted formatting change in ResourceBuilderExtensions.cs (return statement on one line) - Improved CommandLineArgsCallbackContextHasCorrectExecutionContextDuringPublish test to: - Remove unnecessary IsRunMode check in callback - Capture ExecutionContext to verify it's set correctly - Assert ExecutionContext is not null and in Publish mode 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 -- 11788 Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11788" |
captainsafia
approved these changes
Oct 1, 2025
davidfowl
approved these changes
Oct 2, 2025
Regression, low risk, tested. Approved. |
This was referenced Oct 13, 2025
This was referenced Oct 20, 2025
Open
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Open
Open
Closed
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #11783 to release/9.5
/cc @davidfowl @copilot
Customer Impact
We introduced a regression when adding vs code debugging support for python. This fixes it.
Testing
Automated and manual.
Risk
Low
Regression?
Yes