Skip to content

aws.codeguru_reviewer.describe_code_review

Example SQL Queries

SELECT * FROM
aws.codeguru_reviewer.describe_code_review
WHERE
"code_review_arn" = 'VALUE';

Description

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

Table Definition

Column NameColumn Data Type
code_review_arn Required Input Column

The Amazon Resource Name (ARN) of the CodeReview object.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
code_review

Information about the code review.

STRUCT(
"name" VARCHAR,
"code_review_arn" VARCHAR,
"repository_name" VARCHAR,
"owner" VARCHAR,
"provider_type" VARCHAR,
"state" VARCHAR,
"state_reason" VARCHAR,
"created_time_stamp" TIMESTAMP_S,
"last_updated_time_stamp" TIMESTAMP_S,
"type" VARCHAR,
"pull_request_id" VARCHAR,
"source_code_type" STRUCT(
"commit_diff" STRUCT(
"source_commit" VARCHAR,
"destination_commit" VARCHAR,
"merge_base_commit" VARCHAR
),
"repository_head" STRUCT(
"branch_name" VARCHAR
),
"branch_diff" STRUCT(
"source_branch_name" VARCHAR,
"destination_branch_name" VARCHAR
),
"s3_bucket_repository" STRUCT(
"name" VARCHAR,
"details" STRUCT(
"bucket_name" VARCHAR,
"code_artifacts" STRUCT(
"source_code_artifacts_object_key" VARCHAR,
"build_artifacts_object_key" VARCHAR
)
)
),
"request_metadata" STRUCT(
"request_id" VARCHAR,
"requester" VARCHAR,
"event_info" STRUCT(
"name" VARCHAR,
"state" VARCHAR
),
"vendor_name" VARCHAR
)
),
"association_arn" VARCHAR,
"metrics" STRUCT(
"metered_lines_of_code_count" BIGINT,
"suppressed_lines_of_code_count" BIGINT,
"findings_count" BIGINT
),
"analysis_types" VARCHAR[],
"config_file_state" VARCHAR
)
Show child fields
code_review.analysis_types[]
code_review.association_arn

The Amazon Resource Name (ARN) of the RepositoryAssociation that contains the reviewed source code. You can retrieve associated repository ARNs by calling ListRepositoryAssociations.

code_review.code_review_arn

The Amazon Resource Name (ARN) of the CodeReview object.

code_review.config_file_state

The state of the aws-codeguru-reviewer.yml configuration file that allows the configuration of the CodeGuru Reviewer analysis. The file either exists, doesn't exist, or exists with errors at the root directory of your repository.

code_review.created_time_stamp

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

code_review.last_updated_time_stamp

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

code_review.metrics

The statistics from the code review.

Show child fields
code_review.metrics.findings_count

Total number of recommendations found in the code review.

code_review.metrics.metered_lines_of_code_count

MeteredLinesOfCodeCount 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.

code_review.metrics.suppressed_lines_of_code_count

SuppressedLinesOfCodeCount is the number of lines of code in the repository where the code review happened that CodeGuru Reviewer did not analyze. The lines suppressed in the analysis is based on the excludeFiles variable in the aws-codeguru-reviewer.yml file. This number does not include non-code lines such as comments and blank lines.

code_review.name

The name of the code review.

code_review.owner

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.

code_review.provider_type

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

code_review.pull_request_id

The pull request ID for the code review.

code_review.repository_name

The name of the repository.

code_review.source_code_type

The type of the source code for the code review.

Show child fields
code_review.source_code_type.branch_diff

A type of SourceCodeType that specifies a source branch name and a destination branch name in an associated repository.

Show child fields
code_review.source_code_type.branch_diff.destination_branch_name

The destination branch for a diff in an associated repository.

code_review.source_code_type.branch_diff.source_branch_name

The source branch for a diff in an associated repository.

code_review.source_code_type.commit_diff

A SourceCodeType that specifies a commit diff created by a pull request on an associated repository.

Show child fields
code_review.source_code_type.commit_diff.destination_commit

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

code_review.source_code_type.commit_diff.merge_base_commit

The SHA of the merge base of a commit.

code_review.source_code_type.commit_diff.source_commit

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

code_review.source_code_type.repository_head

A SourceCodeType that specifies the tip of a branch in an associated repository.

Show child fields
code_review.source_code_type.repository_head.branch_name

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

code_review.source_code_type.request_metadata

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.

Show child fields
code_review.source_code_type.request_metadata.event_info

Information about the event associated with a code review.

Show child fields
code_review.source_code_type.request_metadata.event_info.name

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

code_review.source_code_type.request_metadata.event_info.state

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

code_review.source_code_type.request_metadata.request_id

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

code_review.source_code_type.request_metadata.requester

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.

code_review.source_code_type.request_metadata.vendor_name

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.

code_review.source_code_type.s3_bucket_repository

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 for S3BucketRepository based code reviews.

Show child fields
code_review.source_code_type.s3_bucket_repository.details

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.

Show child fields
code_review.source_code_type.s3_bucket_repository.details.bucket_name

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

code_review.source_code_type.s3_bucket_repository.details.code_artifacts

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.

Show child fields
code_review.source_code_type.s3_bucket_repository.details.code_artifacts.build_artifacts_object_key

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 GitHub Actions in the Amazon CodeGuru Reviewer User Guide.

code_review.source_code_type.s3_bucket_repository.details.code_artifacts.source_code_artifacts_object_key

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

code_review.source_code_type.s3_bucket_repository.name

The name of the repository when the ProviderType is S3Bucket.

code_review.state

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.

code_review.state_reason

The reason for the state of the code review.

code_review.type

The type of code review.