Skip to content
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

User Friendly Progress Output #42

Closed
azriel91 opened this issue Oct 23, 2022 · 1 comment · Fixed by #66
Closed

User Friendly Progress Output #42

azriel91 opened this issue Oct 23, 2022 · 1 comment · Fixed by #66

Comments

@azriel91
Copy link
Owner

azriel91 commented Oct 23, 2022

User Friendly Progress Output

Progress Rendering

During command execution, to provide understandable output, we should have:

  • Progress bars
  • Elapsed time
  • Estimated time remaining
  • Enough information -- not too little, not too much.
  • Color/Colour indicating importance of information, as well as status (queued/pending, success, in progress, failure, error)

Progress Data Model

Because peace is intended to support:

  • interactive command line
  • build logging
  • machine readable output
  • web request output

Then:

  • The progress information needs to be serializable.
  • It should contain enough information to be rendered.
  • On a web page, detail may be collapsible, so including more information may be okay to avoid additional round trip time.

Bonus

For a CLI process / web request that is executed separately to the process that is running the command execution, the progress information needs to be retrievable independently. So:

  • Progress information needs to be retrievable by a separate process -- perhaps written to / read from disk, or exposed on a well-known port.

Available Libraries

The libraries should ideally support async Rust with tokio, since that's what peace uses.

@azriel91
Copy link
Owner Author

azriel91 commented Nov 5, 2022

Should consider:

  • Library agnostic progress types.

    • Allows us to serialize the progress output for web and native targets

    • Allows another process to read the progress of an existing running process.

    • indicatif spawns its own threads and writes to stdout/stderr or something TermLike.

      Ideally we want something that:

      • Writes to W: AsyncWrite
      • Uses tokio's executor instead of spawning more threads.
      • Uses rich types for its unit of work, so that progress bars can be styled for the point of err.
  • Translatable progress messages, e.g. with fluent

    Something to consider for error messages as well.

Tasks:

  • Design progress model.
  • Implement progress model.
  • Implement CliProgressOutput -- update CliOutput to support progress bars.
  • Implement JsonProgressOutput -- update CliOutput to output JSON for progress.
  • Use is-terminal to automatically switch between displaying progress bars or logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant