feat(reflect_cpp): add reflect-cpp compile-time reflection component - #703
Conversation
|
✅Static analysis result - no issues found! ✅ |
There was a problem hiding this comment.
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_cppas an include-only component exposingreflect-cppheaders via a vendored submodule. - Add Sphinx docs for
reflect_cppand link it into the data index. - Update submodules / registry upload list / cppcheck suppressions (but the
cdrchange 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 tolib/*andcomponents/reflect_cpp/detail/*). Consider adding a suppression for the newcomponents/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.
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>
eac587a to
bbd826b
Compare
|
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. Also softened the reflect_cpp doc/README wording so nothing merged here references behavior that only lands with the stacked #704. |
Description
Adds a new
reflect_cppcomponent vendoring getml/reflect-cppv0.25.0as a git submodule underdetail/(same pattern asserialization/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.hppand friends): the component is a pureINCLUDE_DIRSregistration; 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
cdrcomponent 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-cppsubmodule @ v0.25.0doc/en/data/reflect_cpp.rst+ index entry.github/workflows/upload_components.yml— registry upload entrysuppressions.txt— exclude the vendoreddetail/tree from cppcheck (matchinglib/)Notes
idf: >=5.2cdrcomponent's example and tests in the stacked PR🤖 Generated with Claude Code