Skip to content

Restore SonarCloud#147

Merged
utilForever merged 10 commits into
mainfrom
sonarcloud
Jul 12, 2026
Merged

Restore SonarCloud#147
utilForever merged 10 commits into
mainfrom
sonarcloud

Conversation

@utilForever

@utilForever utilForever commented Jul 11, 2026

Copy link
Copy Markdown
Owner

This revision includes:

  • Restore SonarCloud (Closes Restore SonarCloud #141)
    • Configure SonarCloud automatic analysis
    • Use safe Bash conditionals for CUDA setup
    • Make logger buffer mutation explicit
    • Replace async task dispatch with explicit execution
    • Make Vector3 trivially copyable
    • Validate serialized array data
    • Restrict manual test output permissions

Summary by CodeRabbit

  • Bug Fixes
    • Strengthened FlatBuffer serialization/deserialization validation for empty, malformed, truncated, and size-mismatched payloads, throwing std::invalid_argument on bad inputs and safely clearing/handling outputs.
    • Preserved destination data when deserialization fails.
    • Improved CUDA environment/toolchain validation in the installer script.
    • Restricted non-Windows manual test directory permissions to the current user.
  • Improvements
    • Updated logging stream chaining behavior.
  • Refactor
    • Simplified fixed-size Matrix copy/move special member implementations.
  • Chores
    • Updated SonarCloud configuration.
  • Tests
    • Added unit tests covering deserialization failure modes and destination preservation.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The changes tighten CUDA and serialization validation, restore SonarCloud configuration, alter Logger and Matrix special members, restrict POSIX test-directory permissions, and add unit coverage for invalid serialized data.

Changes

Tooling and CI

Layer / File(s) Summary
CUDA and SonarCloud configuration
.github/workflows/scripts/actions/install_cuda_ubuntu.sh, .sonarcloud.properties
CUDA checks use safer Bash conditionals, nvcc -V is invoked, and SonarCloud source, exclusion, and C++ standard settings are defined.

Core utility APIs

Layer / File(s) Summary
Logger mutability and Matrix special members
Includes/Core/Utils/Logging.hpp, Includes/Core/Matrix/Matrix.hpp
Logger::operator<< becomes non-const, returns Logger&, and uses a non-mutable stream buffer; Matrix copy and move operations become compiler-generated defaults.

Serialization validation

Layer / File(s) Summary
Typed array serialization contracts
Includes/Core/Utils/Serialization-Impl.hpp
Serialization requires trivially copyable element types, validates byte alignment, and copies validated bytes into destination arrays.
FlatBuffers validation and tests
Sources/Core/Utils/Serialization.cpp, Tests/UnitTests/Array1Tests.cpp
Empty payload handling and FlatBuffers verification are updated; tests cover invalid buffers, destination preservation, and empty deserialization.

Manual test filesystem permissions

Layer / File(s) Summary
Restricted manual-test directory creation
Tests/ManualTests/ManualTests.hpp
POSIX directory creation now uses user-only permissions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Serialize
  participant FlatBuffers
  participant Deserialize
  participant Array1
  Caller->>Serialize: provide payload
  Serialize->>FlatBuffers: build FlatData
  Caller->>Deserialize: provide serialized buffer
  Deserialize->>FlatBuffers: verify and extract payload
  Deserialize->>Array1: assign validated bytes
  Deserialize-->>Caller: return or invalid_argument
Loading

Poem

I’m a bunny with bytes in my den,
Checking each buffer again and again.
CUDA hops safely, logs softly flow,
FlatBuffers reject bad bytes below.
With user-only doors, the tests now glow!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Several unrelated code changes were added beyond SonarCloud restoration, including CUDA, logging, serialization, tests, and matrix defaults. Split the SonarCloud config update from unrelated functional changes, or justify each extra change in a separate PR.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely matches the main change: restoring SonarCloud integration.
Linked Issues check ✅ Passed The SonarCloud configuration updates align with issue #141's request to restore SonarCloud.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sonarcloud

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

@codacy-production

codacy-production Bot commented Jul 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 3 duplication

Metric Results
Complexity 0
Duplication 3

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@utilForever utilForever changed the title Fix SonarCloud analysis findings Restore SonarCloud Jul 11, 2026
@utilForever utilForever self-assigned this Jul 11, 2026
@utilForever utilForever marked this pull request as ready for review July 11, 2026 11:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 @.sonarcloud.properties:
- Line 2: Update the sonar.exclusions setting in .sonarcloud.properties to use
an automatic-analysis-compatible explicit directory or file path for the
generated Flatbuffers sources, or remove the recursive wildcard from this file
and configure that exclusion in SonarCloud analysis-scope settings.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c968318a-9ca4-4fba-9347-eb221c55a08a

📥 Commits

Reviewing files that changed from the base of the PR and between c7497da and 4fc8b7c.

📒 Files selected for processing (10)
  • .github/workflows/scripts/actions/install_cuda_ubuntu.sh
  • .sonarcloud.properties
  • Includes/Core/Matrix/Matrix.hpp
  • Includes/Core/Utils/Logging.hpp
  • Includes/Core/Utils/Parallel-Impl.hpp
  • Includes/Core/Utils/Serialization-Impl.hpp
  • Sources/Core/Utils/Serialization.cpp
  • Tests/ManualTests/ManualTests.hpp
  • Tests/UnitTests/Array1Tests.cpp
  • Tests/UnitTests/Vector3Tests.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (17)
  • GitHub Check: CodeRabbit
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
🔇 Additional comments (12)
Includes/Core/Utils/Serialization-Impl.hpp (1)

15-45: LGTM!

Tests/UnitTests/Vector3Tests.cpp (1)

5-10: LGTM!

Sources/Core/Utils/Serialization.cpp (1)

15-15: LGTM!

Also applies to: 29-34, 52-73

Tests/UnitTests/Array1Tests.cpp (1)

144-170: LGTM!

Includes/Core/Matrix/Matrix.hpp (1)

351-357: LGTM!

Also applies to: 908-908

Includes/Core/Utils/Logging.hpp (1)

60-68: LGTM!

Also applies to: 133-133

Includes/Core/Utils/Parallel-Impl.hpp (2)

128-132: LGTM!


51-81: 🎯 Functional Correctness

No issue here: Internal::Async is only used to wait for completion, and no call site consumes a task result or get().

			> Likely an incorrect or invalid review comment.
.github/workflows/scripts/actions/install_cuda_ubuntu.sh (1)

29-35: LGTM!

Also applies to: 44-50, 81-90, 161-161

.sonarcloud.properties (2)

1-1: LGTM!


3-3: 🎯 Functional Correctness

C++17 override matches the build standard. CXX_STANDARD is set to 17, and CUDA also uses --std=c++17.

Tests/ManualTests/ManualTests.hpp (1)

35-35: LGTM!

Also applies to: 179-179

Comment thread .sonarcloud.properties
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.47%. Comparing base (c7497da) to head (6e7e011).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   84.36%   84.47%   +0.10%     
==========================================
  Files         460      460              
  Lines       32468    32518      +50     
  Branches     2799     2803       +4     
==========================================
+ Hits        27393    27470      +77     
+ Misses       5075     5048      -27     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@utilForever utilForever force-pushed the sonarcloud branch 3 times, most recently from 1150547 to fffbdbd Compare July 11, 2026 15:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@Includes/Core/Matrix/Matrix.hpp`:
- Around line 70-76: Update the Matrix<T, 3, 1> specialization’s copy/move
constructors and assignment operators to be explicitly defaulted, matching the
primary Matrix definition and preserving noexcept qualifiers, so Vector3 aliases
remain trivially copyable.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dee37c33-a27f-4a20-9641-6b3524c91e96

📥 Commits

Reviewing files that changed from the base of the PR and between 1150547 and fffbdbd.

📒 Files selected for processing (1)
  • Includes/Core/Matrix/Matrix.hpp
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: CodeRabbit
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
🔇 Additional comments (1)
Includes/Core/Matrix/Matrix.hpp (1)

70-76: 🎯 Functional Correctness

No issue here. MatrixExpression and MatrixDenseBase are stateless, so the defaulted copy/move operations on Matrix<T, Rows, Cols> do not change behavior beyond copying m_elements.

			> Likely an incorrect or invalid review comment.

Comment thread Includes/Core/Matrix/Matrix.hpp Outdated
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@sonarqubecloud

Copy link
Copy Markdown

Comment thread .github/workflows/ubuntu-sonarcloud.yml Dismissed
Comment thread .github/workflows/ubuntu-sonarcloud.yml Dismissed
@utilForever utilForever merged commit acb941f into main Jul 12, 2026
21 checks passed
@utilForever utilForever deleted the sonarcloud branch July 12, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore SonarCloud

2 participants