Skip to content

refactor!: S23.22 name platform callbacks for what they supply - #739

Merged
DavidCozens merged 3 commits into
mainfrom
refactor/platform-callback-naming
Aug 10, 2026
Merged

refactor!: S23.22 name platform callbacks for what they supply#739
DavidCozens merged 3 commits into
mainfrom
refactor/platform-callback-naming

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Two things, both wanted before 0.1.0.

The Windows triage under S23.22 found the setup page naming two callbacks that
do not exist. Fixing the page raised the better question: _Get as a whole
function name passes the naming regex while saying nothing, because the noun has
already been spent on the class. Renaming is free now and costs a major version
later, so it happens here rather than after the beta.

The Windows page itself is then held to what the adapters actually do.

Part of #708.

Change Description

The rename. The platform's registry token becomes the class, and the
function names what it supplies — the same words as the SolidSyslogConfig
field it is assigned to:

Was Now
SolidSyslog<Plat>Clock_GetTimestamp SolidSyslog<Plat>_GetTimestamp
SolidSyslog<Plat>Hostname_Get SolidSyslog<Plat>_GetHostname
SolidSyslog<Plat>ProcessId_Get SolidSyslog<Plat>_GetProcessId
SolidSyslog<Plat>SysUpTime_Get SolidSyslog<Plat>_GetSysUpTime
SolidSyslog<Plat>Sleep SolidSyslog<Plat>_Sleep

Eleven public symbols across Posix, Windows and FreeRtos, which ships the
uptime alone. Decisions worth stating:

  • No compatibility alias. An old name fails to compile rather than working
    quietly, which is the behaviour a pre-1.0 rename should have.
  • Header file names are unchanged. SolidSyslogPosixHostname.h still holds
    SolidSyslogPosix_GetHostname, so the platform-token rule holds over every
    filename and the file is still findable by guessing. This is the one place the
    file name and the class name in it differ, and docs/NAMING.md now says so —
    the previous convention lived nowhere, which is how it drifted.

The Windows page. Two corrections and three additions, each read out of the
adapter rather than inferred:

  • the setup page named SolidSyslogWindowsHostname / SolidSyslogWindowsProcessId,
    neither of which is a symbol;
  • "forwarded unmodified" is not what happens — the host name is specifically the
    physical DNS host name;
  • WindowsFile_Write is _write and nothing else, so a record the store
    believes is stored is the operating system's rather than the disk's;
  • keepalive is 45 s idle then 4 × 10 s, and Windows has no user-timeout
    equivalent, so the write-in-flight case falls to the system's retransmission
    behaviour;
  • those keepalive options need Windows 10 1709, and the adapter does not check
    whether setsockopt took.

Checked and deliberately left alone: the Datagram adapter meets its contract with
no exception (OVERSIZE from WSAEMSGSIZE, MaxPayload from IP_MTU), so
#736 does not reach it; the connected UDP socket does not pin a stale peer,
because an endpoint version change closes it; and all-or-nothing Send is the
Stream contract's claim, not this platform's.

Test Evidence

No behaviour changes, so no tests were added. The existing suites are what prove
the rename:

Check Result
debug + junit (gcc image) 1495 tests, 1495 ran, 0 failed
SolidSyslogFreeRtosSysUpTimeTest (freertos-host image) 4 tests, 4 ran
clang-format --dry-run --Werror, whole tree clean
scripts/check_platform_docs.py 10 platforms, 12 roles, boundary clean
scripts/misra_renumber.py no renumbers proposed
markdownlint-cli2 v0.22.1, changed files 0 errors
docs build hooks 76 tests passed
mkdocs build --strict built

The MSVC sources compile nowhere locally. They were renamed by the same
sweep and reviewed by hand; build-windows-msvc and bdd-windows-otel are the
first real compile of them.

Areas Affected

Platform/Posix/, Platform/Windows/, Platform/FreeRtos/ public headers and
their sources; the tests and BDD targets that wire them; docs/NAMING.md and the
Posix and Windows platform pages.

Breaking for integrators, which is why it is milestoned into the beta. The
two example repos regenerate from the 0.1.0 tag and pick up the new names in
that pass; they are deliberately not patched here.

Summary by CodeRabbit

  • Changes

    • Standardised platform callback names across FreeRTOS, POSIX and Windows integrations for uptime, timestamps, hostnames, process IDs and sleep operations.
    • Existing behaviour and results remain unchanged.
  • Documentation

    • Added guidance for consistent callback naming.
    • Clarified Windows requirements, keepalive behaviour, connection-loss handling, file sharing, host identity and write durability.
  • Tests

    • Updated coverage to use the standardised callback names while preserving existing validation scenarios.

