Skip to content

feat: S14.06 flip the SD vtable to SolidSyslogSdElement#556

Merged
DavidCozens merged 2 commits into
mainfrom
feat/s14-06-sd-vtable-flip
Jun 6, 2026
Merged

feat: S14.06 flip the SD vtable to SolidSyslogSdElement#556
DavidCozens merged 2 commits into
mainfrom
feat/s14-06-sd-vtable-flip

Conversation

@DavidCozens

Copy link
Copy Markdown
Owner

Closes #546. Parent epic: #64.

What changes

Flips the SD extension point itself, the payoff of the S14.03–05 migrations.

  • struct SolidSyslogStructuredData.Format and the SolidSyslogStructuredData_Format
    dispatch wrapper now take a struct SolidSyslogSdElement* instead of a raw
    struct SolidSyslogFormatter*. A custom-SD author's Format can no longer reach a
    formatter — the footgun is closed at the vtable.
  • The SolidSyslogSdElement_FromFormatter wrap moves up into
    MessageFormatter_FormatStructuredData: one element is built per message and passed to
    each configured SD in the existing order (_Begin resets the per-SD state, so a single
    instance hosts [meta…][origin…] sequentially).
  • MetaSd / OriginSd / TimeQualitySd drop their now-redundant local wrap and emit straight
    onto the handed element (now including the public SolidSyslogSdElement.h rather than
    the private header); NullSd's no-op signature follows.

Output is byte-for-byte identical — existing tests stand. SD test doubles' Format
signatures are updated; the [spy]/[spy2] doubles now emit via _Begin/_End, and each
SD unit test's format() helper + SolidSyslogNullSdTest build the element from the
formatter via the private _FromFormatter.

Acceptance criteria

  • Every SD Format method receives a SolidSyslogSdElement*; none receives or wraps a
    formatter
  • Output unchanged byte-for-byte (existing tests stand; SD test doubles updated)
  • MessageFormatter emits each configured SD through one shared element per message, in
    the existing order
  • No public API exposes a formatter to an SD author

Out of scope

  • Header-field callbacks (still on the formatter until S14.07)
  • Moving SolidSyslogFormatter.h out of the public interface (S14.08)

Checks

Debug green (1459 tests); BddTargetTests 66/66. clang-format applied; cppcheck-MISRA exit 0
(suppression anchors moved: MetaSd 11.3 64→60, OriginSd 11.3 61→57, TimeQualitySd 11.3
58→54, MessageFormatter 11.8 ×5 +1 and 5.7 19→20; misra_renumber.py clean).

🤖 Generated with Claude Code

DavidCozens and others added 2 commits June 6, 2026 07:12
Change struct SolidSyslogStructuredData.Format (and the
SolidSyslogStructuredData_Format dispatch wrapper) from receiving a raw
struct SolidSyslogFormatter* to a struct SolidSyslogSdElement*. A custom-SD
author's Format can no longer reach a raw formatter — the footgun is closed at
the extension point itself.

Move the SolidSyslogSdElement_FromFormatter wrap up into the SD-emission loop
in SolidSyslogMessageFormatter: one element is built per message and passed to
each configured SD in the existing order. The three SDs (MetaSd, OriginSd,
TimeQualitySd) drop their now-redundant local wrap and emit straight onto the
handed element; NullSd's no-op signature follows. Output is byte-for-byte
identical (existing tests stand; SD test doubles' Format signatures updated, and
the [spy]/[spy2] doubles now emit via _Begin/_End).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@DavidCozens, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 54 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f41064f-c653-4cb2-80ce-e2bdf5d358f9

📥 Commits

Reviewing files that changed from the base of the PR and between 7f90002 and 455f012.

📒 Files selected for processing (15)
  • Core/Interface/SolidSyslogStructuredData.h
  • Core/Interface/SolidSyslogStructuredDataDefinition.h
  • Core/Source/SolidSyslogMessageFormatter.c
  • Core/Source/SolidSyslogMetaSd.c
  • Core/Source/SolidSyslogNullSd.c
  • Core/Source/SolidSyslogOriginSd.c
  • Core/Source/SolidSyslogStructuredData.c
  • Core/Source/SolidSyslogTimeQualitySd.c
  • DEVLOG.md
  • Tests/SolidSyslogMetaSdTest.cpp
  • Tests/SolidSyslogNullSdTest.cpp
  • Tests/SolidSyslogOriginSdTest.cpp
  • Tests/SolidSyslogTest.cpp
  • Tests/SolidSyslogTimeQualitySdTest.cpp
  • misra_suppressions.txt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/s14-06-sd-vtable-flip

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.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1496 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1847 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1430 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1430 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 16 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 14 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 16 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 48 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 88% successful (✔️ 45 passed, 🙈 6 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 44 passed, 🙈 7 skipped)
   🚦   bdd-freertos-qemu-lwip: 86% successful (✔️ 44 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1275 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1430 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 26f663d into main Jun 6, 2026
27 checks passed
@DavidCozens DavidCozens deleted the feat/s14-06-sd-vtable-flip branch June 6, 2026 07:20
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.

S14.06: Flip the SD vtable to SolidSyslogSdElement

1 participant