From 7807192ecbbf1f1432420af702ebedebd5bd1a4e Mon Sep 17 00:00:00 2001 From: Sebastian Dine Date: Sat, 9 May 2026 15:11:08 +0200 Subject: [PATCH] fix: Feature/sonarqube3 (#6) * patch: code coverage * fix: ci fix * fix: ci fix --------- Co-authored-by: sdine --- .github/workflows/AGENTS.md | 1 + .github/workflows/feature-ci.yml | 1 + .github/workflows/master-ci.yml | 1 + AGENTS.md | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/AGENTS.md b/.github/workflows/AGENTS.md index 2375bbd..6da7e05 100644 --- a/.github/workflows/AGENTS.md +++ b/.github/workflows/AGENTS.md @@ -37,6 +37,7 @@ GitHub Actions workflows for CI, release automation, and policy checks. - Prefer minimal, surgical edits; avoid large workflow rewrites unless requested. - Reusable workflows should declare explicit `workflow_call` inputs for required context (e.g., version, merge SHA). +- Sonar coverage steps that use `gcovr` must exclude third-party build trees at discovery time with `--exclude-directories` (for example `build/_deps`) so gcov does not process dependency `.gcda` files. - Keep `permissions` least-privilege: - reusable build workflows: `contents: read` - release/tag orchestrator: `contents: write` diff --git a/.github/workflows/feature-ci.yml b/.github/workflows/feature-ci.yml index c19b211..1ee20eb 100644 --- a/.github/workflows/feature-ci.yml +++ b/.github/workflows/feature-ci.yml @@ -52,6 +52,7 @@ jobs: gcovr -r . --sonarqube build/sonarqube-coverage.xml --exclude "build/_deps/" + --exclude-directories "build/_deps" - name: SonarQube Cloud scan uses: SonarSource/sonarqube-scan-action@v5 diff --git a/.github/workflows/master-ci.yml b/.github/workflows/master-ci.yml index 957a1f3..551752a 100644 --- a/.github/workflows/master-ci.yml +++ b/.github/workflows/master-ci.yml @@ -52,6 +52,7 @@ jobs: gcovr -r . --sonarqube build/sonarqube-coverage.xml --exclude "build/_deps/" + --exclude-directories "build/_deps" - name: SonarQube Cloud scan uses: SonarSource/sonarqube-scan-action@v5 diff --git a/AGENTS.md b/AGENTS.md index af5c0e5..ae51c50 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,6 +90,7 @@ Run from the **workspace root**. - After modifying a domain type's fields or JSON layout you **must** update the matching round-trip test in `tests/domain_json_tests.cpp` and re-run tests. - After adding a new `.cpp` to `core/` or `ui_wx/` you **must** add it to that package's `CMakeLists.txt`. There is no glob. - After adding a new dependency you **must** verify its license is compatible with this repository's MIT license before merging. +- After changing SonarQube coverage generation, keep dependency build outputs excluded at gcov discovery time (for example `gcovr --exclude-directories "build/_deps"`); output-only excludes are not enough for third-party `.gcda` files. - After adding a new game module you **must**: (1) extend `Game` enum + string mappings in `core/include/ccm/domain/Enums.hpp`, (2) register the module in `app/main.cpp`, (3) add a directory mapping in `app/main.cpp::dirNameForGame`, (4) implement an `IGameView` derived class (or `GameView`) and add it to `AppContext::gameViews` in the composition root. - After changing the per-game seams (`IGameModule`, `IGameView`, the `BaseCard*Panel` template hooks) you **must** update `docs/adding-a-new-game.md` so the canonical "add a new game" walkthrough stays in sync with the code. - After changing `formatTextForFs` or `parseIndexFromFilename` you **must** update `tests/fs_names_tests.cpp` — these functions exist to stay byte-compatible with the original Rust `util/fs.rs`.