DavidCozens and others added 2 commits August 10, 2026 19:41
The platform token becomes the class and the function names what it fills,
matching the SolidSyslogConfig field it is assigned to. A bare _Get passes the
naming regex while carrying no meaning, and Sleep had no function part at all.

No compatibility alias: an old name fails to compile rather than working
quietly. The rule is written into docs/NAMING.md so it stops being implicit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Corrects the host-identity claim, and states the three things the page was
silent on: writes are not flushed, the keepalive window is 85 seconds, and
tuning it needs Windows 10 1709.

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

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change renames platform callback APIs to use consolidated naming. Target integrations, tests, and documentation now use the new names. Callback behaviour and signatures remain unchanged.

Changes

Platform callback naming

Layer / File(s) Summary
FreeRTOS uptime API rename
Platform/FreeRtos/..., Bdd/Targets/Common/..., Tests/FreeRtos/..., docs/...
Renames the FreeRTOS uptime API and updates its integration, tests, and documentation.
POSIX callback API renames
Platform/Posix/..., Tests/SolidSyslogPosix*, docs/platforms/posix/setup.md
Renames timestamp, hostname, process-ID, sleep, and uptime callbacks. Existing implementations and test expectations remain unchanged.
Windows callback API renames and documentation
Platform/Windows/..., Tests/SolidSyslogWindows*, docs/platforms/windows/...
Renames Windows callbacks and updates durability, keepalive, sharing, and host identity documentation.
Target integration and naming guidance
Bdd/Targets/..., docs/NAMING.md
Updates target configurations to use the renamed callbacks. Adds callback naming guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: renaming platform callbacks to match the values they supply.
Description check ✅ Passed The description includes all required sections and provides clear purpose, implementation details, test evidence, and affected areas.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/platform-callback-naming

Comment @coderabbitai help to get the list of available commands.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/platforms/posix/setup.md`:
- Around line 48-49: Update the callback names in the documentation example to
SolidSyslogPosix_GetHostname and SolidSyslogPosix_GetProcessId, alongside the
existing SolidSyslogPosix_GetTimestamp name. Preserve the surrounding guidance
and ensure all listed callbacks follow the required
SolidSyslog<RegistryToken>_<WhatItSupplies> naming form.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7b279669-a6dc-4e35-9240-1c4b7b817500

📥 Commits

Reviewing files that changed from the base of the PR and between a639196 and 70af7f0.

📒 Files selected for processing (42)
  • Bdd/Targets/Common/BddTargetFreeRtosPipeline.c
  • Bdd/Targets/Common/BddTargetTlsSender_OpenSsl_PosixTcp.c
  • Bdd/Targets/Common/BddTargetTlsSender_OpenSsl_WinsockTcp.c
  • Bdd/Targets/Linux/main.c
  • Bdd/Targets/Windows/BddTargetWindows.c
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h
  • Platform/FreeRtos/Source/SolidSyslogFreeRtosSysUpTime.c
  • Platform/Posix/Interface/SolidSyslogPosixClock.h
  • Platform/Posix/Interface/SolidSyslogPosixHostname.h
  • Platform/Posix/Interface/SolidSyslogPosixProcessId.h
  • Platform/Posix/Interface/SolidSyslogPosixSleep.h
  • Platform/Posix/Interface/SolidSyslogPosixSysUpTime.h
  • Platform/Posix/Source/SolidSyslogPosixClock.c
  • Platform/Posix/Source/SolidSyslogPosixHostname.c
  • Platform/Posix/Source/SolidSyslogPosixProcessId.c
  • Platform/Posix/Source/SolidSyslogPosixSleep.c
  • Platform/Posix/Source/SolidSyslogPosixSysUpTime.c
  • Platform/Windows/Interface/SolidSyslogWindowsClock.h
  • Platform/Windows/Interface/SolidSyslogWindowsFile.h
  • Platform/Windows/Interface/SolidSyslogWindowsHostname.h
  • Platform/Windows/Interface/SolidSyslogWindowsProcessId.h
  • Platform/Windows/Interface/SolidSyslogWindowsSleep.h
  • Platform/Windows/Interface/SolidSyslogWindowsSysUpTime.h
  • Platform/Windows/Source/SolidSyslogWindowsClock.c
  • Platform/Windows/Source/SolidSyslogWindowsHostname.c
  • Platform/Windows/Source/SolidSyslogWindowsProcessId.c
  • Platform/Windows/Source/SolidSyslogWindowsSleep.c
  • Platform/Windows/Source/SolidSyslogWindowsSysUpTime.c
  • Tests/FreeRtos/SolidSyslogFreeRtosSysUpTimeTest.cpp
  • Tests/SolidSyslogPosixClockTest.cpp
  • Tests/SolidSyslogPosixSleepTest.cpp
  • Tests/SolidSyslogPosixSysUpTimeTest.cpp
  • Tests/SolidSyslogWindowsClockTest.cpp
  • Tests/SolidSyslogWindowsHostnameTest.cpp
  • Tests/SolidSyslogWindowsProcessIdTest.cpp
  • Tests/SolidSyslogWindowsSleepTest.cpp
  • Tests/SolidSyslogWindowsSysUpTimeTest.cpp
  • docs/NAMING.md
  • docs/hardening-path.md
  • docs/platforms/posix/setup.md
  • docs/platforms/windows/index.md
  • docs/platforms/windows/setup.md

Comment thread docs/platforms/posix/setup.md Outdated
@DavidCozens DavidCozens added this to the 0.1.0 milestone Aug 10, 2026
The Posix page carried the same missing-suffix defect the Windows page did, and
the FreeRTOS page named the component where it means the function.

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

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/platforms/freertos/setup.md`:
- Line 53: Update the documentation for SolidSyslogFreeRtos_GetSysUpTime to
state that it returns uptime in hundredths of a second derived from the FreeRTOS
tick count, replacing the claim that it reports kernel ticks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28bf721b-2a21-434c-90b1-20379ce36e5c

