Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 1, 2025

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

Copilot AI and others added 6 commits October 1, 2025 22:30
…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]>
Copy link
Contributor Author

github-actions bot commented Oct 1, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11788

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11788"

@joperezr
Copy link
Member

joperezr commented Oct 2, 2025

Regression, low risk, tested. Approved.

This was referenced Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants