msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Feature Request]: Improvements to the Copy task warnings in Terminal Logger

Open baronfel opened this issue 3 weeks ago • 1 comments

Summary

After https://github.com/dotnet/msbuild/pull/10296 we can now see the warnings from the Copy Task during the build of a project, not just after all of the retries have failed. However, the current display is visually noisy. This issue gathers a few mockups that @surayya-MS and I discussed and some of the pros and cons of each.

Background and Motivation

Users like the visual layout of the 'grouped' diagnostics of a project during a build - it reduces noise and makes the important data more easily understood - code, severity, and message. The current layout emits the Copy warnings as 'immediate messages' in Terminal Logger lingo - fully-qualified message strings that are emitted to the 'static' area of the TL display.

TerminalLoggerCopyRetry_NewBehavior

Proposed Feature

Here are a few mockups of potential treatments of the Copy task warnings. Note that none of these assume the availability of the progress-reporting mechanism we have been designing.

Grouped Immediate Messages

The first proposal is for a concept of a 'grouped immediate message'. The idea is that when logging some immediate messages, we may expect more messages for the same project. In such a case we could emit the immediate message as two immediate messages initially - one with the path to the project, the next with the project-less trimmed diagnostic - and then subsequent immediate messages in the same project scope could trim the project from the diagnostic and emit the 'slim' form of the diagnostic.

For Copy, that might look something like this:

image

However, when another project completes during the Copy retry loop, or another Immediate message is written, we would need to 're-group' the immediate messages from the copy retries after those other groups were written:

image

Alternative Designs

Other designs follow a similar nesting structure:

Grouped Immediate messages with counter

In this example the Copy message itself is mutated into just the 'core' message and a counter, incrementing each iteration. This would possibly require some structured data coming out of the copy warning to allow for reformatting in this way

image

Grouped Immediate message with overwriting

This example is similar to the last with one key difference - only a single Copy warning line would be written and the counter value would be incremented each time. This would require potentially a new 'zone' of the display to write these kinds of messages to. This is the closest to the progress/status reporting we've been talking about previously.

baronfel avatar Jun 27 '24 15:06 baronfel