Skip to main content

code_reviews

Creates, updates, deletes, gets or lists a code_reviews resource.

Overview

Namecode_reviews
TypeResource
Idaws.codeguru_reviewer.code_reviews

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
code_review_summariesarrayA list of code reviews that meet the criteria of the request.
next_tokenstringPagination token.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_code_reviewsselectType, regionProviderTypes, States, RepositoryNames, MaxResults, NextTokenLists all the code reviews that the customer has created in the past 90 days.
describe_code_reviewselectcode_review_arn, regionReturns the metadata associated with the code review along with its status.
create_code_reviewinsertregion, Name, RepositoryAssociationArn, TypeUse to create a code review with a CodeReviewType of RepositoryAnalysis. This type of code review analyzes all code under a specified branch in an associated repository. PullRequest code reviews are automatically triggered by a pull request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
TypestringThe type of code reviews to list in the response.
code_review_arnstringThe Amazon Resource Name (ARN) of the CodeReview object.
regionstringAWS region (default: us-east-1)
MaxResultsintegerThe maximum number of results that are returned per call. The default is 100.
NextTokenstringIf nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.
ProviderTypesarrayList of provider types for filtering that needs to be applied before displaying the result. For example, providerTypes=[GitHub] lists code reviews from GitHub.
RepositoryNamesarrayList of repository names for filtering that needs to be applied before displaying the result.
StatesarrayList of states for filtering that needs to be applied before displaying the result. For example, states=[Pending] lists code reviews in the Pending 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.

SELECT examples

Lists all the code reviews that the customer has created in the past 90 days.

SELECT
code_review_summaries,
next_token
FROM aws.codeguru_reviewer.code_reviews
WHERE Type = '{{ Type }}' -- required
AND region = '{{ region }}' -- required
AND ProviderTypes = '{{ ProviderTypes }}'
AND States = '{{ States }}'
AND RepositoryNames = '{{ RepositoryNames }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Use to create a code review with a CodeReviewType of RepositoryAnalysis. This type of code review analyzes all code under a specified branch in an associated repository. PullRequest code reviews are automatically triggered by a pull request.

INSERT INTO aws.codeguru_reviewer.code_reviews (
Name,
RepositoryAssociationArn,
Type,
ClientRequestToken,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ RepositoryAssociationArn }}' /* required */,
'{{ Type }}' /* required */,
'{{ ClientRequestToken }}',
'{{ region }}'
RETURNING
code_review
;