Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

SonarQube

Configuration

SonarCloud

From Eric Ball:

...

SonarCloud

Procedure to set up projects for SonarCloud scan can be found from the links below

Java Code

SonarQube on-prem

Akraino code scan is migrating to use SonarCloud, the following will be removed once the migration is done. 

Following configuration assumes SonarQube on prem. As LF is moving to SonarCloud, the setup might be different. 

Each project should have jjb file to integrate with CI. 

To add SonarQube scan, the jjb file should be modified with the following changes:

  • mvn-settings
  • mvn-params
  • gerrit-maven-sonar job

...

https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=blob;f=jjb/portalcamunda_user_interfaceworkflow/portalcamunda_user_interfaceworkflow.yaml;h=ce31a827103f93f8b91712114df3e2687c0fb6d40be9fa76d0b0101402a69fd5b2e394dbb722257e;hb=HEAD

 - project:

    name: portal_user_interface

     project: portal_user_interface

     project-name: portal_user_interface

     mvn-settings: portal_user_interface-settings

     mvn-params: '-f AECPortalMgmt'

    nexus-iq-namespace: 'akraino-'

     build-node: centos7-builder-2c-1g

    stream: master

    jobs:

       - '{project-name}-maven-jobs'

       - gerrit-maven-sonar

     views:

       - project-view

Currently, global-jjb has jobs for Java/maven, Python/tox, and C/cmake. Other languages will have to create their own job templates. For the supported global-jjb jobs, it's just a matter of including the job (such as "gerrit-maven-sonar"), and any parameters that the job requires, in each project's jjb file. 
Here's some additional documentation on the Sonar jobs/macros we have set up:

https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-maven-jobs.html#lf-infra-maven-sonar
https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-python-jobs.html#lf-infra-tox-sonar
https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-c-cpp-jobs.html#cmake-sonarsonarcloud

Non-Java Code

How to: Set up Sonarcloud scans for non-Java projects


Scan Result

SonarQube scan results can be accessed from https://sonarcloud.io/organizations/akraino-edge-stack/projectsYou should be able to log in with your LFID credentials, the same as you would use for Gerrit or Jenkins.

...