Skip to content

[release/13.5] Separate regular arguments from launch tool ("entrypoint") arguments - #19234

Merged
Jose Perez Rodriguez (joperezr) merged 13 commits into
release/13.5from
backport/pr-18999-to-release/13.5
Aug 11, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 13 commits into
release/13.5from
backport/pr-18999-to-release/13.5

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Backport of #18999 to release/13.5

/cc Karol Zadora-Przylecki (@karolz-ms)

Customer Impact

Testing

Risk

Regression?

Derive DCP Process fallback availability once from the final execution type and resolved command line, including restart transitions and project-backed executable safeguards.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8c5f7a97-cd57-4236-be32-a6e129b71f88
The leading-argument segment introduced for debug support is a generally
useful primitive, but it shipped welded to debugging: the launch
configuration type was mandatory, so there was no way to say "this
resource has a tool-invocation prefix" without also saying "an IDE
debugger performs it". Whether the prefix appeared in the dashboard was
likewise implicit in two call sites rather than a property of the
declaration.

That blocks the direction settled in #18904 (WithArgs = app args,
WithXyzArgs = tool args), which needs this segment underneath: without
it an integration cannot guarantee its tool args precede user WithArgs
args, so it resorts to registration-order tricks -- exactly what
DotnetToolResource does today.

Reshape the primitive so it can carry that layer later:

- Rename to WithLaunchToolArgs. "Entrypoint" already means the
  module/script in Python's WithEntrypoint and the image ENTRYPOINT on
  containers, roughly the opposite of the meaning here.
- Make ownedByLaunchConfigurationType optional. Null means the prefix is
  not a debugging concern and is always passed to the program, which is
  the `dotnet tool exec` shape.
- Add showInCommandLine, splitting two facts that BuildLaunchArgs had
  conflated: whether the prefix is withheld from the launched process
  (an IDE-ownership question) and whether it appears in the dashboard
  command line (a declaration question).

No behavior change. Go and Python keep the same shape, and
DotnetToolResource is deliberately not migrated here -- two tests cover
the shape it would use so the primitive stays able to absorb it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b93d3d93-3cb2-4632-af31-bd6a2ea495ef
The rebase onto main left the deleted "Normal run mode" block spliced into
the Delve branch of AddGoApp's argument callback. That injected `run` and
`-race` into the `dlv` command line, made `--only-same-user` conditional on
both AcceptMultiClient being false and build tags being present, and left a
braceless `if` that failed the build with IDE0011.

Restore the two independent flag checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6fa86160-e335-404c-8144-ef2bad83e72c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ef8eab83-a8fa-4d46-a635-edc057cd6f78
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 54ccd32a-c50e-4b43-ac74-8439fa2ed56d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2832706-3a43-42eb-a327-d853af5ea638
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19234

Or

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

@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

48 / 100 test projects · 4 jobs, from 26 changed files.

Selected test projects (48 / 100)

Aspire.EndToEnd.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.GitHub.Models.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests

Selected jobs (4)

deployment-e2e, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 38 of the 48 selected test projects come from a single change — src/Aspire.Hosting/ApplicationModel/ArgumentsExecutionConfigurationGatherer.cs.

🔧 src/Aspire.Hosting/ApplicationModel/ArgumentsExecutionConfigurationGatherer.cs (changed source)
→ 38 via the project graph

show 38

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.Kubernetes.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.Browsers.Tests (2 hops), Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests (2 hops), Aspire.Hosting.DevTunnels.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.GitHub.Models.Tests (2 hops), Aspire.Hosting.JavaScript.Tests (2 hops), Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Kubernetes.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests (2 hops), Aspire.Hosting.MongoDB.Tests (2 hops), Aspire.Hosting.MySql.Tests (2 hops), Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.PostgreSQL.Tests (2 hops), Aspire.Hosting.Qdrant.Tests (2 hops), Aspire.Hosting.RabbitMQ.Tests (2 hops), Aspire.Hosting.Redis.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.SqlServer.Tests (2 hops), Aspire.Hosting.Testing.Tests (2 hops), Aspire.Hosting.Valkey.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🧪 tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests
→ 2 via the project graph: Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Radius.Tests

🔧 src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Python.Tests
→ 1 via the project graph: Aspire.Hosting.Foundry.Tests

📦 affected project Aspire.Hosting
→ 1 test: Aspire.EndToEnd.Tests

🔧 src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

🔧 src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.EntityFrameworkCore.Tests

🔧 src/Aspire.Hosting.Go/GoHostingExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Go.Tests

