Skip to content

IEP-1694 esp-idf manager view: version number not shown#1421

Merged
kolipakakondal merged 1 commit into
masterfrom
IEP-1694
Mar 27, 2026
Merged

IEP-1694 esp-idf manager view: version number not shown#1421
kolipakakondal merged 1 commit into
masterfrom
IEP-1694

Conversation

@sigmaaa
Copy link
Copy Markdown
Collaborator

@sigmaaa sigmaaa commented Mar 25, 2026

Description

If ESP-IDF was installed via an older version of EIM, the activation script could, in some cases, return ESP_IDF_VERSION="", which causes an error on the IDE side. The goal of this PR is to make the check more robust and provide feedback to the user if this happens.

image

Fixes # (IEP-1694)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

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

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • New Features

    • Enhanced ESP-IDF version detection interface with warning indicators for detection failures
    • Added informational tooltips displaying version details and error guidance
  • Bug Fixes

    • Improved version detection parsing for more robust and reliable results

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

This pull request enhances ESP-IDF version detection and display by tightening version string parsing in ToolsUtility to handle empty values and whitespace, while adding UI improvements to ESPIDFMainTablePage that display a "Detection Failed" message with warning icons and tooltips when version detection fails, supported by new localized message entries.

Changes

Cohort / File(s) Summary
Version Parsing Enhancement
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java
Modified getIdfVersion() to initialize espIdfVersion to empty string instead of null and added trimming of whitespace from parsed version values with stricter validation of split line segments.
Message Localization
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/Messages.java, bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/messages.properties
Added three new message keys for version detection UI: VersionDetectionFailedMsg, VersionErrorToolTip, and VersionToolTip with their localized text for display and tooltips.
Version Column Display Enhancement
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java
Enhanced version column label provider with custom getText() showing "Detection Failed" for empty versions, getImage() displaying warning icon for failures, and getToolTipText() providing contextual tooltips; also enabled tooltip support for the entire table viewer.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • kolipakakondal
  • AndriiFilippov
  • alirana01

Poem

🐰 Version visions! We parse with care,
Trimming whitespace from the air,
When detection stumbles, warnings show,
With tooltips dancing, users know! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'IEP-1694 esp-idf manager view: version number not shown' clearly and specifically describes the main issue addressed in the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch IEP-1694

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java`:
- Around line 51-54: The current parsing sets espIdfVersion =
line.split("=")[1].trim() which leaves quoted-empty values like "" as non-empty;
update the parsing in ToolsUtility.java (the block that checks
line.startsWith("ESP_IDF_VERSION=") and assigns espIdfVersion) to strip
surrounding double quotes (if present) and treat the result as empty when it
becomes an empty string (e.g., remove leading/trailing '"' after trim or check
for a literal "\"\"" and set espIdfVersion to null/empty), so downstream UI
empty checks correctly trigger the “Detection Failed” path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a647304f-cf0c-4ce9-8047-0dfa86e8d330

📥 Commits

Reviewing files that changed from the base of the PR and between 5862981 and 1953f57.

📒 Files selected for processing (4)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/Messages.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/messages.properties

Comment on lines +51 to 54
if (line.startsWith("ESP_IDF_VERSION=") && line.split("=").length >= 2) //$NON-NLS-1$ //$NON-NLS-2$
{
espIdfVersion = line.split("=")[1]; //$NON-NLS-1$
espIdfVersion = line.split("=")[1].trim(); //$NON-NLS-1$
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Handle quoted-empty version values before returning.

On Line 53, ESP_IDF_VERSION="" is parsed as "" (non-empty text), so the UI empty check won’t trigger the “Detection Failed” path. This misses the PR’s target scenario.

Proposed fix
-					if (line.startsWith("ESP_IDF_VERSION=") && line.split("=").length >= 2) //$NON-NLS-1$ //$NON-NLS-2$
+					if (line.startsWith("ESP_IDF_VERSION=")) //$NON-NLS-1$
 					{
-						espIdfVersion = line.split("=")[1].trim(); //$NON-NLS-1$
+						String parsed = line.substring("ESP_IDF_VERSION=".length()).trim(); //$NON-NLS-1$
+						if (parsed.length() >= 2
+								&& ((parsed.startsWith("\"") && parsed.endsWith("\"")) //$NON-NLS-1$ //$NON-NLS-2$
+										|| (parsed.startsWith("'") && parsed.endsWith("'")))) //$NON-NLS-1$ //$NON-NLS-2$
+						{
+							parsed = parsed.substring(1, parsed.length() - 1).trim();
+						}
+						espIdfVersion = parsed;
 						break;
 					}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java`
around lines 51 - 54, The current parsing sets espIdfVersion =
line.split("=")[1].trim() which leaves quoted-empty values like "" as non-empty;
update the parsing in ToolsUtility.java (the block that checks
line.startsWith("ESP_IDF_VERSION=") and assigns espIdfVersion) to strip
surrounding double quotes (if present) and treat the result as empty when it
becomes an empty string (e.g., remove leading/trailing '"' after trim or check
for a literal "\"\"" and set espIdfVersion to null/empty), so downstream UI
empty checks correctly trigger the “Detection Failed” path.

@AndriiFilippov
Copy link
Copy Markdown
Collaborator

@sigmaaa hi
Since we were able to reproduce this issue only on Linux ubuntu - I have tested only on linux.

LGTM 👍

@sigmaaa sigmaaa added this to the v4.2.0 milestone Mar 25, 2026
Copy link
Copy Markdown
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

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

LGTM.

@kolipakakondal kolipakakondal merged commit 6ac03d4 into master Mar 27, 2026
14 of 20 checks passed
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.

3 participants