Details
-
Story
-
Status: Selected for Development
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
None
-
Empty show more show less
-
ORAN
Description
It would be beneficial if the SonarCloud scanning of Go products was available out of the box with as little extra configuration as possible, like it is for Maven based products.
Now a bash script and rather extensive configuration is needed for each product, see below:
project:
<<: *nonrtric_jdk_common
name: nonrtric-dmaap-mediator-producer-sonar
project-name: nonrtric-dmaap-mediator-producer-sonar
prescan script requires ubuntu
golang is only on docker-enabled nodes
build-node: ubuntu1804-docker-4c-4g
sonar-prescan-script: !include-raw-escape: prescan-dmaapmediatorproducer-ubuntu.sh
sonar-project-file: ""
java-version: openjdk11
use sonarcloud values from defaults.yaml
sonar-properties: |
Required metadata
sonar.login=
sonar.projectKey=
{sonarcloud_project_organization}_nonrtric-dmaap-mediator-producersonar.organization={sonarcloud_project_organization}
Encoding
sonar.build.sourceEncoding=UTF-8
Language
sonar.language=go
Source
sonar.sources=.
Unit tests
sonar.go.coverage.reportPaths=dmaap-mediator-producer/coverage.txt
Inclusions
sonar.inclusions=dmaap-mediator-producer/internal//.go
Exclusions
sonar.exclusions=dmaap-mediator-producer/main.go,dmaap-mediator-producer/mocks/.go,dmaap-mediator-producer/stub/.go,dmaap-mediator-producer/internal//_test.go
jobs:
gerrit-sonar-prescan-script
Hi Henrik. I have proposed a change that would simplify the implementation of sonar projects: https://gerrit.o-ran-sc.org/r/c/ci-management/+/7546
This is simplest change that could be made. There are further options to remove/abstract more of the details, such as putting the sonar-project.properties file one level higher in the filesystem, which would allow using it for any project. We could also make a new job for oran-sonar if there are other values that could have a standard implementation.
Please let me know what you think of these options.