Skip to content

ci: S23.22 assert every platform class carries its registry token - #729

Merged
DavidCozens merged 2 commits into
mainfrom
ci/platform-class-prefix-check
Aug 10, 2026
Merged

ci: S23.22 assert every platform class carries its registry token#729
DavidCozens merged 2 commits into
mainfrom
ci/platform-class-prefix-check

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

docs/NAMING.md states that every public class in Platform/<Token>/Interface/ is
named SolidSyslog<RegistryToken><Thing>, and nothing asserted it. That is how the
naming drifted far enough to need the rename in #721 — the rule existed, but only
review was holding it.

The check was handed to the #711 branch by that rename PR and was crowded out by the
review rounds. This closes it.

Part of #708

Change Description

scripts/check_platform_docs.py gains a third boundary alongside the two it already
holds. Every header in a registered platform's Interface/ directory must begin
SolidSyslog<Token>.

Two decisions worth stating:

  • A separate CLASS_PREFIXES map, not the existing ALIASES map. The handover
    proposed reusing ALIASES so SolidSyslogWinsock* passes. It would work, but
    ALIASES is prose vocabulary — it carries "Posix": ["POSIX"] and
    "MbedTls": ["Mbed TLS", "mbedTLS", "mbedtls"], so reusing it would make
    SolidSyslogPOSIXFile.h a legal declaration, which is the spelling NAMING.md
    exists to prevent. A separate map keeps the second-upstream allowance a deliberate
    edit. Winsock is its only entry; Win32 is in ALIASES for prose but no class
    uses it, so it is not granted here.
  • *Errors.h headers are checked too, where the handover scoped the rule to
    non-*Errors.h ones. An errors header takes its name from its class and so carries
    the token by construction, which makes including it free — and it catches one that
    outlives or never had a parent.

NAMING.md gains the third gate in the list that maps each rule to the tool holding
it; that list claimed a clean split between two tools and would otherwise now be
incomplete. The rule itself is unchanged and stays where it was.

Also extracts interface_headers(), since the new check and vocabulary() were
listing the same directory two ways.

Test Evidence

Every platform conforms today, so the check passes on a clean tree — which proves
nothing on its own. It was verified by injecting each fault in turn and restoring:

Injected Result
Platform/Posix/Interface/SolidSyslogGetAddrInfoResolver.h — a class named for the upstream call rejected, exit 1
Platform/Posix/Interface/SolidSyslogPOSIXFile.h — a prose alias used as an identifier prefix rejected
CLASS_PREFIXES emptied 8 faults, one per SolidSyslogWinsock* header — the allowance is load-bearing, not decorative

Gates run locally: check_platform_docs.py (10 platforms, 12 roles), 76 hook tests in
the pinned image, mkdocs build --strict, markdownlint over all 62 files. No C
changed, so no build or MISRA renumbering was needed.

Areas Affected

scripts/check_platform_docs.py, the docs-build CI lane comment, and one bullet in
docs/NAMING.md. No production code, no build files. Adding a platform now requires
its classes to carry its token, which every platform already does.

Summary by CodeRabbit

  • Documentation

    • Clarified that platform documentation checks verify registry tokens and approved class-prefix conventions.
    • Identified the consistency-check script as the authoritative validation source.
  • Chores

    • Enhanced automated checks to validate platform class prefixes and report non-compliant headers.
    • Added support for approved upstream naming exceptions and clearer success reporting.
    • Updated continuous integration checks to include registry-token validation for platform classes.

docs/NAMING.md states the rule and nothing checked it, which is how the
naming drifted far enough to need the rename in #721.

Kept apart from the ALIASES map: that one is prose vocabulary, so reusing
it would make SolidSyslogPOSIXFile a legal declaration.

Part of #708
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7164adb9-73c9-4eb0-9667-5639e9ae1b07

📥 Commits

Reviewing files that changed from the base of the PR and between e25457d and f45c4de.

📒 Files selected for processing (1)
  • scripts/check_platform_docs.py

Walkthrough

The platform documentation checker now validates that platform interface classes use SolidSyslog<Token> prefixes or approved upstream prefixes such as Winsock. The naming documentation and CI workflow describe this check.

Changes

Platform class-prefix validation

Layer / File(s) Summary
Implement class-prefix validation
scripts/check_platform_docs.py
The checker accepts configured alternate prefixes, reads platform interface headers, reports invalid prefixes, and includes the faults in check().
Document the enforcement boundary
docs/NAMING.md, .github/workflows/ci.yml
The documentation and CI description include registry-token class-prefix validation.

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 uses Conventional Commits format and clearly summarises enforcement of platform class registry-token naming.
Description check ✅ Passed The description covers purpose, implementation, testing, and affected areas with specific evidence aligned to the template.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/platform-class-prefix-check

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: 2

🤖 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 `@scripts/check_platform_docs.py`:
- Around line 263-280: Align all validator descriptions with the accepted-prefix
contract: in scripts/check_platform_docs.py lines 263-280, update prefix_faults
diagnostics to mention the registry token or an approved alternate prefix;
update the module contract at lines 28-31 and the class report at lines 349-355
to describe accepted prefixes. Update .github/workflows/ci.yml lines 780-782 to
document the same rule.
- Line 272: Update the accepted list construction in the relevant platform-docs
checking logic to use iterable unpacking: preserve token as the first element
and expand CLASS_PREFIXES.get(token, []) directly in the list, without changing
the resulting values.
🪄 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: a785acc9-f072-412f-933c-eb8cfca2c640

📥 Commits

Reviewing files that changed from the base of the PR and between ac79c1d and e25457d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • docs/NAMING.md
  • scripts/check_platform_docs.py

Comment thread scripts/check_platform_docs.py
Comment thread scripts/check_platform_docs.py Outdated
The prefix_faults docstring stated the token-only rule in the one place
that accepts a second-upstream prefix. Iterable unpacking for both alias
lists, so the file spells the idiom one way (Ruff RUF005).

Part of #708
@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 6669b06 into main Aug 10, 2026
37 checks passed
@DavidCozens
DavidCozens deleted the ci/platform-class-prefix-check branch August 10, 2026 06: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.

1 participant