dotnet / dotnet/msbuild

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

Open
#10,303 4 comments 1 reaction 0 assignees View on GitHub
Area: Terminal Logger Feature Request triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### 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](https://github.com/dotnet/msbuild/assets/114938397/e8154377-d692-428c-979b-ee8e776b8ff7)

### 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](https://github.com/dotnet/msbuild/assets/573979/39640950-c8f6-4b6a-9de0-b09627e6dd00)

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](https://github.com/dotnet/msbuild/assets/573979/3dd6939b-ce8e-4a66-b5eb-ea0c27c7c85e)

### 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](https://github.com/dotnet/msbuild/assets/573979/78f844de-bf0b-4e21-977c-458cce269ff9)

## 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.