Main Content

polyspace-access -review

Edit review information of results for project

    Description

    The system command polyspace-access -review assigns a status, comment, owner, or other review information to a file or result in a Polyspace® Access™ project.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -set-status <status> -host <hostname> [login options] [output options] assigns a status to the file or result described by <fileOrResultID> in the project <projectToReview>.

    example

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -set-severity <severity> -host <hostname> [login options] [output options] assigns a severity to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -set-comment "<comment>" -host <hostname> [login options] [output options] assigns a comment to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -unset-comment -host <hostname> [login options] [output options] deletes the comment currently assigned to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -set-owner <username> -host <hostname> [login options] [output options] assigns an owner to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -unset-owner -host <hostname> [login options] [output options] removes the owner currently assigned to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -set-ticket <ticketID> -host <hostname> [login options] [output options] assigns an existing bug tracking tool (BTT) ticket to the file or result described by <fileOrResultID> in the project <projectToReview>.

    polyspace-access -review <fileOrResultID> -project-path <projectToReview> -unset-ticket -host <hostname> [login options] [output options] removes the bug tracking tool (BTT) ticket currently applied to the file or result described by <fileOrResultID> in the project <projectToReview>.

    Examples

    collapse all

    In order to make batch edits to the review information of analysis results after you upload those results to Polyspace Access:

    1. Export a list of results that you want to review.

    2. Edit the review information for each result using the result IDs stored in the file from step 1.

    Export a list of defects with severity High or Medium from the project public/example/Bug_Finder_Example (Bug Finder) and project ID 129.

    polyspace-access $login -export 129 -output newMedHighDefects.txt ^
    -resolution new -defects High -defects Medium

    Here, $login is a variable that stores the login credentials and other connection information. To configure this variable, see Encrypt Password and Store Login Options in a Variable.

    The command outputs the tab-separated values file (TSV) newMedHighDefects.txt. The file contains a list of results that match the specified filters, with the first column of storing the result IDs.

    Extract the result IDs column from the file that you generated in the previous step to another text file. For example, use the awk command (BASH command) to skip the column header and then save the result IDs to file resultIDs.txt.

    awk ' NR>1 {print$1} ' newMedHighDefects.txt >> resultIDs.txt

    Pass the file resultIDs.txt to the polyspace-access -review command. Specify the path of the project that contains those results and the review fields that you want to edit.

    polyspace-access $login -review resultIDs.txt ^
     -project-path "public/example/Bug_Finder_Example (Bug Finder)" ^
     -set-status "To investigate" -set-owner fvalverde ^
     -set-comment "Result assigned automatically"
    

    The command runs once and performs a batch edit of the specified review fields for all the results listed in the file resultsIDs.txt. Depending on the number of results and on your network speed, the command might take a several minutes to complete.

    Input Arguments

    collapse all

    Manage Review Information for Results

    Result ID or name of a file that stores result IDs, specified as a string. To perform a batch review, store the result IDs of multiple results in a text file (one result ID per line).

    Polyspace Access assigns unique IDs to each result that you upload.

    Example: -review 1234

    Example: -review listOfResults.txt

    Specify the absolute path of the project that contains the results to which you want to add review information.

    Example: -project-path path/To/Project

    Example: -project-path "project/path/with spaces"

    Status to assign to the result.

    To reset a result status, set the status to Unreviewed.

    Example: -set-status "To investigate"

    Example: -set-status Unreviewed

    Severity of the result, specified as Unset, High, Medium, or Low.

    To reset a result severity, set the severity to Unset.

    Example: -set-severity High

    Example: -set-severity Unset

    Comment to assign to the result, specified as a string within double quotes.

    Use the -unset-comment option to remove the currently assigned comment.

    Example: -set-comment "Example comment - Fix now"

    User to assign to the result as owner, specified as a string. Specify the username that the user uses to log into Polyspace Access, not the display name.

    Use the -unset-owner option to remove the currently assigned user.

    Example: -set-owner jsmith

    Existing bug tracking tool (BTT) ticket to assign to the result, specified as a string. Specify the ticket ID.

    You can assign a BTT ticket to a result only if you integrate a BTT such as Jira Software or Redmine with Polyspace Access. Contact your Polyspace administrator to determine if Polyspace Access is configured for issue tracking.

    Use the -unset-ticket option to remove the currently assigned BTT ticket.

    Example: -set-ticket customTicketID123

    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.

    Tips

    • You cannot assign a review field to a result if that review field is set with a code annotation.

    Version History

    Introduced in R2019a