Skip to content

feat(ci): bench-source CI guard — hard-fail on orphaned bench_*.cpp (Maßnahme #8) - #4600

Merged
makr-code merged 2 commits into
developfrom
copilot/implement-ci-guard-bench-source
Apr 13, 2026
Merged

makr-code merged 2 commits into
developfrom
copilot/implement-ci-guard-bench-source

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

81 bench_*.cpp files in benchmarks/ had no explicit add_executable() entry — silently swallowed by the THEMIS_AUTO_REGISTER_ELIGIBLE_BENCHMARKS fallback with zero CI enforcement. This adds a hard CI gate preventing new orphaned bench sources from slipping through.

Description

tools/check_bench_targets.py — standalone guard

  • Compares bench_*.cpp glob against CMake explicit targets + auto-registration presence
  • Coverage rule: explicit add_executable(<stem>) OR THEMIS_AUTO_REGISTER_ELIGIBLE_BENCHMARKS block present → covered; otherwise → orphaned
  • --strict: requires explicit target per file (exposes the 81 auto-reg-only files)
  • --format json for machine consumption; --no-color, --quiet for CI/pre-commit use
  • Exit 0 = all covered, exit 1 = orphaned sources found
$ python3 tools/check_bench_targets.py --no-color
✅ PASS  All bench_*.cpp sources are covered.  (81 via auto-registration, 0 orphaned)

$ python3 tools/check_bench_targets.py --no-color --strict -q
❌ FAIL  81 orphaned bench_*.cpp source(s) detected.

tools/perf_expectations_audit.py — audit orchestrator (§1.4)

  • Check 8a STATUS_FAIL: orphaned_sources == [] → PASS (81 auto-registered, 0 truly orphaned)
  • Check 8b STATUS_FAIL: tools/check_bench_targets.py exists → PASS
  • Text + JSON output; exit 1 on any STATUS_FAIL

.github/workflows/05-quality_build_bench-source-guard-ci.yml

  • Triggers on PR/push (bench_*.cpp, CMakeLists.txt, guard tools), plus nightly
  • Runs standalone guard then full audit; hard-fails on any orphaned source
  • Uploads JSON audit artifact (14-day retention)

Linked Issues

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Refactoring (non-breaking)
  • Documentation
  • Breaking change (requires MAJOR version bump — see VERSIONING.md)
  • Security fix
  • Other:

Breaking Change Checklist

  • MAJOR version bump planned in VERSION and CMakeLists.txt
  • Migration guide added in docs/migration/
  • Announcement prepared for GitHub Discussions (≥ 2 weeks before release)
  • CHANGELOG ### Removed / ### Changed section updated

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if performance-sensitive change)

Verified locally:

  • check_bench_targets.py → exit 0 on current repo (auto-reg present)
  • check_bench_targets.py against a synthetic CMakeLists.txt without auto-reg and one unregistered file → exit 1 with correct diagnostic
  • perf_expectations_audit.py → Check 8a PASS, Check 8b PASS, exit 0
  • perf_expectations_audit.py --format json → "pass": true, orphaned_sources: []
  • CodeQL scan: 0 alerts

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

- Add tools/check_bench_targets.py: standalone guard that detects bench_*.cpp
  files without CMake target coverage. A source is covered by either an explicit
  add_executable() entry or the THEMIS_AUTO_REGISTER_ELIGIBLE_BENCHMARKS block.
  Supports --strict mode (requires explicit targets), --format json, --no-color.

- Add tools/perf_expectations_audit.py: audit orchestrator with STATUS_FAIL checks:
  * Check 8a: orphaned_sources == [] (PASS: 81 auto-registered, 0 orphaned)
  * Check 8b: tools/check_bench_targets.py exists (PASS)

- Add .github/workflows/05-quality_build_bench-source-guard-ci.yml: CI workflow
  that runs both tools on PR/push/schedule. Fails hard on new orphaned sources.

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/6b5afc19-3345-4f0c-bb3f-a8f172edbe9a

Co-authored-by: makr-code <[email protected]>
@makr-code
makr-code marked this pull request as ready for review April 13, 2026 07:50
@makr-code
makr-code self-requested a review as a code owner April 13, 2026 07:50
@makr-code
makr-code merged commit acbec39 into develop Apr 13, 2026
12 of 22 checks passed
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.

2 participants