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

Add resolve & link progress bars #145

Merged
merged 10 commits into from
Feb 25, 2023
Merged

Add resolve & link progress bars #145

merged 10 commits into from
Feb 25, 2023

Conversation

amitdahan
Copy link
Contributor

@amitdahan amitdahan commented Feb 24, 2023

Summary

This PR adds a progress bar to resolve & link steps (so oro resolve will only show one, and oro restore will show both).

For both - the progress bar's length is the expected edge count on the dependency graph.
For linking - we increase the progress for each dependency we link, and then call finish to round it up to the actual edge count, so while we don't link each edge necessarily, the progress bar will count those in, wasn't sure that's desired or not.

Screen.Recording.2023-02-24.at.22.38.33.mov

This is very basic and naive, feedback is very welcome!

@amitdahan amitdahan marked this pull request as draft February 24, 2023 17:59
@amitdahan amitdahan marked this pull request as ready for review February 24, 2023 19:11
crates/node-maintainer/src/maintainer.rs Outdated Show resolved Hide resolved
crates/node-maintainer/Cargo.toml Outdated Show resolved Hide resolved
crates/node-maintainer/src/maintainer.rs Show resolved Hide resolved
let pb_style = ProgressStyle::default_bar()
.template("💾 {bar:40} [{pos}/{len}] {wide_msg}")
.unwrap();
let pb = ProgressBar::new(self.graph.inner.edge_count() as u64).with_style(pb_style);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things:

  1. Anywhere that we use indicatif should only do things on non-wasm32, and should be conditionalized appropriately.
  2. There should be a configuration, through NodeMaintainerOptions, that configures whether or not progress bars should be shown. This should default to false (because the default assumption is for node-maintainer to be used as a plain library without unwanted output)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully achieved what you meant here:
ed6711d

If it's way too ugly please let me know!

crates/node-maintainer/src/maintainer.rs Outdated Show resolved Hide resolved
crates/node-maintainer/src/maintainer.rs Outdated Show resolved Hide resolved
Copy link
Member

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good now! And this resolves #156

@zkat zkat merged commit dd4c6ca into orogene:main Feb 25, 2023
@zkat
Copy link
Member

zkat commented Feb 25, 2023

Thanks again for all this! 🎉

@amitdahan amitdahan deleted the progress branch February 26, 2023 10:47
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 this pull request may close these issues.

show progress bar(s) for different stages + final summary
2 participants