-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Ability for Tasks (such as NuGet) to display progress, have fine-grained cursor position control #6944
Comments
FWIW, here's a video/gif of my sample running at different verbosity. You can see how I don't have control to remove the progress message before the log messages are written, so only the edit: in fact, in the |
Perhaps this could interoperate with the Windows Terminal progress bar feature microsoft/terminal#3004. |
We're gonna do this for the new |
Prior art on semi-general progress reporting: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress |
We are also looking forward to this as we are seeing some dotnet commands like If this can help, I can write a proposal and make a PR for this? |
For bookkeeping: we've split this up into
@xoofx we'll get back to you by ~tomorrow about whether anyone on our team has planned to work on this in the short term. |
@xoofx Nobody is already working on it, please feel free to work up a design! To be super clear about expectations, it's probably a 17.10 timeline thing, and we'll have to coordinate with NuGet to get them to adopt the API after it exists, so this'll be the first step--but a necessary one! |
If we want another test case I'd love for Container Layer upload in SDK Containers to prove out the API and Implementation. |
Something that recently came up in a discussion: we'll need to think about throttling the progress messages, because the easiest use of the API will be something like "update progress every time there's something new in the active state" (e.g. "running test Test1", "running test Test2, 1 failed test", "running test Test3, 1 failed test") . . . but we don't need all of that in the TL output or in the binlog. |
One thought I had for that was that the binlog (and even the current console logger) would just display whatever the 'final' result was, some kind of summary event that says that "operation X completed in Y time with Z final summary". More thoughts to come later today. |
A bit delayed, made a tiny spec here to serve as the basis of discussion: https://gist.github.com/baronfel/c41cf19737532af0c1c07f8bff08a646 |
Another use case - the |
As some of you know, I work on NuGet client. For Microsoft's annual hackathon, I was investigating this NuGet issue: NuGet/Home#4346. It's about adding progress indicators, similar to what docker, npm, and others have.
I think in order to provide a "good" progress bar, or spinner, I need to be able to control the cursor position, including synchronous "blocking" when a log message is being output in order to allow me to clear any existing progress message (in case the progress message is longer than the log message being written), and then re-write the progress message, so the progress message is always on the last line.
However, in my testing, when I have a task using
TaskLoggingHelper
, when I call theLog*
methods, the method returns before the message is written to the console. Therefore, trying to useConsole.SetCursorPosition(0, Console.CursorTop)
, callingLog.LogMessage(...)
, and thenConsole.Write(...)
to write my progress status doesn't work, as MSBuild's console logger usually (but not always) writes the console log after my progress status.See code sample
Here's a code sample for a Task that can be run to demonstrate the issue. Try running it with different verbosities (
-v:q
,-v:n
).Sorry that the code is quite convoluted for a sample. I was trying to be "kind of" realistic for production code, while still being relatively minimalistic for a sample.
I can't think of any way to use existing APIs to improve NuGet's restore task to have similar progress feedback that customers of similar tools from other ecosysems are used to.
The text was updated successfully, but these errors were encountered: