• 沒有找到結果。

CommitDiffSourceCodeType

在文檔中 Amazon CodeGuru Reviewer (頁 63-92)

CommitDiffSourceCodeType

A type of SourceCodeType that specifies the commit diff for a pull request on an associated repository.

The SourceCommit and DestinationCommit fields are required to do a pull request code review.

Contents

DestinationCommit

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

Type: String

Length Constraints: Minimum length of 6. Maximum length of 64.

Required: No MergeBaseCommit

The SHA of the merge base of a commit.

Type: String

Length Constraints: Minimum length of 6. Maximum length of 64.

Required: No SourceCommit

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

Type: String

Length Constraints: Minimum length of 6. Maximum length of 64.

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

EventInfo

EventInfo

Information about an event. The event might be a push, pull request, scheduled request, or another type of event.

Contents

Name

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: ^[ \-A-Z_a-z]+$

Required: No State

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: ^[ \-A-Z_a-z]+$

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

KMSKeyDetails

KMSKeyDetails

An object that contains:

• The encryption option for a repository association. It is either owned by AWS Key Management Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).

• The ID of the AWS KMS key that is associated with a respository association.

Contents

EncryptionOption

The encryption option for a repository association. It is either owned by AWS Key Management Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).

Type: String

Valid Values: AWS_OWNED_CMK | CUSTOMER_MANAGED_CMK Required: No

KMSKeyId

The ID of the AWS KMS key that is associated with a respository association.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [a-zA-Z0-9-]+

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

Metrics

Metrics

Information about the statistics from the code review.

Contents

FindingsCount

Total number of recommendations found in the code review.

Type: Long Required: No

MeteredLinesOfCodeCount

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.

Type: Long Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

MetricsSummary

MetricsSummary

Information about metrics summaries.

Contents

FindingsCount

Total number of recommendations found in the code review.

Type: Long Required: No

MeteredLinesOfCodeCount

Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code for a total of 2,725 lines of code.

Type: Long Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RecommendationFeedback

RecommendationFeedback

Information about the recommendation feedback.

Contents

CodeReviewArn

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: No CreatedTimeStamp

The time at which the feedback was created.

Type: Timestamp Required: No LastUpdatedTimeStamp

The time at which the feedback was last updated.

Type: Timestamp Required: No Reactions

List for storing reactions. Reactions are utf-8 text code for emojis. You can send an empty list to clear off all your feedback.

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 1 item.

Valid Values: ThumbsUp | ThumbsDown Required: No

RecommendationId

The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No UserId

The ID of the user that made the API call.

See Also

The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and Access Management User Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RecommendationFeedbackSummary

RecommendationFeedbackSummary

Information about recommendation feedback summaries.

Contents

Reactions

List for storing reactions. Reactions are utf-8 text code for emojis.

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 1 item.

Valid Values: ThumbsUp | ThumbsDown Required: No

RecommendationId

The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No UserId

The ID of the user that gave the feedback.

The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and Access Management User Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RecommendationSummary

RecommendationSummary

Information about recommendations.

Contents

Description

A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line and the end line.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5000.

Required: No EndLine

Last line where the recommendation is applicable in the source commit or source branch. For a single line comment the start line and end line values are the same.

Type: Integer Required: No FilePath

Name of the file on which a recommendation is provided.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

RecommendationCategory The type of a recommendation.

Type: String

Valid Values: AWSBestPractices | AWSCloudFormationIssues | DuplicateCode

| CodeMaintenanceIssues | ConcurrencyIssues | InputValidations |

PythonBestPractices | JavaBestPractices | ResourceLeaks | SecurityIssues | CodeInconsistencies

Required: No RecommendationId

The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No RuleMetadata

Metadata about a rule. Rule metadata includes an ID, a name, a list of tags, and a short and long description. CodeGuru Reviewer uses rules to analyze code. A rule's recommendation is included in analysis results if code is detected that violates the rule.

See Also

Type: RuleMetadata (p. 78) object Required: No

Severity

The severity of the issue in the code that generated this recommendation.

Type: String

Valid Values: Info | Low | Medium | High | Critical Required: No

StartLine

Start line from where the recommendation is applicable in the source commit or source branch.

Type: Integer Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

Repository

Repository

Information about an associated AWS CodeCommit repository or an associated repository that is managed by AWS CodeStar Connections (for example, Bitbucket). This Repository object is not used if your source code is in an associated GitHub repository.

Contents

Bitbucket

Information about a Bitbucket repository.

Type: ThirdPartySourceRepository (p. 85) object Required: No

CodeCommit

Information about an AWS CodeCommit repository.

Type: CodeCommitRepository (p. 49) object Required: No

GitHubEnterpriseServer

Information about a GitHub Enterprise Server repository.

Type: ThirdPartySourceRepository (p. 85) object Required: No

S3Bucket

Information about a repository in an S3 bucket.

Type: S3Repository (p. 81) object Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RepositoryAnalysis

RepositoryAnalysis

A code review type that analyzes all code under a specified branch in an associated repository. The associated repository is specified using its ARN when you call CreateCodeReview.

Contents

RepositoryHead

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

Type: RepositoryHeadSourceCodeType (p. 75) object Required: No

SourceCodeType

Specifies the source code that is analyzed in a code review.

Type: SourceCodeType (p. 83) object Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RepositoryAssociation

RepositoryAssociation

Information about a repository association. The DescribeRepositoryAssociation operation returns a RepositoryAssociation object.

Contents

AssociationArn

The Amazon Resource Name (ARN) identifying the repository association.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: No AssociationId

The ID of the repository association.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No ConnectionArn

The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see Connection in the AWS CodeStar Connections API Reference.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+

Required: No CreatedTimeStamp

The time, in milliseconds since the epoch, when the repository association was created.

Type: Timestamp Required: No KMSKeyDetails

A KMSKeyDetails object that contains:

• The encryption option for this repository association. It is either owned by AWS Key Management Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).

• The ID of the AWS KMS key that is associated with this respository association.

Type: KMSKeyDetails (p. 59) object Required: No

Contents

LastUpdatedTimeStamp

The time, in milliseconds since the epoch, when the repository association was last updated.

Type: Timestamp Required: No Name

The name of the repository.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S[\w.-]*$

Required: No Owner

The owner of the repository. For an AWS CodeCommit repository, this is the AWS 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 AWS account ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S(.*\S)?$

Required: No ProviderType

The provider type of the repository association.

Type: String

Valid Values: CodeCommit | GitHub | Bitbucket | GitHubEnterpriseServer | S3Bucket

Required: No S3RepositoryDetails

Specifies the name of an S3 bucket and a CodeArtifacts object that contains the S3 object keys for a source code .zip file and for a build artifacts .zip file that contains .jar or .class files.

Type: S3RepositoryDetails (p. 82) object Required: No

State

The state of the repository association.

The valid repository association states are:

Associated: The repository association is complete.

Associating: CodeGuru Reviewer is:

• Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.

See Also

NoteIf your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.

• Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.

Failed: The repository failed to associate or disassociate.

Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.

Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in an associated repository with tags after it has been disassociated.

For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.

Type: String

Valid Values: Associated | Associating | Failed | Disassociating | Disassociated

Required: No StateReason

A description of why the repository association is in the current state.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RepositoryAssociationSummary

RepositoryAssociationSummary

Summary information about a repository association. The ListRepositoryAssociations operation returns a list of RepositoryAssociationSummary objects.

Contents

AssociationArn

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: No AssociationId

The repository association ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No ConnectionArn

The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see Connection in the AWS CodeStar Connections API Reference.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+

Required: No LastUpdatedTimeStamp

The time, in milliseconds since the epoch, since the repository association was last updated.

Type: Timestamp Required: No Name

The name of the repository association.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S[\w.-]*$

Contents

Required: No Owner

The owner of the repository. For an AWS CodeCommit repository, this is the AWS 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 AWS account ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S(.*\S)?$

Required: No ProviderType

The provider type of the repository association.

Type: String

Valid Values: CodeCommit | GitHub | Bitbucket | GitHubEnterpriseServer | S3Bucket

Required: No State

The state of the repository association.

The valid repository association states are:

Associated: The repository association is complete.

Associating: CodeGuru Reviewer is:

• Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.

NoteIf your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.

• Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.

Failed: The repository failed to associate or disassociate.

Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.

Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in an associated repository with tags after it has been disassociated.

For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.

Type: String

Valid Values: Associated | Associating | Failed | Disassociating | Disassociated

Required: No

See Also

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RepositoryHeadSourceCodeType

RepositoryHeadSourceCodeType

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

Contents

BranchName

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

RequestMetadata

RequestMetadata

Metadata that is associated with a code review. This applies to both pull request and repository analysis code reviews.

Contents

EventInfo

Information about the event associated with a code review.

Type: EventInfo (p. 58) object Required: No

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.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S(.*\S)?$

Required: No RequestId

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No VendorName

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.

Type: String

Valid Values: GitHub | GitLab | NativeS3 Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

See Also

• AWS SDK for Ruby V3

RuleMetadata

RuleMetadata

Metadata about a rule. Rule metadata includes an ID, a name, a list of tags, and a short and long description. CodeGuru Reviewer uses rules to analyze code. A rule's recommendation is included in analysis results if code is detected that violates the rule.

Contents

LongDescription

A long description of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1000.

Pattern: ^\S(.*\S)?$

Required: No RuleId

The ID of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^\S+\/[a-zA-Z0-9-]+@v\d+\.\d+$

Required: No RuleName

The name of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^\S(.*\S)?$

Required: No RuleTags

Tags that are associated with the rule.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 20 items.

Length Constraints: Minimum length of 1. Maximum length of 50.

Length Constraints: Minimum length of 1. Maximum length of 50.

在文檔中 Amazon CodeGuru Reviewer (頁 63-92)

相關文件