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

Doctor command for Health check #393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Harshil-Jani
Copy link
Contributor

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ New Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 👷 Example Application
  • 🧑‍💻 Code Snippet
  • 🎨 Design
  • 📖 Content
  • 🧪 Tests
  • 🔖 Release
  • 🚩 Other

Description

This PR add a doctor command which will perform some sanity checks on well-being of the web5 cli.

Related Tickets & Documents

Resolves #388

Mobile & Desktop Screenshots/Recordings

image

Added code snippets?

  • 👍 yes
  • 🙅 no, because they aren't needed

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

No tests? Add a note

Added to documentation?

  • 📜 readme
  • 📜 contributing.md
  • 📓 general documentation
  • 🙅 no documentation needed

No docs? Add a note

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@Harshil-Jani
Copy link
Contributor Author

Hii I have a doubt regarding how do we plan to health check on dependencies. I have added my doubt as a comment in code so that it can provide better context. Any help would be really appreciated.

@blackgirlbytes
Copy link
Contributor

Nice thank you! It looks like you have a few failing tests, but I'll ping @nitro-neal and @KendallWeihe to address your questions!

@blackgirlbytes
Copy link
Contributor

Can you try running the command below to get rid of test vector errors?

git submodule update --init

@Harshil-Jani
Copy link
Contributor Author

Hii @blackgirlbytes , I ran the command and it created a web5-spec submodule. But there is nothing new in my diff which I can push to fix the failing check. Am I missing something ?

@nitro-neal
Copy link
Contributor

nitro-neal commented Oct 16, 2024

ahh all the test vectors actually passed (5) but since this is a pr from an outside source our reporting tool is crashing to show that.

This is a bug and I'll create an issue, but we can continue as this pr does not affect test vectors

added issuer - #395

Comment on lines +25 to +27
fn check_cli_version() -> Option<Option<String>> {
Some(Some(env!("CARGO_PKG_VERSION").to_string())) // This will return the binary version.
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fn check_cli_version() -> Option<Option<String>> {
Some(Some(env!("CARGO_PKG_VERSION").to_string())) // This will return the binary version.
}
fn check_cli_version() -> Option<String> {
Some(env!("CARGO_PKG_VERSION").to_string())
}

can we remove the double Option and Some

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can but the first reason why I kept it over there is because let's say you want to run individual tests then in the print function , I needed a way to check if a user has asked for a certain check or not.

Let me re-think this in some other possible way.

Some(env_vars)
}

async fn check_connectivity() -> Option<bool> {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to check connectivity here?

for did web and did dht resolution ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes for web mainly
web5 did create web https://blackgirlbytes.com

@nitro-neal
Copy link
Contributor

fyi trying to run from my laptop:

image

in both parent directory and web5_cli

web5 did create jwk in the main directory it works:
image

Comment on lines +29 to +34
fn check_dependencies() -> Option<HashMap<String, bool>> {
// TODO : Implement this function
// DOUBT : Are we expecting to check system dependencies or dependencies in Cargo.toml ?
// If cargo dependencies then how exactly shall we check the versions ?
None
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we dont need this, everything should be in the cli binary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Will skip this then.

@nitro-neal
Copy link
Contributor

if you merge back up to main the test vectors tests should pass now and give checks

@taniashiba
Copy link
Contributor

Following up on this PR as well @KendallWeihe @nitro-neal - Does @Harshil-Jani need to do anything else in order to close this PR? Since Hacktoberfest closes this week on Thursday, wanted to make sure all PRs are resolved so that contributors will get credit. Thank you so much! 🙏

@KendallWeihe
Copy link
Contributor

Hello 👋

Looks like we need to rebase onto main (or merge is fine too) and also address this comment and this comment and then we can get this merged!

@taniashiba
Copy link
Contributor

Hi @Harshil-Jani - To ensure your PR can be approved and count towards Hacktoberfest, please address the comments above by today, latest early tomorrow before Hacktoberfest closes. Thank you so much! 🙏

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

Successfully merging this pull request may close these issues.

Implement Post-Installation Verification for Web5 CLI
5 participants