mitre / hipcheck

Automatically assess and score software repositories for supply chain risk.
https://mitre.github.io/hipcheck/
Apache License 2.0
62 stars 3 forks source link

feat: Shell rework #198

Closed vcfxb closed 1 month ago

vcfxb commented 1 month ago

This PR contains an early but hopefully mostly functional draft of the new hipcheck shell.

This is marked as a draft because there are almost certainly bugs that I haven't gotten around to fixing yet, but it should be in a state where people can start finding them and contributing commits to fix them or letting me know about them. Once enough of the bugs are cleared, we can merge this, and then have other pull requests to start converting various phases and analyses to use the new SpinnerPhase and ProgressPhase structs.

This includes all the changes from #195, which I'm assuming will get merged before this.

alilleybrinker commented 1 month ago

Looking forward to testing this later today!

alilleybrinker commented 1 month ago

Just tested it out and this is very cool! Will discuss more at today's sync :smile:

vcfxb commented 1 month ago

Let me know if/when this should move out of "draft" status -- I think the remaining things to do are:

alilleybrinker commented 1 month ago

Let me know if/when this should move out of "draft" status -- I think the remaining things to do are:

  • [ ] Ensure progress bars are hidden when verbosity is set to silent.
  • [ ] (optionally) create a silence guard type that sets the verbosity to silent when instantiated, then returns it to it's previous state when dropped.
  • let me know if there is anything else.

I think those are the blockers, yeah. Once that's done I think we can merge and then make further refinements from there.

vcfxb commented 1 month ago

@mitre/hipcheck-maintainers This PR now has the last two items need to come out of draft and be ready for full review!

j-lanson commented 1 month ago

when trying to run cargo build I get the following:

error[E0658]: associated type bounds are unstable
   --> hipcheck/src/shell/par_iter.rs:306:3
    |
306 |         Tracker: ExactSizeIterator + DoubleEndedIterator + Iterator<Item = T>,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information

For more information about this error, try `rustc --explain E0658`.

Has this been encountered yet?

vcfxb commented 1 month ago

when trying to run cargo build I get the following:

error[E0658]: associated type bounds are unstable
   --> hipcheck/src/shell/par_iter.rs:306:3
    |
306 |         Tracker: ExactSizeIterator + DoubleEndedIterator + Iterator<Item = T>,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information

For more information about this error, try `rustc --explain E0658`.

Has this been encountered yet?

Haven't seen that on my end -- what version of rustc are you using?

j-lanson commented 1 month ago

Haven't seen that on my end -- what version of rustc are you using?

rustc 1.77.2

alilleybrinker commented 1 month ago

Ah, Rust recently stabilized associated type bounds like Venus has done here. In general our policy today is that we track stable, so we technically no longer support 1.77.0. Maybe it's worth revisiting that policy, but since we generally try to focus on our pre-built binaries rather than build from source for users, I'm not especially worried.

In the future this could become an issue if we wanted to pursue packaging with system package ecosystems like Debian apt, where they run older Rust toolchains.