Main Content

polyspace-access -import-reviews

Import review information from source project to target project

    Description

    The system command polyspace-access -import-reviews imports review information such as status, severity and comments from one project to another in Polyspace® Access™.

    polyspace-access -import-reviews <sourceProjectPath> -to-project-path <targetProjectPath> [-import-strategy <targetOverwriteOption>] -host <hostname> [login options] [output options] imports review information from source project <sourceProjectPath> to target project <targetProjectPath>. Use this command if you have already reviewed results in the source project and you reuse the code that contains those results in the target project.

    example

    Examples

    collapse all

    Import review information from the project public/example/branchA to the project public/example/branchB.

    Use the -import-reviews command and specify the source and target projects.

    polyspace-access $login -import-reviews public/example/branchA ^
    -to-project-path public/example/branchB
    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.

    After you complete the import, examine the result of the import operation. Use the polyspace-access -export command with option -imported-reviews Overwritten to generate a tab-separated values file (TSV) overWrittenReviews.txt that contains only the results that had their review information overwritten in the target project.

    polyspace-access $login -export public/example/branchB \
     -imported-reviews Overwritten -output overWrittenReviews.txt 

    Input Arguments

    collapse all

    Manage Review Information for Results

    Absolute path of the source project that you import review information from, specified as a string. If the path includes spaces, use double quotes.

    Example: -import-reviews path/To/sourceProject

    Example: -import-reviews "source project/path/with spaces"

    Absolute path of the target project that you import review information into, specified as a string. By default, if a review field already has content, the imported review information from the source project does not overwrite it. Use the option -import-strategy <targetOverwriteOption> to force the overwrite of the target project review information with the review information imported from the source project.

    If the path includes spaces, use double quotes.

    Example: -to-project-path path/To/targetProject

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

    Import strategy that the command uses to determine whether to overwrite review fields, specified as one of these values:

    • never-overwrite-target — If a review field in the target project already has content, do not overwrite that review field with the content from the source project.

    • always-overwrite-target — Always overwrite the content of the review fields in the target project with the content from the source project, even if the target review fields already have content.

    See also Import Review Information from Existing Polyspace Access Projects.

    Example: -import-reviews always-overwrite-target

    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