Main Content

polyspace-access -upload

Upload results to Polyspace Access database

    Description

    The polyspace-access -upload command uploads results to a Polyspace® Access™ project from a local folder.

    polyspace-access -upload <path> [upload options] -host <hostname> [login options] [output options] uploads Polyspace Bug Finder™, Code Prover, or Polyspace Test™ results to the Polyspace Access database from the file (recommended), folder, or zipped file that you specify with <path>. You can upload Bug Finder or Code Prover results using this command only if those results were generated with Polyspace Bug Finder Server™ or Polyspace Code Prover™ Server. You can upload results to an existing Polyspace Access project only if those results were generated by the same type of analysis. For example, you cannot upload results of a Bug Finder analysis to a project that contains Code Prover results.

    To upload results generated with the Polyspace desktop interface, see Upload Results from Polyspace Desktop Client (Polyspace Bug Finder).

    To upload results generated with the Polyspace platform user interface, see Upload Results from Polyspace Platform User Interface (Polyspace Bug Finder).

    Use the upload options to specify a project parent folder or to rename a project.

    Note

    • You can upload up to 2 GB of results per upload to Polyspace Access.

    • Polyspace Access does not support user-defined coding standards. If you upload analysis results that contain violations of a user-defined coding standard, Polyspace Access ignores those violations. For more on user-defined coding standards, see Check for Violations of User-Defined Coding Standard Using Polyspace Bug Finder (Polyspace Bug Finder).

    example

    Examples

    collapse all

    Upload a set of findings to Polyspace Access generated with Polyspace Bug Finder Server or Polyspace Code Prover Server, and authorize only some team members to view these findings.

    Create a project folder restrictedProject at the top of the project hierarchy.

    polyspace-access -create-project restrictedProject ^
    -host myAccessServer -port 1234
    

    Set roles for users jsmith and rroll, and the group Authorized Users, authorizing them to access the project folder as contributors. If a user name or group name contains spaces, enclose it in double quotes.

    polyspace-access -set-role contributor ^
    -user jsmith -user rroll -group "Authorized Users" -project-path restrictedProject ^
    -host myAccessServer -port 1234
    Aside from the creator of the project folder and the users and group with the role contributor, no other user can view or access any findings uploaded to restrictedProject.

    Upload Bug Finder project findings from project My Example Project to parent folder Restricted.

    polyspace-access -upload "C:\Polyspace_Workspace\My Example Project\Module1\ps_results.psbf" ^
    -host myAccessServer -parent-project Restricted -port 1234
    
    The uploaded findings are stored in the folder restrictedProject/My_Example_Project (Bug Finder). The polyspace access -upload command outputs information about the upload including a URL to view the uploaded results in the Polyspace Access interface.

    See also Manage Project Permissions.

    Input Arguments

    collapse all

    Upload Results

    Path of a Bug Finder (PSBF) results file, Code Prover (PSCP) results file, or Polyspace Test (PSTESTR or PSPROF) results file specified as a string. The command uploads copies of the results file and other files located in the same results folder. Alternatively, you can specify the path of a parent folder that contains a single PSBF, PSCP, PSTESTR, or PSPROF results file, or the path of a zipped results file or folder.

    For faster uploads, store your analysis results in a dedicated results folder by using option -results-dir (Polyspace Bug Finder) when you run the analysis. If you store results in a folder that contains a large number of files unrelated to Polyspace analysis results such as the root folder of your repository, Polyspace Access takes longer to upload the results.

    Example: -upload C:\Polyspace_Workspace\myProject\Module_1\BF_results\ps_results.psbf

    Example: -upload C:\Polyspace_Workspace\myProject\Module_1\

    Example: -upload C:\Polyspace_Workspace\myTestProj\results\results.pstestr

    Options to specify path to project folder and name of project where you upload results.

    OptionDescription

    -parent-project <folderPath>

    Path of the parent folder in the Polyspace Access explorer under which you store uploaded results, specified as a string.

    If you do not specify a parent folder, uploaded results are stored under the public folder.

    -project <resultsName>

    Name of the uploaded results in the Polyspace Access explorer, specified as a string. Use this option to rename the results that you upload.

    If you do not specify a results name, the results are stored as projectName (resultsType), where spaces in projectName are replaced with underscores. For instance, if you upload Bug Finder results from project Bug Finder Example, these results are stored as Bug_Finder_Example (Bug Finder).

    -exclude-from-deletion

    Exclude the run that you are uploading from the project run deletion policy. Use this option to protect project runs of interest from deletion. For example, to keep the first run that you upload to a project as a baseline, but still apply a deletion policy to all other runs that you upload to that project, upload the first run using the -exclude-from-deletion option.

    When you exclude a run from the deletion policy, the run remains in the database until you explicitly delete it. The run appears as Persistent in the Runs Deletion window on the Polyspace Access interface. Polyspace does not count runs that you exclude from deletion when applying the maximum number of runs deletion policy. You cannot delete individual runs from the command line.

    Example:

    polyspace-access -upload /usr/local/polyspace/results/ps_results.psbf \
     -parent-project public/examples \
     -exclude-from-deletion
    See also Delete Project Runs or Entire Projects.

    Connection Configuration

    Polyspace Access machine hostname that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which hostname to use, contact your Polyspace Access administrator.

    You must specify a hostname with all polyspace-access commands, except the -generate-migration-commands and -encrypt-password commands.

    Example: -host myAccessServer

    Port number that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which port number to use, contact your Polyspace Access administrator.

    HTTP protocol used to access Polyspace Access, specified as http or https.

    Full path to the text file where you store your login credentials. Use this option if you use a command that requires your Polyspace Access credentials in a script but you do not want to store your credentials in that script. While the script runs, someone inspecting currently running processes cannot see your credentials.

    You can store only one set of credentials in the file, either as -login and -encrypted-password entries on separate lines, for instance:

    -login jsmith
    -encrypted-password LAMMMEACDMKEFELKMNDCONEAPECEEKPL
    You can also store credentials as an -api-key entry:
    -api-key keyValue123
    Make sure that the file where you store your credentials is UTF-8 encoded and that you restrict the read and write permissions on the file. For example, to restrict read and write permissions on file login.txt in Linux®, use this command:
    chmod go-rwx login.txt

    API key you use as a login credential instead of providing your login and encrypted password. To assign an API key to a user, see Configure User Manager or contact your Polyspace Access administrator.

    Use the API key if you use a command that requires your Polyspace Access login credentials as part of an automation script with a CI tool such as Jenkins®. If a user updates their password, you do not need to update the API key associated with that user in your scripts.

    It is recommended that you store the API key in a text file and pass that file to the command by using the -credentials-file option.

    Login username that you use to interact with Polyspace Access.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use -api-key.

    Login password you use to interact with Polyspace Access. <ENCRYPTED_PASSWORD> is the output of the polyspace-access -encrypt-password command.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use the -api-key option.

    Number of times the polyspace-access command retries to upload results when you upload from a client machine to the server machine that hosts Polyspace Access before failing. Specify this option to retry the upload command in the event of sporadic network outages. The command waits 10 seconds between retries.

    Full path to command outputs.

    Path to the folder for storing temporary files generated by polyspace-access commands. The default folder path depends on your platform:

    • Windows — C:\Users\%username%\AppData\Local\Temp\ps_results_server

    • Linux — tmp/ps_results_server

    File path where you store the command output log. By default the command does not generate a log file.

    Version History

    Introduced in R2019a