IEP-1049: Add a validation for esp-idf path in the install tools dialog
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.
[!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 reviewcommand 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?
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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
@AndriiFilippov please verify once the PR comments are addressed!
@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.
THEN:
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.?
@alirana01 hi !
Tested under: OS - Windows 10
It now let you to select ESP-IDF with spaces in path like this:
BUT downloading validation a bit broken.
to reproduce: select release 4.4 and folder with spaces.
and now switch version to >=5.0 - bug ⛔
The same works for opposite way: select >=5.0 - it pass validation and then select v4.4 - no validation
Probably we should delete this part of info message. It does not make sense.
@AndriiFilippov please verify after the builds and also make sure to test on mac and linix
@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.
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:
But if the empty folder selected, this message does not have any sense:
instead should be:
@alirana01 hi !
Tested under: OS - Windows 11 / MacOS arm64
LGTM 👍