Repository navigation
Consolidate logger utilities between run and test - #55073
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates logger-argument recognition/parsing used across dotnet commands (notably test MTP flow and run/build-related flows) by centralizing the logic in LoggerUtility.SeparateLoggerArguments, and updating callers/tests accordingly.
Changes:
- Expand
LoggerUtility.SeparateLoggerArgumentsto recognize terminal/live logger args (and parameters), plus binlog and-noconsolelogger, and remove now-redundant helpers. - Update MTP
dotnet testbuild-option extraction to use the consolidated logger parsing and moveTestApplicationArgumentstoImmutableArray<string>. - Update
pack/publishto use the consolidated logger parsing for filtering inputs used by release-property project location logic.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet.Tests/LoggerUtilityTests.cs | Expands and consolidates test coverage for recognized logger argument forms and invalid forms. |
| src/Cli/dotnet/LoggerUtility.cs | Centralizes recognition/normalization of binlog + terminal/live logger args and removes redundant helpers. |
| src/Cli/dotnet/Commands/Test/MTP/Options.cs | Switches TestApplicationArguments from List<string> to ImmutableArray<string>. |
| src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs | Routes recognized logger args to MSBuild via SeparateLoggerArguments. |
| src/Cli/dotnet/Commands/Publish/PublishCommand.cs | Uses consolidated logger separation when preparing args for dependent project-location logic. |
| src/Cli/dotnet/Commands/Pack/PackCommand.cs | Uses consolidated logger separation when preparing args for dependent project-location logic. |
Evangelink
left a comment
There was a problem hiding this comment.
Clean, well-scoped consolidation. Verified no dangling references to the removed helpers, both transformer call sites (Pack/Publish) updated, and the
onBinLogArgs ->
onLoggerArgs switch is semantically equivalent through ReleasePropertyProjectLocator. The List -> ImmutableArray rewrite faithfully preserves the positional-arg logic. CI green. LGTM.
Follow up on #54637 merged into 10.0.4xx - since it flew into main (via #55003), some utilities can be consolidated.