Skip to content

fix(esp32): add OTA path component dependencies (app_update, mdns) - #2592

Merged
zackees merged 4 commits into
FastLED:masterfrom
swoboda1337:fix-esp32-ota-requires
May 30, 2026
Merged

zackees merged 4 commits into
FastLED:masterfrom
swoboda1337:fix-esp32-ota-requires

Conversation

@swoboda1337

@swoboda1337 swoboda1337 commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

The ESP32 OTA implementation (ota_impl.cpp.hpp, gated by FL_ESP_OTA_SUPPORTED) includes esp_ota_ops.h and mdns.h, but the component's requirements didn't declare the components that provide them. As a result, building FastLED as a managed ESP-IDF component on ESP-IDF 5 fails at configure time:

fatal error: esp_ota_ops.h: No such file or directory

Changes

  • app_update added to idf_component_register(REQUIRES ...) — built-in IDF component that provides esp_ota_ops.h. Available on all targets, so it can be required unconditionally (the OTA code itself stays gated).
  • espressif/mdns added to idf_component.yml as a conditional dependency (idf_version < 6.0.0 && target not in [esp32h2, esp32p4]) — provides mdns.h. Declared in the manifest (not REQUIRES) so it is only pulled, and only required, where the OTA path actually compiles; this avoids breaking targets like ESP32-P4 where mdns isn't applicable.

Summary by CodeRabbit

  • Chores
    • Updated build configuration to include additional system components
    • Added conditional dependency management for enhanced compatibility with specific platform versions and hardware targets

Review Change Stack

The ESP32 OTA path (FL_ESP_OTA_SUPPORTED, gated to IDF 4/5) includes
esp_ota_ops.h and mdns.h, but the component REQUIRES omitted app_update
and mdns. Consumers building on IDF 5 (e.g. ESPHome on arduino-esp32)
fail with 'esp_ota_ops.h: No such file or directory'. IDF 6 disables the
OTA path, so it wasn't caught by the standalone-component CI.
The ESP32 OTA path includes mdns.h and now REQUIRES mdns, but mdns wasn't
declared as a managed-component dependency, so a standalone ESP-IDF
component build couldn't resolve it. Gate to IDF < 6 and WiFi targets
to match FL_ESP_OTA_SUPPORTED (excludes ESP32-H2 / ESP32-P4).
mdns is declared as a conditional managed dependency in idf_component.yml
(idf_version < 6.0.0, non-H2/P4), which already adds it to REQUIRES when
the rule matches. Listing it unconditionally in idf_component_register
broke targets where it isn't pulled (e.g. ESP32-P4): 'Failed to resolve
component mdns'. app_update stays (built-in, available on all targets).
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5be73928-3b6e-46dc-9a10-3f4030e93880

📥 Commits

Reviewing files that changed from the base of the PR and between 8d09b29 and 05ad62b.

📒 Files selected for processing (2)
  • CMakeLists.txt
  • idf_component.yml

📝 Walkthrough

Walkthrough

The FastLED component's build configuration is updated to add two dependencies: app_update is added to the CMakeLists.txt component REQUIRES list, and espressif/mdns (version ^1.2.0) is added to idf_component.yml with conditional rules for ESP-IDF versions below 6.0.0 excluding esp32h2 and esp32p4 targets.

Changes

ESP-IDF Component Dependencies

Layer / File(s) Summary
Add mDNS and app_update dependencies
CMakeLists.txt, idf_component.yml
CMakeLists.txt adds app_update to the internal REQUIRES dependency list. idf_component.yml adds external espressif/mdns dependency with semver constraint and conditional rules based on IDF version and ESP target.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly Related PRs

  • FastLED/FastLED#2511: Both PRs modify the ESP-IDF CMakeLists.txt component metadata by updating the idf_component_register(...) REQUIRES dependency list at the build-system level.

Poem

🐰 A rabbit hops through dependency trees,
Where mdns and app_update dance with ease,
Conditional rules keep targets in line,
Versioned constraints make everything shine!
ESP-IDF components align. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding OTA path component dependencies (app_update and mdns) to resolve missing header files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@swoboda1337

swoboda1337 commented May 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry forgot to test IDF 5 last time, should have caught this earlier. I verified both IDF 5 & 6 build now as a component. It worked on IDF 6 because OTA is disabled because of mdedtls.

@zackees
zackees merged commit d44c800 into FastLED:master May 30, 2026
6 of 8 checks passed
zackees added a commit that referenced this pull request May 30, 2026
`claude.yml` triggers on @claude mentions in issue comments, PR review
comments, PR reviews, and issue bodies — then checks out the source PR's
HEAD (from a fork, when applicable) and runs anthropics/claude-code-action
with elevated permissions:

  contents: write       (can push to master)
  pull-requests: write  (can merge PRs)
  issues: write
  id-token: write
  + ANTHROPIC_API_KEY secret + GITHUB_TOKEN

Without an author_association guard, any external contributor could:
  1. Open a PR from their fork containing malicious code.
  2. Comment `@claude please fix this`.
  3. The workflow checks out their fork's HEAD with all the above
     privileges, and either:
       a. PR code runs during the action's tool execution and pushes
          unauthorized commits to master, auto-merges PRs, or
          exfiltrates the ANTHROPIC_API_KEY / GITHUB_TOKEN, OR
       b. The attacker convinces Claude (via prompt injection in code
          comments / PR description) to do the same.

The fix gates each trigger branch with a check against the source event's
`author_association`, which GitHub computes server-side based on the actor's
relationship to the repo:

  Trusted (allowed):  OWNER, MEMBER, COLLABORATOR
  Untrusted (blocked): CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, FIRST_TIMER, NONE

External PR authors will fall into one of the untrusted categories, so the
job step that follows (which checks out their fork's HEAD) never runs.

No functional change for repo maintainers — when an OWNER/MEMBER/
COLLABORATOR mentions @claude, the workflow runs exactly as before.

Observed during the audit of PR #2592 (a third-party PR from
swoboda1337). That PR did NOT exercise this path (no @claude mention)
and was otherwise safe — `project_automation.yml` is the only other
workflow using `pull_request_target` and it correctly does not check
out PR code, so PR #2592 itself caused no leakage. But the latent
exploit in `claude.yml` would have applied to any future PR that did
contain an `@claude` mention from an external actor.

Co-authored-by: Claude Opus 4.7 <[email protected]>
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.

2 participants