Important locations
The three locations that matter the most in Coverity on Polaris are where you keep:
- The configuration file.
- The work directory.
- The access token.
A configuration file controls how analysis is performed for a specific project. The
default location for this is in the root directory of your project, with the name
polaris.yml.
You can specify a different configuration file with the
--configuration-file common option or by uploading it by passing the
--upload-local-config option with polaris analyze .
The second important location is the work directory, where Coverity on Polaris stores intermediate work and other configuration for a project. The default location for this directory is .blackduck/polaris in the project's root directory. Examples of the work directory contents are:
- Log files: A scan log file is created for each scan and contains additional information.
- CLI time consumption: The end-to-end time required by the scan.
The third location contains the most recently used access token as well as tools that polaris has downloaded. The default location for this directory is .blackduck/polaris in your home directory. Your most recently used access token is stored in .blackduck/polaris/.access_token in your home directory.
The cli-scan.json file
When the Coverity on Polaris CLI tool runs analysis, it updates a JSON file containing information about how analysis runs. The file can be used to gather the information needed by CI/CD processes to check the scan status later and then get issues after the scan completes.
The cli-scan.json file contains:
- Project, branch, and revision IDs.
- Information about the tools used, including the version number.
- Links that you can use to retrieve issues discovered during the analysis. Each tool
provides a link in the
issueApiUrlattribute, and a summary of issues is retrieved from thesummaryUrlattribute.
When Coverity on Polaris CLI is used to run analysis with the -w flag, the cli-scan.json file reflects the final status of the job. Without the flag, it reflects the status when the job was scheduled.
The file can be found at: <project_root>/.blackduck/polaris/cli-scan.json.
The json file is formatted as follows.
cli-scan.json:
{
"version": "2.0",
"scanInfo": {
"cliVersion": "1.11.200",
"scanTime": "2020-11-12T21:50:06Z",
"issueApiUrl": "https://domain.cop.blackduck.com/api/query/v0/roll-up-counts?branch-id=9d1e8481-7246-43ae-b5d6-ebf36c33f6fe&filter%5Bissue%5D%5Bstatus%5D%5B%24eq%5D=opened&for-child-paths=false&group-by=%5Bissue%5D%5Btaxonomy%5D%5Bid%5D%5B51c01c05-706f-4aa8-bf95-ed7d21ac7eb7%5D&include%5Bissue%5D%5B%5D=severity&page%5Blimit%5D=25&page%5Boffset%5D=0&project-id=36244013-5454-4e56-bafe-26a0ffef3955"
},
"projectInfo": {
"projectId": "36244013-5454-4e56-bafe-26a0ffef3955",
"branchId": "9d1e8481-7246-43ae-b5d6-ebf36c33f6fe",
"revisionId": "482d463f-54f9-4bdb-9b91-b7db44eb5565"
},
"tools": [
{
"toolName": "Coverity",
"toolVersion": "2020.09",
"jobId": "nnc9i9q6b13cvcf6o6f7kgdf8g",
"jobStatusUrl": "https://domain.cop.blackduck.com/api/jobs/jobs/nnc9i9q6b13cvcf6o6f7kgdf8g",
"jobStatus": "COMPLETED",
"issueApiUrl": "https://domain.cop.blackduck.com/api/query/v0/roll-up-counts?branch-id=9d1e8481-7246-43ae-b5d6-ebf36c33f6fe&filter%5Bissue%5D%5Bstatus%5D%5B%24eq%5D=opened&filter%5Bissue%5D%5Btool%5D%5Bid%5D%5B%24eq%5D=b8dfd0f5-48b4-4376-9b70-5fb4dee1a03c&for-child-paths=false&group-by=%5Bissue%5D%5Btaxonomy%5D%5Bid%5D%5B51c01c05-706f-4aa8-bf95-ed7d21ac7eb7%5D&include%5Bissue%5D%5B%5D=severity&page%5Blimit%5D=25&page%5Boffset%5D=0&project-id=36244013-5454-4e56-bafe-26a0ffef3955"
}
],
"issueSummary": {
"issuesBySeverity":
"high": 1,
"medium": 1,
"low": 1
},
"total": 3,
"newIssues": 0,
"closedIssues": 0,
"summaryUrl": "https://domain.cop.blackduck.com/projects/36244013-5454-4e56-bafe-26a0ffef3955/branches/9d1e8481-7246-43ae-b5d6-ebf36c33f6fe"
}
}