Skip to content

feat: S13.5 promote prival and message_fields to Windows runner#158

Merged
DavidCozens merged 1 commit into
mainfrom
feat/promote-batch-b
Apr 18, 2026
Merged

feat: S13.5 promote prival and message_fields to Windows runner#158
DavidCozens merged 1 commit into
mainfrom
feat/promote-batch-b

Conversation

@DavidCozens

Copy link
Copy Markdown
Owner

Summary

The Windows example now accepts `--facility` / `--severity` / `--msgid` / `--message`, and the OTel parser reads OTel's `message` / `msg_id` attributes — enough to promote two more features out of `@windows_wip`.

Discipline note: my first attempt put the CLI parser inline in `SolidSyslogWindowsExample.c` with no unit tests — caught in review against the POSIX `ExampleCommandLine` precedent which has `ExampleCommandLineTest.cpp` covering every flag. This commit extracts the parser into its own TU and adds the matching unit-test file.

What's new

  • `Example/Windows/ExampleWindowsCommandLine.{h,c}` — minimal four-flag parser (`--facility N`, `--severity N`, `--msgid X`, `--message X`), unknown flags and missing values silently ignored. Defaults match the SingleTask example.
  • `Tests/Example/ExampleWindowsCommandLineTest.cpp` — 11 CppUTest cases: each default, each flag, all-together, unknown-flag, missing-value.
  • `parse_otel_jsonl_line` extended: maps OTel's `message` → `MSG`, `msg_id` → `MSGID`. Confirmed by the parsing experiment in #156's discussion — OTel populates these attributes as part of its independent RFC 5424 parse, just like syslog-ng.
  • Removed `@windows_wip` from `prival.feature` and `message_fields.feature`.

Test infra changes

`Tests/CMakeLists.txt` previously gated `Tests/Example/` on `SOLIDSYSLOG_POSIX` only — meaning `ExampleTests.exe` didn't build on the windows-build-and-test job at all. Now gates on `SOLIDSYSLOG_POSIX OR (SOLIDSYSLOG_WINSOCK AND HAVE_WINDOWS_PLATFORM)`, and `Tests/Example/CMakeLists.txt` conditionally pulls in the right test files and production sources per platform. `ExampleAppNameTest` is now part of the test suite on both platforms; the existing POSIX-only tests remain POSIX-only.

Local verification

Gate Result
ExampleWindowsCommandLine unit tests on MSVC ✅ 11 / 11
ExampleTests on Linux gcc ✅ 41 / 41 (unchanged)
BDD on Windows via otelcol ✅ 5 features / 14 scenarios / 52 steps (up from 3 / 5 / 19)
BDD on Linux via docker-compose ✅ 14 features / 31 scenarios / 160 steps (no regressions)
tidy, cppcheck, sanitize, format ✅ all green

Remaining @windows_wip features

After this PR: `structured_data`, `origin`, `time_quality`. All three need OTel's nested SD kvlist re-rendered into `[name key="value"]` text form so the existing regex `Then` steps work unchanged. Single follow-up PR (Batch C).

Refs #129

Test plan

  • All CI checks pass: build-and-test, clang-build-and-test, sanitize, coverage, tidy, cppcheck, format, bdd, windows-build-and-test, bdd-windows
  • `bdd-windows` reports 5 scenarios passed (up from 3)
  • `windows-build-and-test` Test Results show `ExampleWindowsCommandLine` group with 11 cases

🤖 Generated with Claude Code

The Windows example now accepts --facility/--severity/--msgid/--message
via a tiny argv parser. Extracted to its own translation unit
(Example/Windows/ExampleWindowsCommandLine.c) so it has a unit-testable
surface — TDD discipline mirroring the POSIX ExampleCommandLine.c +
ExampleCommandLineTest.cpp pattern. Inline-in-main was a discipline
miss caught in review.

Tests/CMakeLists.txt now adds Tests/Example/ when either POSIX or
(WINSOCK + Windows platform) is configured. Tests/Example/CMakeLists.txt
conditionally pulls in the right test files and production sources per
platform: ExampleAppNameTest always, the existing four POSIX tests when
SOLIDSYSLOG_POSIX, and the new ExampleWindowsCommandLineTest when
SOLIDSYSLOG_WINSOCK and HAVE_WINDOWS_PLATFORM. The ExampleTests target
now builds and runs on the windows-build-and-test job too.

parse_otel_jsonl_line now reads OTel's `message` and `msg_id` attributes
(confirmed via the parser experiment in #156's discussion: OTel's RFC
5424 receiver is an independent oracle in the same role syslog-ng
plays on Linux).

Verified locally:
- ExampleWindowsCommandLine unit tests on MSVC: 11 / 11 green
- All ExampleTests on Linux gcc: 41 / 41 green
- BDD on Windows via otelcol oracle: 5 features / 14 scenarios / 52 steps
- BDD on Linux via docker-compose: 14 features / 31 scenarios / 160 steps
  unchanged
- tidy, cppcheck, sanitize, format: all green

Refs #129 (follow-up promotion work)

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

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@DavidCozens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 22 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 40 minutes and 22 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 860a37be-0dcb-4737-9bb8-225482e8b7ec

📥 Commits

Reviewing files that changed from the base of the PR and between 2be0958 and acd7c12.

📒 Files selected for processing (10)
  • Bdd/features/message_fields.feature
  • Bdd/features/prival.feature
  • Bdd/features/steps/syslog_steps.py
  • Example/CMakeLists.txt
  • Example/Windows/ExampleWindowsCommandLine.c
  • Example/Windows/ExampleWindowsCommandLine.h
  • Example/Windows/SolidSyslogWindowsExample.c
  • Tests/CMakeLists.txt
  • Tests/Example/CMakeLists.txt
  • Tests/Example/ExampleWindowsCommandLineTest.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/promote-batch-b

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

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   Unit Tests (GCC): 99% successful (✔️ 539 passed, 🙈 3 skipped)
   🚦   Unit Tests (Clang): 99% successful (✔️ 498 passed, 🙈 3 skipped)
   🚦   Unit Tests (Sanitize): 99% successful (✔️ 498 passed, 🙈 3 skipped)
   🚦   BDD Tests (Linux): 100% successful (✔️ 31 passed)
   🚦   BDD Tests (Windows): 45% successful (✔️ 14 passed, 🙈 17 skipped)
   🚦   Unit Tests (MSVC): 100% successful (✔️ 405 passed, 🙈 1 skipped)
   ⚠️   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 4a3e6a3 into main Apr 18, 2026
13 checks passed
@DavidCozens DavidCozens deleted the feat/promote-batch-b branch April 18, 2026 21:05
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