Versions Compared

Key

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

...

The command-line tool "git review" is the most reliable and can be used on any platform.  As of this writing, version 1.28.0 or later is required; version 1.26.0 will not work. Windows users should install "Git Bash" to gain support for command-line git. The most common way of installing is to use pip:

pip install git-review

Prohibited Content

Gerrit is designed to host text files – source code.  It enforces a size threshold on every commit, the default limit is 5MB.  Further the Linux Foundation prohibits committing binary files such as compiled executables, jar files, zip archives and so on. An exception is made for binary picture (image) files in GIF, JPG and PNG formats, but the size limit must still be honored.

...

The self-release process for PackageCloud is in active development as of December 2019. Until it is ready, write a ticket at https://jira.linuxfoundation.org/servicedesk

Configure Project for Sonar Analysis

The SonarQube system analyzes source code for problems and reports the results, including test code-coverage statistics, to https://www.sonarcloud.io. The analyses are usually run weekly by a Jenkins job.  This section summarizes the project configuration that is required. Analyzing and reporting static source-code features requires almost no configuration, basically just naming the directory with source code. Reporting code-coverage statistics requires that the project's build and test steps generate those statistics, which requires automated unit tests that can be run by Jenkins.  This section focuses on test configuration to generate coverage data suitable for consumption by the Sonar scanner. See the section later in this document on Jenkins job configuration for details about that.

Configure a Golang Project for Code Coverage

Go projects should use the go-acc tool (``go get -v github.com/ory/go-acc``) to run tests and generate the file coverage.txt.  This yields better results than standard features in golang versions 1.12 and 1.13.  Here's an example:

   go-acc $(go list ./... | grep -vE '(/tests|/enums)' )

However modules are not supported yet by the Sonar Scanner. If you rewrite the module name in the coverage report to the name of the directory with source code, Sonar will match the coverage data with its source analysis.  Also see: https://jira.sonarsource.com/browse/SONARSLANG-450

Configure a Java Project for Code Coverage

Java projects should use the jacoco maven plugin in their POM file, which instruments their code and gathers code-coverage statistics during JUnit tests. Here's an example:

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

Configure a Python Project for Code Coverage

Python projects


Setting up development environment


Making Java code checked by Sonar

...