Uploaded image for project: 'IT: Release Engineering'
  1. IT: Release Engineering
  2. RELENG-4120

Simpler configuration for SonarCloud scanning of Go code?

Issue XMLXMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • Q4 2023 RE Operations
    • None
    • None
    • None

      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=

      {sonarcloud_api_token}

      sonar.projectKey=

      {sonarcloud_project_organization}_nonrtric-dmaap-mediator-producer
      sonar.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

              kevin.sandi Kevin Sandi
              kevin.sandi Kevin Sandi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: