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