Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run sonar cloud on C/C++ bindings [AP-910] #1374

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

woodfell
Copy link
Contributor

@woodfell woodfell commented Nov 13, 2023

Description

@swift-nav/devinfra

Add GA stage to run C/C++ code through sonar cloud

The main sonar cloud stage currently excludes C/C++ code from analysis. Due to the way C/C++ code needs to be processed this stage needs to remain as is.

There is already an extra project in sonar cloud setup up to receive C/C++ but it is currently unused. This PR adds a new stage in GA which runs all the C/C++ unit tests to generate code coverage data, then calls the sonar scanner utility.

Results are posted here as a comment and there is a new status which could be set as a gate on merging PRs (but isn't at the moment)

Code coverage isn't showing up properly on this PR because I accidentally pushed a master analysis to sonar cloud during development of this PR. Since there are no code changes on this PR the diff is 0 and the sonar cloud results are also 0. To test this work I added a new message but didn't create any unit tests. The sonar cloud stage ran properly, detected a couple of code smells and complained about the lack of test coverage. The testing message has since been removed from this branch and is no longer visible.

Results for master can be viewed by going to sonarcloud.io. These results will be the baseline for any future PRs

API compatibility

Does this change introduce a API compatibility risk?

N/A

API compatibility plan

If the above is "Yes", please detail the compatibility (or migration) plan:

N/A

JIRA Reference

https://swift-nav.atlassian.net/browse/AP-910

@woodfell woodfell changed the title m Run sonar cloud on C/C++ bindings [AP-910] Nov 14, 2023
@woodfell
Copy link
Contributor Author

Note that for some reason the name of the preexisting "auto" sonar cloud stage has changed even though this PR doesn't make any changes. It is now being reported as [libsbp_auto] SonarCloud Code Analysis (previously [swift-nav_libsbp_auto] SonarCloud Code Analysis. I don't know why this happened.

There is a gate on this stage but since the status is no longer being reported it isn't able to be merged in it's current form. Once the PR is approved I will make the appropriate changes to resolve this issue

@woodfell woodfell marked this pull request as ready for review November 14, 2023 09:57
@woodfell woodfell requested a review from a team as a code owner November 14, 2023 09:57
Copy link
Contributor

@pcrumley pcrumley left a comment

Choose a reason for hiding this comment

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

@woodfell ... libsbp had two configs in the safe-settings repo and when we removed the one to unblock you to add the secrets you needed to, we re-enabled that new blocking sonar check which shouldn't be there.

I am merging that fix in shortly and then this PR should be ready to take

Copy link

sonarcloud bot commented Nov 14, 2023

[libsbp-c] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

4 participants