Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . codeguru-reviewer ]

describe-code-review

Description

Returns the metadata associated with the code review along with its status.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  describe-code-review
--code-review-arn <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--code-review-arn (string)

The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

List details about a code review.

The following describe-code-review lists information about a review of code in the "mainline" branch of an AWS CodeCommit repository that is named "my-repo-name".

aws codeguru-reviewer put-recommendation-feedback \
    --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \
    --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb \
    --reactions ThumbsUp

Output

{
        "CodeReview": {
            "Name": "My-ecs-beta-repo-master-xs6di4kfd4j269dz",
            "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222:code-review:RepositoryAnalysis-my-repo-name",
            "RepositoryName": "My-ecs-beta-repo",
            "Owner": "123456789012",
            "ProviderType": "CodeCommit",
            "State": "Pending",
            "StateReason": "CodeGuru Reviewer is reviewing the source code.",
            "CreatedTimeStamp": 1618874226.226,
            "LastUpdatedTimeStamp": 1618874233.689,
            "Type": "RepositoryAnalysis",
            "SourceCodeType": {
                "RepositoryHead": {
                    "BranchName": "mainline"
                }
            },
            "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    }

For more information, see `DescribeCodeReview<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeCodeReview.html>`__ in the Amazon CodeGuru Reviewer API Reference

Output

CodeReview -> (structure)

Information about the code review.

Name -> (string)

The name of the code review.

CodeReviewArn -> (string)

The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

RepositoryName -> (string)

The name of the repository.

Owner -> (string)

The owner of the repository. For an Amazon Web Services CodeCommit repository, this is the Amazon Web Services account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository. For an S3 repository, it can be the username or Amazon Web Services account ID.

ProviderType -> (string)

The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).

State -> (string)

The valid code review states are:

  • Completed : The code review is complete.
  • Pending : The code review started and has not completed or failed.
  • Failed : The code review failed.
  • Deleting : The code review is being deleted.

StateReason -> (string)

The reason for the state of the code review.

CreatedTimeStamp -> (timestamp)

The time, in milliseconds since the epoch, when the code review was created.

LastUpdatedTimeStamp -> (timestamp)

The time, in milliseconds since the epoch, when the code review was last updated.

Type -> (string)

The type of code review.

PullRequestId -> (string)

The pull request ID for the code review.

SourceCodeType -> (structure)

The type of the source code for the code review.

CommitDiff -> (structure)

A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a commit diff created by a pull request on an associated repository.

SourceCommit -> (string)

The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.

DestinationCommit -> (string)

The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.

MergeBaseCommit -> (string)

The SHA of the merge base of a commit.

RepositoryHead -> (structure)

A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

BranchName -> (string)

The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

BranchDiff -> (structure)

A type of ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a source branch name and a destination branch name in an associated repository.

SourceBranchName -> (string)

The source branch for a diff in an associated repository.

DestinationBranchName -> (string)

The destination branch for a diff in an associated repository.

S3BucketRepository -> (structure)

Information about an associated repository in an S3 bucket that includes its name and an S3RepositoryDetails object. The S3RepositoryDetails object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. S3BucketRepository is required in ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ for S3BucketRepository based code reviews.

Name -> (string)

The name of the repository when the ProviderType is S3Bucket .

Details -> (structure)

An S3RepositoryDetails object that specifies the name of an S3 bucket and a CodeArtifacts object. The CodeArtifacts object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.

BucketName -> (string)

The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

CodeArtifacts -> (structure)

A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for a source code .zip file and for a build artifacts .zip file that contains .jar or .class files.

SourceCodeArtifactsObjectKey -> (string)

The S3 object key for a source code .zip file. This is required for all code reviews.

BuildArtifactsObjectKey -> (string)

The S3 object key for a build artifacts .zip file that contains .jar or .class files. This is required for a code review with security analysis. For more information, see Create code reviews with security analysis in the Amazon CodeGuru Reviewer User Guide .

RequestMetadata -> (structure)

Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The RequestMetadaa field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.

RequestId -> (string)

The ID of the request. This is required for a pull request code review.

Requester -> (string)

An identifier, such as a name or account ID, that is associated with the requester. The Requester is used to capture the author/actor name of the event request.

EventInfo -> (structure)

Information about the event associated with a code review.

Name -> (string)

The name of the event. The possible names are pull_request , workflow_dispatch , schedule , and push

State -> (string)

The state of an event. The state might be open, closed, or another state.

VendorName -> (string)

The name of the repository vendor used to upload code to an S3 bucket for a CI/CD code review. For example, if code and artifacts are uploaded to an S3 bucket for a CI/CD code review by GitHub scripts from a GitHub repository, then the repository association's ProviderType is S3Bucket and the CI/CD repository vendor name is GitHub. For more information, see the definition for ProviderType in RepositoryAssociation .

AssociationArn -> (string)

The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ that contains the reviewed source code. You can retrieve associated repository ARNs by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

Metrics -> (structure)

The statistics from the code review.

MeteredLinesOfCodeCount -> (long)

MeteredLinesOfCode is the number of lines of code in the repository where the code review happened. This does not include non-code lines such as comments and blank lines.

FindingsCount -> (long)

Total number of recommendations found in the code review.

AnalysisTypes -> (list)

They types of analysis performed during a repository analysis or a pull request review. You can specify either Security , CodeQuality , or both.

(string)