idf-eclipse-plugin icon indicating copy to clipboard operation
idf-eclipse-plugin copied to clipboard

IEP-1049: Add a validation for esp-idf path in the install tools dialog

Open alirana01 opened this issue 1 year ago • 8 comments

Description

Added validation in tools installation to check for idf directory

Fixes # (IEP-1049)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Select a directory that is not ESP-IDF the installation dialog should reflect proper error message and valid idf directory should allow installation of tools

Test Configuration:

  • ESP-IDF Version: any
  • OS (Windows,Linux and macOS): all

Checklist

  • [x] PR Self Reviewed
  • [x] Applied Code formatting
  • [ ] Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • New Features

    • Enhanced validation logic for IDF tools and paths, providing clearer error messages and improved checks.
    • Introduced a method to dynamically retrieve the IDF version using Git.
  • Refactor

    • Simplified version validation process and IDF tool path handling.
    • Removed unnecessary method prompting users about spaces in project paths.
  • Bug Fixes

    • Improved clarity of error messages related to missing IDF Python scripts and improper directory selection.
  • Documentation

    • Updated user-facing messages for better clarity regarding the installation process and handling of directory paths.

alirana01 avatar Jun 12 '24 13:06 alirana01

[!WARNING]

Rate limit exceeded

@alirana01 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 59 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 00b6d3791d30af1f327c3d0da9698dfd8ba5e732 and 49974189a21d7b60dbf5eddc67fba2a053e0ec58.

Walkthrough

The updates significantly enhance the validation and error handling for the ESP-IDF tool installation in the Espressif IDE. Key improvements include new methods for retrieving and validating the IDF version, clearer error messages for better user feedback, and a more streamlined logic for handling spaces in paths, contributing to an overall more robust installation experience.

Changes

File Path Change Summary
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/IDFDownloadPage.java Enhanced version validation logic; added methods for retrieving the IDF version via Git and improved error handling related to spaces in paths.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/Messages.java Renamed message for clarity and introduced a new message for space-related versioning issues.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/messages.properties Updated user-facing messages to clarify the identification of the ESP-IDF directory and the impact of spaces in paths for versions beyond 5.0.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsJob.java Simplified logic for setting the IDF version, ensuring consistent retrieval and improving code readability with new comments.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java Cleaned up the code by removing an unused LaunchBarListener import, enhancing code clarity.

Poem

In the garden where code doth bloom,
Version checks chase away the gloom.
Clear messages guide with a gentle sway,
Helping the users find their way.
With each update, we hop with delight,
Espressif's tools shine ever so bright! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 12 '24 13:06 coderabbitai[bot]

@AndriiFilippov please verify once the PR comments are addressed!

kolipakakondal avatar Jul 03 '24 09:07 kolipakakondal

@alirana01 hi !

Tested under: OS - Windows 10

select any folder with white space. The white space validation was executed. Then, the absence of the esp-idf folder was not validated, allowing the process to proceed with the incorrect folder.

image

THEN: image

AndriiFilippov avatar Jul 03 '24 12:07 AndriiFilippov

nce of the esp-idf folder was no

@alirana01 Can you please look into this?

Can we also avoid showing error message popups on the wizard? Instead, we could show error messages in the wizard's message area at the top.?

kolipakakondal avatar Jul 09 '24 12:07 kolipakakondal

@alirana01 hi !

Tested under: OS - Windows 10

It now let you to select ESP-IDF with spaces in path like this: image

BUT downloading validation a bit broken.
to reproduce: select release 4.4 and folder with spaces. image

and now switch version to >=5.0 - bug ⛔ image

The same works for opposite way: select >=5.0 - it pass validation and then select v4.4 - no validation
image

AndriiFilippov avatar Jul 18 '24 14:07 AndriiFilippov

Probably we should delete this part of info message. It does not make sense. image

AndriiFilippov avatar Jul 18 '24 14:07 AndriiFilippov

@AndriiFilippov please verify after the builds and also make sure to test on mac and linix

alirana01 avatar Jul 23 '24 11:07 alirana01

@alirana01 hi !

Tested under: OS - Windows 11 / MacOS

Well, since we have removed releasev4.4 from Download versions list - it became more easier :D

I don't like only this behave- when we select just empty folder(with whitespaces) the validation starts for "release <5.0" not the validation for esp-idf folder.

image

So, my point is: the validation for release <v5.0 should be just in case if the v4.4 selected in a folder with whitespace like here: image

But if the empty folder selected, this message does not have any sense:

image

instead should be: image

AndriiFilippov avatar Aug 09 '24 09:08 AndriiFilippov

@alirana01 hi !

Tested under: OS - Windows 11 / MacOS arm64

LGTM 👍

AndriiFilippov avatar Aug 29 '24 17:08 AndriiFilippov