Repository navigation
[release/13.5] Separate regular arguments from launch tool ("entrypoint") arguments - #19234
Jose Perez Rodriguez (joperezr) merged 13 commits into
Conversation
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
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19234Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19234" |
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)
Selected jobs (4)
How these were chosen — grouped by what changed
🔧 show 38
🧪 🔧 📦 affected project 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
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(...)+LaunchToolArgsCallbackAnnotationto model tool-invocation prefixes separately from ordinaryWithArgs. - Remove the
argsCallbackparameter/behavior fromWithDebugSupport(...)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.
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
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?
25c30ef
into
release/13.5
|
✅ No documentation update needed. Step 5 branch taken: This PR is a backport and is out of scope for docs generation per Exclusion reasons (from signals.json):
Triggered signals (informational only, not evaluated since excluded overrides): No docs PR was drafted. If documentation is needed for this feature, it should be handled via the original PR #18999. |
Jose Perez Rodriguez (@joperezr) |
Backport of #18999 to release/13.5
/cc Karol Zadora-Przylecki (@karolz-ms)
Customer Impact
Testing
Risk
Regression?