Change sonarcloud analysis method#652
Conversation
📝 WalkthroughWalkthroughThe changes involve modifications to the GitHub Actions workflow configuration in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
.github/workflows/analyzers.yml (3)
125-130: LGTM! Consider adding a step name for clarity.The change to use
lukka/run-cmake@v10action simplifies the build process and aligns well with the removal of theBUILD_WRAPPER_OUT_DIRenvironment variable. This approach is more straightforward and maintainable.Consider adding a
name:field to this step for better readability in the GitHub Actions UI. For example:- name: Configure, Build, and Test uses: lukka/run-cmake@v10 with: configurePreset: ci-ubuntu-clang-tests-no-checks buildPreset: ci-build testPreset: ci-tests
165-165: LGTM! Consider improving command readability.The sonar-scanner command for Pull Request events has been appropriately simplified while maintaining all necessary parameters. This change is consistent with the removal of the build-wrapper step.
To improve readability, consider breaking the long command into multiple lines using YAML's multi-line string syntax. For example:
run: | sonar-scanner \ --define sonar.scm.revision=${{ github.event.workflow_run.head_sha }} \ --define sonar.pullrequest.key=${{ steps.source-run-info.outputs.pullRequestNumber }} \ --define sonar.pullrequest.branch=${{ steps.source-run-info.outputs.sourceHeadBranch }} \ --define sonar.pullrequest.base=${{ steps.source-run-info.outputs.targetBranch }}This format makes the command easier to read and maintain.
Line range hint
1-165: Overall, the changes improve workflow simplicity and maintainability.The modifications to the
sonarcloud_and_coveragejob in this workflow file are well-executed and consistent. Key improvements include:
- Replacing the build-wrapper step with a simpler CMake run using
lukka/run-cmake@v10.- Removing the
BUILD_WRAPPER_OUT_DIRenvironment variable and related references.- Simplifying the sonar-scanner commands for both push and pull request events.
These changes streamline the workflow while maintaining its core functionality. The removal of the build-wrapper step and related configurations reduces complexity without compromising the analysis process.
To further improve this workflow, consider:
- Adding more descriptive step names throughout the workflow for better readability in the GitHub Actions UI.
- Evaluating if any of the remaining steps can be combined or simplified to reduce overall execution time.
- Documenting the purpose of this workflow and its relationship to the "CI v2" workflow in a comment at the top of the file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- .github/workflows/analyzers.yml (2 hunks)
- sonar-project.properties (1 hunks)
🔇 Additional comments (2)
sonar-project.properties (1)
12-12: LGTM! Verify compile_commands.json generation.The addition of
sonar.cfamily.compile-commands=build/compile_commands.jsonis a good improvement for SonarQube analysis of C/C++ projects. This will enhance the accuracy of the analysis by providing precise compilation information for each source file.To ensure this configuration works as expected, please verify that:
- The
compile_commands.jsonfile is being generated in thebuilddirectory during your build process.- The CI/CD pipeline that runs SonarQube analysis has access to this file.
You can use the following script to check for the existence of the file:
.github/workflows/analyzers.yml (1)
157-157: LGTM! Simplified sonar-scanner command.The sonar-scanner command for PUSH events has been appropriately simplified. The removal of the
BUILD_WRAPPER_OUT_DIRreference is consistent with the earlier changes in the workflow.
#651
Summary by CodeRabbit
New Features
Chores