Skip to content

feat(reflect_cpp): add reflect-cpp compile-time reflection component - #703

Merged
finger563 merged 2 commits into
mainfrom
feat/reflect-cpp-component
Aug 11, 2026
Merged

feat(reflect_cpp): add reflect-cpp compile-time reflection component#703
finger563 merged 2 commits into
mainfrom
feat/reflect-cpp-component

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Description

Adds a new reflect_cpp component vendoring getml/reflect-cpp v0.25.0 as a git submodule under detail/ (same pattern as serialization/alpaca). It exposes compile-time reflection over plain aggregate structs — field iteration in declaration order plus field names, no macros, no code generation.

Only the header-only reflection core is exposed (rfl/to_view.hpp and friends): the component is a pure INCLUDE_DIRS registration; reflect-cpp's compiled JSON backend (yyjson/CTRE) is never built.

This is the base of a stacked PR: the follow-up PR replaces the cdr component with a reflection-driven CDR/XCDR serialization library that uses this component as its backend.

Changes

  • components/reflect_cpp/ — component (CMakeLists, manifest, README) + detail/reflect-cpp submodule @ v0.25.0
  • doc/en/data/reflect_cpp.rst + index entry
  • .github/workflows/upload_components.yml — registry upload entry
  • suppressions.txt — exclude the vendored detail/ tree from cppcheck (matching lib/)

Notes

  • Requires C++20 (default on IDF 5.2+ toolchains); manifest declares idf: >=5.2
  • No example app (header-only dependency component); exercised by the cdr component's example and tests in the stacked PR

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new reflect_cpp component that vendors the header-only core of getml/reflect-cpp as a submodule to provide compile-time reflection utilities to other ESPP components, along with documentation and registry-upload wiring. However, it also removes the existing in-tree cdr implementation and introduces a cdr submodule without completing the migration, which leaves the repository in a build-breaking state.

Changes:

  • Add components/reflect_cpp as an include-only component exposing reflect-cpp headers via a vendored submodule.
  • Add Sphinx docs for reflect_cpp and link it into the data index.
  • Update submodules / registry upload list / cppcheck suppressions (but the cdr change set is incomplete and breaks builds).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
components/reflect_cpp/CMakeLists.txt Registers reflect-cpp headers as an include-only IDF component.
components/reflect_cpp/idf_component.yml Adds component metadata and IDF version requirement.
components/reflect_cpp/README.md Documents reflect_cpp usage and intent.
doc/en/data/reflect_cpp.rst Adds documentation page for the new component.
doc/en/data/index.rst Adds reflect_cpp to the data docs toctree.
suppressions.txt Suppresses cppcheck findings under the vendored reflect_cpp tree.
.github/workflows/upload_components.yml Adds components/reflect_cpp to the upload list.
.gitmodules Adds reflect-cpp submodule (and also adds a cdr submodule).
components/cdr/include/cdr.hpp Deletes the in-tree public CDR API header (breaking change).
components/cdr/src/cdr.cpp Deletes the in-tree CDR source stub (migration incomplete).
Suppressed comments (1)

suppressions.txt:13

  • Since this PR adds a new vendored submodule at components/cdr/detail/cdr (see .gitmodules), cppcheck will likely start scanning third-party code there unless it’s also suppressed (similar to lib/* and components/reflect_cpp/detail/*). Consider adding a suppression for the new components/cdr/detail/* tree as well to keep static analysis focused on project code.
*:lib/*
*:components/reflect_cpp/detail/*


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .gitmodules Outdated
Comment thread doc/en/data/reflect_cpp.rst Outdated
Comment thread components/reflect_cpp/README.md Outdated
finger563 and others added 2 commits August 11, 2026 12:44
Vendors getml/reflect-cpp v0.25.0 as a detail/ submodule (alpaca-style).
Header-only: only the reflection core (rfl::to_view, field names) is
exposed; the compiled JSON backend is never built. Backing component for
the new reflection-driven cdr component.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…usion

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@finger563
finger563 force-pushed the feat/reflect-cpp-component branch from eac587a to bbd826b Compare August 11, 2026 17:48
@finger563

Copy link
Copy Markdown
Contributor Author

Rewrote the stack to fix a staging error the review caught: the cdr submodule + old cdr header/source deletions had leaked into this base PR, which is what broke the wheel/library builds and the cdr/rtps/p4 example builds here. This PR is now purely additive (verified: no deleted or modified files vs main other than list-entry additions), so those jobs should go green on this run.

Two failures from the previous run were unrelated CI infra flakes — e.g. build (components/bmi270/example, esp32p4) failed at the Checkout repo step (submodule fetch), not compilation.

Also softened the reflect_cpp doc/README wording so nothing merged here references behavior that only lands with the stacked #704.

@finger563
finger563 merged commit 39f668d into main Aug 11, 2026
265 of 266 checks passed
@finger563
finger563 deleted the feat/reflect-cpp-component branch August 11, 2026 19:15
@finger563
finger563 restored the feat/reflect-cpp-component branch August 11, 2026 19:16
@finger563
finger563 deleted the feat/reflect-cpp-component branch August 11, 2026 19:16
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