🧪 tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectResourceTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Dotnet.Tests

🧪 tests/Aspire.Hosting.DotnetTool.Tests/AddDotnetToolTests.cs (changed test)
→ 1 directly: Aspire.Hosting.DotnetTool.Tests

🧪 tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFCoreOperationExecutorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.EntityFrameworkCore.Tests

🧪 tests/Aspire.Hosting.Go.Tests/AddGoAppTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Go.Tests

🧪 tests/Aspire.Hosting.Python.Tests/AddPythonAppTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Python.Tests

🧪 tests/Aspire.Hosting.Tests/ExecutableResourceBuilderExtensionTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/ResourceDependencyTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

Job reasons

Job Triggered by
deployment-e2e affected project Aspire.Hosting.Azure
extension-e2e • src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs, src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs, src/Aspire.Hosting.Go/GoHostingExtensions.cs, src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs, src/Aspire.Hosting/ApplicationModel/ArgumentsExecutionConfigurationGatherer.cs, src/Aspire.Hosting/ApplicationModel/DebugSupportExtensions.cs, src/Aspire.Hosting/ApplicationModel/ExecutableLaunchConfiguration.cs, src/Aspire.Hosting/ApplicationModel/ExecutionConfigurationGathererContext.cs, src/Aspire.Hosting/ApplicationModel/LaunchToolArgsCallbackAnnotation.cs, src/Aspire.Hosting/ApplicationModel/ProjectLaunchArgsOverrideAnnotation.cs, src/Aspire.Hosting/ApplicationModel/ResourceExtensions.cs, src/Aspire.Hosting/Aspire.Hosting.csproj, src/Aspire.Hosting/CompatibilitySuppressions.xml, src/Aspire.Hosting/Dcp/DcpExecutor.cs, src/Aspire.Hosting/Dcp/ExecutableCreator.cs, src/Aspire.Hosting/DotnetToolResourceExtensions.cs, src/Aspire.Hosting/ResourceBuilderExtensions.cs, src/Aspire.Hosting/SupportsDebuggingAnnotation.cs
• affected project Aspire.Hosting.Dotnet
polyglot affected project Aspire.Hosting.Go
typescript-api-compat affected project Aspire.Hosting.Dotnet

Selection computed for commit 96c9b4f.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

This PR introduces first-class “launch tool arguments” as a separate, order-independent command-line prefix (e.g., go run ..., python -m ..., dotnet tool exec ...) and shifts entrypoint withholding for IDE debugging to DCP creation-time rather than mutating app-model args.

Changes:

  • Add WithLaunchToolArgs(...) + LaunchToolArgsCallbackAnnotation to model tool-invocation prefixes separately from ordinary WithArgs.
  • Remove the argsCallback parameter/behavior from WithDebugSupport(...) and update DCP command-line composition + fallback logic accordingly.
  • Add/adjust extensive test coverage across Hosting, DCP, Go, Python, DotnetTool, EFCore, and Dotnet project scenarios.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Aspire.Hosting.Tests/ResourceDependencyTests.cs Adds dependency discovery coverage for parameters in launch-tool args and container non-contribution.
