External inspections support
In addition to Upsource native code inspections delivered by its build-in IntelliJ IDEA engine, you can make Upsource display inspection results uploaded from the external inspection runners: IntelliJ global inspections and ReSharper inspections bundled with TeamCity, and SonarQube.
Show inspection results from TeamCity
On the TeamCity side, go through the following steps:
-
Set up a build configuration (if you don't have one yet) to run code inspections.
-
In that configuration, define the system property
system.teamcity.dont.delete.temp.result.dir=true
-
If you are running IDEA inspections, add the following command-line script to the last build step:
zip results-%env.BUILD_VCS_NUMBER%.zip %system.teamcity.build.tempDir%/inspection*result/* curl -u <your-build-tool-integration-credentials-defined-in-upsource> -X POST https://upsource.yourcompany.com/~inspections/project-id/%env.BUILD_VCS_NUMBER%/idea –data-binary @results-%env.BUILD_VCS_NUMBER%.zip
If you are running ReSharper inspections, add the following command-line script to the last build step:
zip results-%env.BUILD_VCS_NUMBER%.zip %system.teamcity.build.tempDir%/inspection*result/* curl -u <your-build-tool-integration-credentials-defined-in-upsource> -X POST https://upsource.yourcompany.com/~inspections/project-id/%env.BUILD_VCS_NUMBER%/resharper –data-binary @results-%env.BUILD_VCS_NUMBER%.zip
Show inspection results from SonarQube
To upload and show SonarQube inspections, Upsource uses a dedicated plug-in that should be installed into SonarQube:
-
Download the plugin from the Upsource download page.
-
Install the plugin into SonarQube as described here.
-
Run the sonar-scanner with the following extra parameters:
sonar.upsource.url=<your-upsource-server-url> sonar.upsource.project=<project-id-in-upsource> sonar.upsource.revision=<VCS-revision-id> sonar.upsource.token=<External-tool-integration-token-defined-in-upsource>