📥 Commits

Reviewing files that changed from the base of the PR and between 70af7f0 and f48abed.

📒 Files selected for processing (2)
  • docs/platforms/freertos/setup.md
  • docs/platforms/posix/setup.md

Comment thread docs/platforms/freertos/setup.md
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   JUnit   build-linux-gcc (Whole Project): ✅ successful — 1529 passed
   JUnit   build-freertos-host-tdd-plustcp (Whole Project): ✅ successful — 1881 passed
   JUnit   build-linux-clang (Whole Project): ✅ successful — 1460 passed
   JUnit   sanitize-linux-gcc (Whole Project): ✅ successful — 1460 passed
   JUnit   integration-linux-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   integration-linux-mbedtls (Whole Project): ✅ successful — 14 passed
   JUnit   integration-windows-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   bdd-linux-syslog-ng (Whole Project): ✅ successful — 49 passed, 3 skipped
   JUnit   bdd-windows-otel (Whole Project): ✅ successful — 46 passed, 6 skipped
   JUnit   bdd-freertos-qemu-plustcp (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   bdd-freertos-qemu-lwip (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   build-windows-msvc (Whole Project): ✅ successful — 1302 passed
   JUnit   build-linux-tunable-override (Whole Project): ✅ successful — 1460 passed
   ⚠️   Clang-Tidy (Whole Project): No warnings
   ⚠️   CPPCheck (Whole Project): No warnings


Created by Quality Monitor v4.15.0 (#82d77af). More details are shown in the GitHub Checks Result.

@DavidCozens
DavidCozens merged commit cb351e5 into main Aug 10, 2026
37 checks passed
@DavidCozens
DavidCozens deleted the refactor/platform-callback-naming branch August 10, 2026 20:44
DavidCozens added a commit that referenced this pull request Aug 10, 2026
* docs: S23.22 hold the Posix page to what the adapters do

Adds the three things the page was silent on — writes are not fsynced, the
dead-peer window is 30 to 85 seconds, and the message queue is capped by
fs/mqueue rather than by the caller — and corrects the host-identity wording.

The link guidance said the build links rt for you. Nothing in the CMake tree
does; glibc 2.34 moved the message-queue functions into libc, so the promise
has never been tested by a container new enough to run CI.

Also carries the FreeRTOS uptime unit correction deferred from #739's review.

Part of #708.

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

* docs: say what the build actually does about rt

Core/Source/CMakeLists.txt links rt PUBLIC under SOLIDSYSLOG_POSIX, so a CMake
consumer inherits it. Only a direct consumer of the archive adds -lrt, and only
on glibc before 2.34.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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