-
Couldn't load subscription status.
- Fork 712
Backport PR #11951: Add noProfileSwitch to run command in DotNetCliRunner #11959
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
Conversation
…nd and filter empty arguments Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11959Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11959" |
1 similar comment
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11959Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11959" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR backports changes from #11951 to improve the consistency of the dotnet run command behavior between single-file and multi-file AppHost projects in the Aspire CLI.
- Updated single-file project run command to include the
noProfileSwitchparameter and use--fileflag instead of positional argument - Added argument filtering to remove empty or whitespace-only arguments from the CLI command array
- Enhanced test coverage with three new test methods to validate the changes
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Cli/DotNet/DotNetCliRunner.cs | Updated single-file project run command construction and added empty argument filtering |
| tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs | Added feature enablement to existing test and three new test methods for single-file AppHost scenarios |
|
"🚀 Dogfood this PR with:" What is Dogfood? |
This PR backports the changes from #11951 to ensure consistent behavior between single-file and multi-file AppHost project runs in the Aspire CLI.
Changes
DotNetCliRunner.cs
noProfileSwitchargument, aligning behavior with multi-file projects--fileflag for single-file projectsdotnet runBefore:
After:
And added:
DotNetCliRunnerTests.cs
AddPackageAsyncUseFilesSwitchForSingleFileAppHosttest to enable theSingleFileAppHostEnabledfeatureRunAsyncAppliesNoLaunchProfileForSingleFileAppHost- Validates that--no-launch-profileis included when specifiedRunAsyncDoesNotIncludeNoLaunchProfileForSingleFileAppHostWhenNotSpecified- Validates the flag is omitted when not specifiedRunAsyncFiltersOutEmptyArgumentsForSingleFileAppHost- Validates that empty arguments are properly filtered outTesting
All 386 CLI tests pass successfully with these changes, confirming no regressions were introduced.
Note
The original PR #11951 included additional tests that depend on features (
Debugproperty,nonInteractiveSwitch, andverboseSwitch) not present in the target branch. This backport includes only the compatible changes while maintaining the core functionality improvements.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.