Upsource 2020.1 Help

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.

Show inspection results from TeamCity

On the TeamCity side, go through the following steps:

  1. Set up a build configuration (if you don't have one yet) to run code inspections.

  2. In that configuration, define the system property system.teamcity.dont.delete.temp.result.dir=true

  3. 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 <integration-credentials> -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 <integration-credentials> -X POST https://upsource.yourcompany.com/~inspections/project-id/%env.BUILD_VCS_NUMBER%/resharper –data-binary @results-%env.BUILD_VCS_NUMBER%.zip

    Where <integration-credentials> is the authentication token defined in Upsource for integration with a CI server. Find it on the Create/Edit Project page, under the Integration tab, or create it there if it's never been defined.

    If your CI server integration has been configured with user (administrator) credentials, you can optionally use them instead of the token.

Last modified: 02 April 2021