Skip to content

Consolidate logger utilities between run and test - #55073

Merged
jjonescz merged 4 commits into
dotnet:mainfrom
jjonescz:sprint-logger-consolidate
Jul 1, 2026
Merged

jjonescz merged 4 commits into
dotnet:mainfrom
jjonescz:sprint-logger-consolidate

Conversation

@jjonescz

Copy link
Copy Markdown
Member

Follow up on #54637 merged into 10.0.4xx - since it flew into main (via #55003), some utilities can be consolidated.

@jjonescz
jjonescz requested a review from Copilot June 30, 2026 12:35
@jjonescz jjonescz added Area-dotnet test Area-Run Issues relating to `dotnet run` Area-run-file Items related to the "dotnet run <file>" effort labels Jun 30, 2026

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

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.SeparateLoggerArguments to recognize terminal/live logger args (and parameters), plus binlog and -noconsolelogger, and remove now-redundant helpers.
  • Update MTP dotnet test build-option extraction to use the consolidated logger parsing and move TestApplicationArguments to ImmutableArray<string>.
  • Update pack/publish to 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.

@jjonescz
jjonescz marked this pull request as ready for review June 30, 2026 16:00
@jjonescz
jjonescz requested review from a team as code owners June 30, 2026 16:00

@Evangelink Evangelink left a comment

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.

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.

@jjonescz
jjonescz merged commit 21f27d6 into dotnet:main Jul 1, 2026
26 checks passed
@jjonescz
jjonescz deleted the sprint-logger-consolidate branch July 1, 2026 08:40
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-dotnet test Area-Run Issues relating to `dotnet run` Area-run-file Items related to the "dotnet run <file>" effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants