PostCommentForComparedCommit - AWS CodeCommit

PostCommentForComparedCommit

Posts a comment on the comparison between two commits.

Request Syntax

{ "afterCommitId": "string", "beforeCommitId": "string", "clientRequestToken": "string", "content": "string", "location": { "filePath": "string", "filePosition": number, "relativeFileVersion": "string" }, "repositoryName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

afterCommitId

To establish the directionality of the comparison, the full commit ID of the after commit.

Type: String

Required: Yes

beforeCommitId

To establish the directionality of the comparison, the full commit ID of the before commit. Required for commenting on any commit unless that commit is the initial commit.

Type: String

Required: No

clientRequestToken

A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

Type: String

Required: No

content

The content of the comment you want to make.

Type: String

Required: Yes

location

The location of the comparison where you want to comment.

Type: Location object

Required: No

repositoryName

The name of the repository where you want to post a comment on the comparison between commits.

Type: String

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

Pattern: [\w\.-]+

Required: Yes

Response Syntax

{ "afterBlobId": "string", "afterCommitId": "string", "beforeBlobId": "string", "beforeCommitId": "string", "comment": { "authorArn": "string", "callerReactions": [ "string" ], "clientRequestToken": "string", "commentId": "string", "content": "string", "creationDate": number, "deleted": boolean, "inReplyTo": "string", "lastModifiedDate": number, "reactionCounts": { "string" : number } }, "location": { "filePath": "string", "filePosition": number, "relativeFileVersion": "string" }, "repositoryName": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

afterBlobId

In the directionality you established, the blob ID of the after blob.

Type: String

afterCommitId

In the directionality you established, the full commit ID of the after commit.

Type: String

beforeBlobId

In the directionality you established, the blob ID of the before blob.

Type: String

beforeCommitId

In the directionality you established, the full commit ID of the before commit.

Type: String

comment

The content of the comment you posted.

Type: Comment object

location

The location of the comment in the comparison between the two commits.

Type: Location object

repositoryName

The name of the repository where you posted a comment on the comparison between commits.

Type: String

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

Pattern: [\w\.-]+

Errors

For information about the errors that are common to all actions, see Common Errors.

BeforeCommitIdAndAfterCommitIdAreSameException

The before commit ID and the after commit ID are the same, which is not valid. The before commit ID and the after commit ID must be different commit IDs.

HTTP Status Code: 400

ClientRequestTokenRequiredException

A client request token is required. A client request token is an unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

HTTP Status Code: 400

CommentContentRequiredException

The comment is empty. You must provide some content for a comment. The content cannot be null.

HTTP Status Code: 400

CommentContentSizeLimitExceededException

The comment is too large. Comments are limited to 10,240 characters.

HTTP Status Code: 400

CommitDoesNotExistException

The specified commit does not exist or no commit was specified, and the specified repository has no default branch.

HTTP Status Code: 400

CommitIdRequiredException

A commit ID was not specified.

HTTP Status Code: 400

EncryptionIntegrityChecksFailedException

An encryption integrity check failed.

HTTP Status Code: 500

EncryptionKeyAccessDeniedException

An encryption key could not be accessed.

HTTP Status Code: 400

EncryptionKeyDisabledException

The encryption key is disabled.

HTTP Status Code: 400

EncryptionKeyNotFoundException

No encryption key was found.

HTTP Status Code: 400

EncryptionKeyUnavailableException

The encryption key is not available.

HTTP Status Code: 400

IdempotencyParameterMismatchException

The client request token is not valid. Either the token is not in a valid format, or the token has been used in a previous request and cannot be reused.

HTTP Status Code: 400

InvalidClientRequestTokenException

The client request token is not valid.

HTTP Status Code: 400

InvalidCommitIdException

The specified commit ID is not valid.

HTTP Status Code: 400

InvalidFileLocationException

The location of the file is not valid. Make sure that you include the file name and extension.

HTTP Status Code: 400

InvalidFilePositionException

The position is not valid. Make sure that the line number exists in the version of the file you want to comment on.

HTTP Status Code: 400

InvalidPathException

The specified path is not valid.

HTTP Status Code: 400

InvalidRelativeFileVersionEnumException

Either the enum is not in a valid format, or the specified file version enum is not valid in respect to the current file version.

HTTP Status Code: 400

InvalidRepositoryNameException

A specified repository name is not valid.

Note

This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.

HTTP Status Code: 400

PathDoesNotExistException

The specified path does not exist.

HTTP Status Code: 400

PathRequiredException

The folderPath for a location cannot be null.

HTTP Status Code: 400

PathRequiredException

The folderPath for a location cannot be null.

HTTP Status Code: 400

RepositoryDoesNotExistException

The specified repository does not exist.

HTTP Status Code: 400

RepositoryNameRequiredException

A repository name is required, but was not specified.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of PostCommentForComparedCommit.

Sample Request

>POST / HTTP/1.1 Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 350 X-Amz-Target: CodeCommit_20150413.PostCommentForComparedCommit X-Amz-Date: 20171025T132023Z User-Agent: aws-cli/1.11.187 Python/2.7.9 Windows/8 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20171025/us-east-1/codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE { "afterCommitId": "317f8570EXAMPLE", "beforeCommitId": "6e147360EXAMPLE", "clientRequestToken": "123Example", "content": "Can you add a test case for this?", "location": { "filePath": "cl_sample.js", "filePosition": 1232, "relativeFileVersion": "AFTER" }, "repositoryName": "MyDemoRepo" }

Sample Response

{ "afterBlobId": "1f330709EXAMPLE", "afterCommitId": "317f8570EXAMPLE", "beforeBlobId": "80906a4cEXAMPLE", "beforeCommitId": "6e147360EXAMPLE", "comment": { "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", "clientRequestToken": "", "commentId": "553b509bEXAMPLE56198325", "content": "Can you add a test case for this?", "creationDate": 1508369612.203, "deleted": false, "commentId": "abc123-EXAMPLE", "lastModifiedDate": 1508369612.203, "callerReactions": [], "reactionCounts": [] }, "location": { "filePath": "cl_sample.js", "filePosition": 1232, "relativeFileVersion": "AFTER" }, "repositoryName": "MyDemoRepo" }

See Also

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