describe_code_review
(**kwargs)¶Returns the metadata associated with the code review along with its status.
See also: AWS API Documentation
Request Syntax
response = client.describe_code_review(
CodeReviewArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the CodeReview object.
{
'CodeReview': {
'Name': 'string',
'CodeReviewArn': 'string',
'RepositoryName': 'string',
'Owner': 'string',
'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
'State': 'Completed'|'Pending'|'Failed'|'Deleting',
'StateReason': 'string',
'CreatedTimeStamp': datetime(2015, 1, 1),
'LastUpdatedTimeStamp': datetime(2015, 1, 1),
'Type': 'PullRequest'|'RepositoryAnalysis',
'PullRequestId': 'string',
'SourceCodeType': {
'CommitDiff': {
'SourceCommit': 'string',
'DestinationCommit': 'string',
'MergeBaseCommit': 'string'
},
'RepositoryHead': {
'BranchName': 'string'
},
'BranchDiff': {
'SourceBranchName': 'string',
'DestinationBranchName': 'string'
},
'S3BucketRepository': {
'Name': 'string',
'Details': {
'BucketName': 'string',
'CodeArtifacts': {
'SourceCodeArtifactsObjectKey': 'string',
'BuildArtifactsObjectKey': 'string'
}
}
},
'RequestMetadata': {
'RequestId': 'string',
'Requester': 'string',
'EventInfo': {
'Name': 'string',
'State': 'string'
},
'VendorName': 'GitHub'|'GitLab'|'NativeS3'
}
},
'AssociationArn': 'string',
'Metrics': {
'MeteredLinesOfCodeCount': 123,
'SuppressedLinesOfCodeCount': 123,
'FindingsCount': 123
},
'AnalysisTypes': [
'Security'|'CodeQuality',
],
'ConfigFileState': 'Present'|'Absent'|'PresentWithErrors'
}
}
Response Structure
Information about the code review.
The name of the code review.
The Amazon Resource Name (ARN) of the CodeReview object.
The name of the repository.
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.
The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).
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.The reason for the state of the code review.
The time, in milliseconds since the epoch, when the code review was created.
The time, in milliseconds since the epoch, when the code review was last updated.
The type of code review.
The pull request ID for the code review.
The type of the source code for the code review.
A SourceCodeType that specifies a commit diff created by a pull request on an associated repository.
The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.
The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.
The SHA of the merge base of a commit.
A SourceCodeType that specifies the tip of a branch in an associated repository.
The name of the branch in an associated repository. The RepositoryHeadSourceCodeType
specifies the tip of this branch.
A type of SourceCodeType that specifies a source branch name and a destination branch name in an associated repository.
The source branch for a diff in an associated repository.
The destination branch for a diff in an associated 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.
The name of the repository when the ProviderType
is S3Bucket
.
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.
The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer-
.
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.
The S3 object key for a source code .zip file. This is required for all code reviews.
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 .
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.
The ID of the request. This is required for a pull request code review.
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.
Information about the event associated with a code review.
The name of the event. The possible names are pull_request
, workflow_dispatch
, schedule
, and push
The state of an event. The state might be open, closed, or another state.
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.
The Amazon Resource Name (ARN) of the RepositoryAssociation that contains the reviewed source code. You can retrieve associated repository ARNs by calling ListRepositoryAssociations.
The statistics from the code review.
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.
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 theexcludeFiles
variable in theaws-codeguru-reviewer.yml
file. This number does not include non-code lines such as comments and blank lines.
Total number of recommendations found in the code review.
The types of analysis performed during a repository analysis or a pull request review. You can specify either Security
, CodeQuality
, or both.
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.
Exceptions
CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
CodeGuruReviewer.Client.exceptions.InternalServerException
CodeGuruReviewer.Client.exceptions.ValidationException
CodeGuruReviewer.Client.exceptions.AccessDeniedException
CodeGuruReviewer.Client.exceptions.ThrottlingException