Skip to content

Conversation

@ntsemah
Copy link

@ntsemah ntsemah commented Jan 15, 2026

Description

What

Include tools and examples directories in cppcheck analysis
Enable parallel cppcheck execution and add cppcheck logs to artifacts
Add Coverity analysis for example code

Why ?

HPCINFRA-4173

How ?

It is optional but for complex PRs please provide information about the design,
architecture, approach, etc.

Change type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

Check list

  • Code follows the style de facto guidelines of this project
  • Comments have been inserted in hard to understand places
  • Documentation has been updated (if necessary)
  • Test has been added (if possible)

Include tools and examples directories in cppcheck analysis
Enable parallel cppcheck execution and add cppcheck logs to artifacts
Add Coverity analysis for example code

Signed-off-by: Noam Tsemah <ntsemah@nvidia.com>
@greptile-apps
Copy link

greptile-apps bot commented Jan 15, 2026

Greptile Summary

This PR expands static analysis coverage by including tools and examples directories in both cppcheck and Coverity analysis. It also enables parallel cppcheck execution and ensures analysis logs are archived regardless of test outcome.

Key Changes:

  • Extended cppcheck analysis to scan tools and examples directories with parallel execution (-j${NPROC})
  • Added Coverity analysis for example code by building xlio_ultra_api_ping_pong.c
  • Changed artifact archiving from archiveArtifacts-onfail to archiveArtifacts to capture logs on both success and failure

Issues Found:

  • Critical syntax error: The gcc linker flag in contrib/jenkins_tests/cov.sh:36 uses -libverbs (uppercase i) instead of -lverbs (lowercase L), which will cause the Coverity build for examples to fail

Confidence Score: 2/5

  • This PR contains a critical syntax error that will cause the Coverity build to fail
  • The changes are conceptually sound - expanding static analysis coverage is valuable. However, there's a critical syntax error in contrib/jenkins_tests/cov.sh:36 where -libverbs should be -lverbs. This will cause the gcc compilation command to fail, preventing the Coverity analysis of example code from working. The other changes (cppcheck expansion and artifact archiving) are correct and safe.
  • Pay close attention to contrib/jenkins_tests/cov.sh - it contains a linker flag syntax error that must be fixed before merging

Important Files Changed

Filename Overview
.ci/matrix_job.yaml Changed archiveArtifacts-onfail to archiveArtifacts to archive cppcheck logs even on success
contrib/jenkins_tests/cov.sh Added Coverity analysis for example code, but contains syntax error in linker flag (-libverbs should be -lverbs)
contrib/jenkins_tests/cppcheck.sh Extended cppcheck to analyze tools and examples directories, added parallel execution with -j${NPROC}

Sequence Diagram

sequenceDiagram
    participant CI as CI Pipeline
    participant CPP as cppcheck.sh
    participant COV as cov.sh
    participant FS as File System
    
    Note over CI: Cppcheck Step
    CI->>CPP: Execute cppcheck analysis
    CPP->>FS: find src/, tools/, examples/ files
    FS-->>CPP: Return file list
    CPP->>CPP: Run cppcheck (parallel -j${NPROC})
    CPP->>FS: Write cppcheck.log & cppcheck.err
    CPP->>CI: Archive logs (success or fail)
    
    Note over CI: Coverity Step
    CI->>COV: Execute Coverity analysis
    COV->>COV: Configure & build main project
    COV->>COV: make install (prepare headers)
    COV->>COV: Build examples/xlio_ultra_api_ping_pong.c
    Note over COV: ⚠️ Uses incorrect flag -libverbs
    COV->>COV: Run cov-analyze on all builds
    COV->>FS: Write coverity reports
    COV->>CI: Return exit code
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@ntsemah
Copy link
Author

ntsemah commented Jan 15, 2026

bot:retest

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