Skip to content

fix(hints): Handle merged hints.yml with the esp-idf v6.0#1419

Open
kolipakakondal wants to merge 4 commits intomasterfrom
IEP-1730
Open

fix(hints): Handle merged hints.yml with the esp-idf v6.0#1419
kolipakakondal wants to merge 4 commits intomasterfrom
IEP-1730

Conversation

@kolipakakondal
Copy link
Collaborator

@kolipakakondal kolipakakondal commented Mar 23, 2026

Description

Please include a summary of the change and which issue is fixed.

Fixes # (IEP-XXX)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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 error hint resolution to prioritize project-specific configurations located in each project's build directory, with automatic fallback to default hints when not present.
  • Tests

    • Added comprehensive test coverage for hints resolution logic, including multiple fallback scenarios and edge cases.

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 798cb286-fbf5-4418-ae95-81e59e90067b

📥 Commits

Reviewing files that changed from the base of the PR and between f2b4b9e and 478d828.

📒 Files selected for processing (1)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/HintsUtilTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/HintsUtilTest.java

📝 Walkthrough

Walkthrough

The PR refactors hints.yml file resolution to prioritize build-directory-relative files over legacy paths. It introduces HintsUtil.resolveHintsYmlFile() and IDFUtil.getActiveProjectBuildDirPath() utilities to support this preference, updating build configuration and UI components accordingly.

Changes

Cohort / File(s) Summary
Core Hints Resolution Utilities
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/HintsUtil.java
Added resolveHintsYmlFile(Path buildDirectory) method that prioritizes hints.yml from the build directory, then falls back to legacy getHintsYmlPath() location if not found.
Build Directory Path Utility
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java
Added getActiveProjectBuildDirPath() method to retrieve the active project's build directory as a Path; also updated getGitExecutablePathFromSystem() to use Path.ROOT instead of org.eclipse.core.runtime.Path.ROOT.
Build Configuration Integration
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java
Updated EspIdfErrorParser construction to resolve hints.yml relative to the current build directory via HintsUtil.resolveHintsYmlFile(buildDir) instead of using direct filesystem path.
UI View Components
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/BuildView.java, bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/HintsView.java
Updated UI components to resolve hints.yml using the new utilities; BuildView passes resolved File to createNoHintsYmlLabel(); HintsView loads hints from resolved build-directory-relative path.
Utility Tests
tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/HintsUtilTest.java
Added three JUnit tests covering resolveHintsYmlFile() behavior: preference for build-directory hints.yml, fallback to legacy location, and null buildDirectory handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • alirana01
  • sigmaaa

Poem

🐰 Whiskers twitching with delight,
Build dirs now guide hints alight,
No more lost paths through the night,
Fallback safety, all feels right! 🎯

🚥 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 'fix(hints): Handle merged hints.yml with the esp-idf v6.0' is specific and directly related to the changeset, which updates how hints.yml files are resolved and handled across multiple components to support ESP-IDF v6.0.

✏️ 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-1730

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

@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.

🧹 Nitpick comments (3)
.github/workflows/ci.yml (2)

108-108: Rename duplicate step names for clearer workflow logs.

Both codesign steps are named "Codesign Espressif-IDE", which makes it difficult to distinguish them in CI logs. Consider using distinct names.

Suggested fix
-    - name: Codesign Espressif-IDE
+    - name: Codesign Espressif-IDE app bundles
       uses: espressif/release-sign@master
       with:
         path: releng/com.espressif.idf.product/target/products/com.espressif.idf.product/macosx/cocoa
-    - name: Codesign Espressif-IDE
+    - name: Codesign Espressif-IDE DMGs
       uses: espressif/release-sign@master
       with:
         path: releng/ide-dmg-builder

Also applies to: 123-123

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 108, Two CI steps share the identical name
"Codesign Espressif-IDE", making logs ambiguous; update the step names to
unique, descriptive strings (e.g., "Codesign Espressif-IDE (macOS)" and
"Codesign Espressif-IDE (Windows)" or include the target artifact) by locating
both steps with the name "Codesign Espressif-IDE" in the workflow and editing
their name fields so each step has a distinct, meaningful label.

109-109: Pin espressif/release-sign to a specific commit SHA instead of @master.

Using @master is risky for CI stability—changes to the action could unexpectedly fail builds. Since this action has no published releases, pin to a commit SHA for reproducibility and stability.

Example fix
-      uses: espressif/release-sign@master
+      uses: espressif/release-sign@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 109, Replace the unstable uses reference
"espressif/release-sign@master" with a pinned commit SHA to ensure CI
reproducibility; locate a specific commit SHA from the espressif/release-sign
repository and update the uses entry to "espressif/release-sign@<commit-sha>"
(or a published tag if available), committing that change so the workflow
references the immutable commit instead of `@master`.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/BuildView.java (1)

68-71: Consider using isFile() instead of exists() for consistency.

The method HintsUtil.resolveHintsYmlFile() uses isFile() to check file existence internally. Using exists() here could return true even if hints.yml were a directory (unlikely but possible). Consider aligning with the internal check for consistency.

♻️ Suggested change
 		File hintsYml = HintsUtil.resolveHintsYmlFile(IDFUtil.getActiveProjectBuildDirPath());
-		if (!hintsYml.exists())
+		if (!hintsYml.isFile())
 		{
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/BuildView.java`
around lines 68 - 71, Replace the boolean check on the resolved hintsYml File to
use isFile() instead of exists() for consistency with
HintsUtil.resolveHintsYmlFile(); locate the check in BuildView.java where
hintsYml (from
HintsUtil.resolveHintsYmlFile(IDFUtil.getActiveProjectBuildDirPath())) is tested
and change the conditional that calls createNoHintsYmlLabel(hintsYml) so it uses
hintsYml.isFile() (ensuring directories aren't treated as files).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 108: Two CI steps share the identical name "Codesign Espressif-IDE",
making logs ambiguous; update the step names to unique, descriptive strings
(e.g., "Codesign Espressif-IDE (macOS)" and "Codesign Espressif-IDE (Windows)"
or include the target artifact) by locating both steps with the name "Codesign
Espressif-IDE" in the workflow and editing their name fields so each step has a
distinct, meaningful label.
- Line 109: Replace the unstable uses reference "espressif/release-sign@master"
with a pinned commit SHA to ensure CI reproducibility; locate a specific commit
SHA from the espressif/release-sign repository and update the uses entry to
"espressif/release-sign@<commit-sha>" (or a published tag if available),
committing that change so the workflow references the immutable commit instead
of `@master`.

In
`@bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/BuildView.java`:
- Around line 68-71: Replace the boolean check on the resolved hintsYml File to
use isFile() instead of exists() for consistency with
HintsUtil.resolveHintsYmlFile(); locate the check in BuildView.java where
hintsYml (from
HintsUtil.resolveHintsYmlFile(IDFUtil.getActiveProjectBuildDirPath())) is tested
and change the conditional that calls createNoHintsYmlLabel(hintsYml) so it uses
hintsYml.isFile() (ensuring directories aren't treated as files).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43f67084-1c5c-4d5b-b036-6811c486d405

📥 Commits

Reviewing files that changed from the base of the PR and between 3a5a7c7 and f2b4b9e.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/HintsUtil.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/BuildView.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/HintsView.java
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/HintsUtilTest.java

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.

1 participant