tests/Aspire.Hosting.Tests/ExecutableResourceBuilderExtensionTests.cs Updates/expands tests for ordering, publish behavior, and ownership semantics of launch-tool args.
tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs Adds broad DCP coverage for withheld prefixes, display args, fallback recomputation, and restart behavior.
tests/Aspire.Hosting.Python.Tests/AddPythonAppTests.cs Updates Python debugging tests to keep entrypoint args in app model and rely on DCP withholding.
tests/Aspire.Hosting.Go.Tests/AddGoAppTests.cs Updates Go debugging tests to keep go run prefix in app model and validate ownership/order independence.
tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFCoreOperationExecutorTests.cs Adds regression test to ensure sequential EF commands replay callbacks without stale caching.
tests/Aspire.Hosting.DotnetTool.Tests/AddDotnetToolTests.cs Verifies custom launch-tool args replace built-in dotnet-tool invocation in args and manifest.
tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectResourceTests.cs Adds tests for custom launch-tool args replacing dotnet-run scaffolding and preserving launch-profile args.
src/Aspire.Hosting/SupportsDebuggingAnnotation.cs Removes RewritesArgumentsForDebugging from the annotation and updates factory accordingly.
src/Aspire.Hosting/ResourceBuilderExtensions.cs Adds WithLaunchToolArgs and removes argsCallback from WithDebugSupport overloads.
src/Aspire.Hosting/DotnetToolResourceExtensions.cs Switches DotnetTool default invocation to WithLaunchToolArgs(..., showInCommandLine: false).
src/Aspire.Hosting/Dcp/ExecutableCreator.cs Applies launch configuration before composing args; omits owned launch-tool prefixes for IDE; recomputes process fallback each time.
src/Aspire.Hosting/Dcp/DcpExecutor.cs Ensures restart clears cached results for LaunchToolArgsCallbackAnnotation as well.
src/Aspire.Hosting/CompatibilitySuppressions.xml Adds baseline suppression for removed WithDebugSupport(..., argsCallback) API.
src/Aspire.Hosting/Aspire.Hosting.csproj Adds InternalsVisibleTo for Aspire.Hosting.EntityFrameworkCore.
src/Aspire.Hosting/ApplicationModel/ResourceExtensions.cs Introduces GatherArgumentValuesWithoutCachingAsync and includes launch-tool args in gathered values.
src/Aspire.Hosting/ApplicationModel/ProjectLaunchArgsOverrideAnnotation.cs Documents interaction with launch-tool args replacing process base command when non-empty.
src/Aspire.Hosting/ApplicationModel/LaunchToolArgsCallbackAnnotation.cs New annotation + execution-configuration data for unresolved/resolved launch-tool prefix segments.
src/Aspire.Hosting/ApplicationModel/ExecutionConfigurationGathererContext.cs Resolves launch-tool args first, tracks surviving (non-null) prefix length, emits resolved prefix metadata.
src/Aspire.Hosting/ApplicationModel/ExecutableLaunchConfiguration.cs Updates docs to match new WithDebugSupport signature.
src/Aspire.Hosting/ApplicationModel/DebugSupportExtensions.cs Adds HasLaunchToolArgsOwnedBy(...) helper to relate prefixes to active launch configs.
src/Aspire.Hosting/ApplicationModel/ArgumentsExecutionConfigurationGatherer.cs Records launch-tool args separately (order-independent) for execution configuration building.
src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs Migrates Python entrypoint args to launch-tool segment and removes debug-time args stripping callback.
src/Aspire.Hosting.Go/GoHostingExtensions.cs Migrates Go go run prefix construction into launch-tool args and simplifies normal-args composition.
src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs Centralizes “no caching” tool-argument gathering via new internal helper.
src/Aspire.Hosting.Dotnet/DotnetProjectHostingExtensions.cs Models default dotnet run ... scaffold as launch-tool args; preserves launch-profile args in ordinary segment.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Aspire.Hosting/CompatibilitySuppressions.xml
Comment thread tests/Aspire.Hosting.Tests/ResourceDependencyTests.cs
Comment thread src/Aspire.Hosting/Dcp/ExecutableCreator.cs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important change to fix a 13.5 new-feature correctness issue. Approved. Just confirming but the removed WithDebugSupport method was experimental, correct? Even if that's the case, we should make sure to document it in the release notes for consumers, so can you please make sure that is the case?

@joperezr Jose Perez Rodriguez (joperezr) added the Servicing-approved Approved for servicing release label Aug 11, 2026
@joperezr
Jose Perez Rodriguez (joperezr) merged commit 25c30ef into release/13.5 Aug 11, 2026
348 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the backport/pr-18999-to-release/13.5 branch August 11, 2026 18:22
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone Aug 11, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

Step 5 branch taken: excluded → base_branch_is_release, head_branch_is_backport, title_release_prefix, body_backport_marker

This PR is a backport and is out of scope for docs generation per .pr-docs-check/signals.json (excluded: true). Per the exclusion rules, a backport ports an already-merged change onto a release branch, and its documentation is authored against the original forward PR (#18999) on the default branch, so drafting a second docs PR here would be duplicate noise.

Exclusion reasons (from signals.json):

Triggered signals (informational only, not evaluated since excluded overrides): experimental_attribute_added (evidence: src/Aspire.Hosting/ResourceBuilderExtensions.cs adds [Experimental("ASPIREEXTENSION001", ...)]).

No docs PR was drafted. If documentation is needed for this feature, it should be handled via the original PR #18999.

@karolz-ms

Karol Zadora-Przylecki (karolz-ms) commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Important change to fix a 13.5 new-feature correctness issue. Approved. Just confirming but the removed WithDebugSupport method was experimental, correct? Even if that's the case, we should make sure to document it in the release notes for consumers, so can you please make sure that is the case?

Jose Perez Rodriguez (@joperezr) WithDebugSupport changes are that one overload was added and the original overload was reset to pre-13.5 state, so there is no net change. There is already a doc change for the new overload.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants