CodeGuru を使用したレビューワーの例 AWS CLI - AWS Command Line Interface

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

CodeGuru を使用したレビューワーの例 AWS CLI

次のコード例は、 CodeGuru レビュー担当者 AWS Command Line Interface で を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。

アクションはより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には、完全なソースコードへのリンクが含まれています。このリンクには、コンテキスト内でコードをセットアップして実行する方法の手順が記載されています。

トピック

アクション

次のコード例は、associate-repository を使用する方法を示しています。

AWS CLI

例 1: Bitbucket リポジトリの関連付けを作成するには

次のassociate-repository例では、既存の Bitbucket リポジトリを使用してリポジトリの関連付けを作成します。

aws codeguru-reviewer associate-repository \ --repository 'Bitbucket={Owner=sample-owner, Name=mySampleRepo, ConnectionArn=arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 }'

出力:

{ "RepositoryAssociation": { "ProviderType": "Bitbucket", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596216896.979, "AssociationId": "association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "State": "Associating", "StateReason": "Pending Repository Association", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で Bitbucket リポジトリの関連付けを作成する CodeGuru 」を参照してください。

例 2: GitHub Enterprise リポジトリの関連付けを作成するには

次のassociate-repository例では、既存の GitHub Enterprise リポジトリを使用してリポジトリの関連付けを作成します。

aws codeguru-reviewer associate-repository \ --repository 'GitHubEnterpriseServer={Owner=sample-owner, Name=mySampleRepo, ConnectionArn=arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 }'

出力:

{ "RepositoryAssociation": { "ProviderType": "GitHubEnterpriseServer", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596216896.979, "AssociationId": "association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "State": "Associating", "StateReason": "Pending Repository Association", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner" } }

詳細については、「Amazon Codeguru CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で GitHub Enterprise Server リポジトリの関連付けを作成する」を参照してください。

例 3: AWS CodeCommit リポジトリの関連付けを作成するには

次のassociate-repository例では、既存のリポジトリを使用して AWS CodeCommit リポジトリの関連付けを作成します。

aws codeguru-reviewer associate-repository \ --repository CodeCommit={Name=mySampleRepo}

出力:

{ "RepositoryAssociation": { "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "My-ecs-beta-repo", "LastUpdatedTimeStamp": 1595634764.029, "ProviderType": "CodeCommit", "CreatedTimeStamp": 1595634764.029, "Owner": "544120495673", "State": "Associating", "StateReason": "Pending Repository Association", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:544120495673:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で AWS CodeCommit リポジトリの関連付けを作成する CodeGuru 」を参照してください。

  • API 詳細については、「 コマンドリファレンスAssociateRepository」の「」を参照してください。 AWS CLI

次の例は、create-code-review を使用する方法を説明しています。

AWS CLI

コードレビューを作成するには。

次に、 という名前の AWS CodeCommit リポジトリの mainline ブランチにコードのレビューcreate-code-reviewを作成しますmy-repository-name

aws codeguru-reviewer create-code-review \ --name my-code-review \ --repository-association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ --type '{"RepositoryAnalysis": {"RepositoryHead": {"BranchName": "mainline"}}}'

出力:

{ "CodeReview": { "Name": "my-code-review", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222:code-review:RepositoryAnalysis-my-code-review", "RepositoryName": "my-repository-name", "Owner": "123456789012", "ProviderType": "CodeCommit", "State": "Pending", "StateReason": "CodeGuru Reviewer has received the request, and a code review is scheduled.", "CreatedTimeStamp": 1618873489.195, "LastUpdatedTimeStamp": 1618873489.195, "Type": "RepositoryAnalysis", "SourceCodeType": { "RepositoryHead": { "BranchName": "mainline" } }, "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer でコードレビューを作成する CodeGuru 」を参照してください。

  • API 詳細については、「 コマンドリファレンスCreateCodeReview」の「」を参照してください。 AWS CLI

次の例は、describe-code-review を使用する方法を説明しています。

AWS CLI

コードレビューの詳細を一覧表示します。

以下に、「」という名前の AWS CodeCommit リポジトリの「mainline」ブランチにあるコードのレビューに関する情報describe-code-reviewを示しますmy-repo-name。

aws codeguru-reviewer put-recommendation-feedback \ --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb \ --reactions ThumbsUp

出力

{ "CodeReview": { "Name": "My-ecs-beta-repo-master-xs6di4kfd4j269dz", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222:code-review:RepositoryAnalysis-my-repo-name", "RepositoryName": "My-ecs-beta-repo", "Owner": "123456789012", "ProviderType": "CodeCommit", "State": "Pending", "StateReason": "CodeGuru Reviewer is reviewing the source code.", "CreatedTimeStamp": 1618874226.226, "LastUpdatedTimeStamp": 1618874233.689, "Type": "RepositoryAnalysis", "SourceCodeType": { "RepositoryHead": { "BranchName": "mainline" } }, "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } }

詳細については、「Amazon Reviewer ユーザーガイド」の「コードレビューの詳細を表示する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスDescribeCodeReview」の「」を参照してください。 AWS CLI

次の例は、describe-recommendation-feedback を使用する方法を説明しています。

AWS CLI

レコメンデーションに関するフィードバックに関する情報を表示するには

以下は、レコメンデーションに関するフィードバックに関する情報describe-recommendation-feedbackです。このレコメンデーションには 1 つのThumbsUpリアクションがあります。

aws codeguru-reviewer describe-recommendation-feedback \ --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb

出力:

{ "RecommendationFeedback": { "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678", "RecommendationId": "3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb", "Reactions": [ "ThumbsUp" ], "UserId": "aws-user-id", "CreatedTimeStamp": 1618877070.313, "LastUpdatedTimeStamp": 1618877948.881 } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レコメンデーションを表示してフィードバックを提供する」および「ステップ 4: フィードバックを提供する」を参照してください。

次の例は、describe-repository-association を使用する方法を説明しています。

AWS CLI

例 1: GitHub リポジトリの関連付けに関する情報を返すには

次のdescribe-repository-association例では、 GitHub Enterprise リポジトリを使用し、 Associated状態にあるリポジトリの関連付けに関する情報を返します。

aws codeguru-reviewer describe-repository-association \ --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "RepositoryAssociation": { "AssociationId": "b822717e-0711-4e8a-bada-0e738289c75e", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1588102637.649, "ProviderType": "GitHub", "CreatedTimeStamp": 1588102615.636, "Owner": "sample-owner", "State": "Associated", "StateReason": "Pull Request Notification configuration successful", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で GitHub Enterprise Server リポジトリの関連付けを作成する CodeGuru 」を参照してください。

例 2: 失敗したリポジトリの関連付けに関する情報を返すには

次のdescribe-repository-association例では、 GitHub Enterprise リポジトリを使用し、 Failed状態にあるリポジトリの関連付けに関する情報を返します。

aws codeguru-reviewer describe-repository-association \ --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "RepositoryAssociation": { "ProviderType": "GitHubEnterpriseServer", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596217036.892, "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "State": "Failed", "StateReason": "Failed, Please retry.", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "sample-owner" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で GitHub Enterprise Server リポジトリの関連付けを作成する CodeGuru 」を参照してください。

例 3: リポジトリの関連付けの関連付け解除に関する情報を返すには

次のdescribe-repository-association例では、 GitHub Enterprise リポジトリを使用し、 Disassociating状態にあるリポジトリの関連付けに関する情報を返します。

aws codeguru-reviewer describe-repository-association \ --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "RepositoryAssociation": { "ProviderType": "GitHubEnterpriseServer", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596217036.892, "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "State": "Disassociating", "StateReason": "Source code access removal in progress", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "sample-owner" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「Amazon Reviewer で GitHub Enterprise Server リポジトリの関連付けを作成する CodeGuru 」を参照してください。

次の例は、disassociate-repository を使用する方法を説明しています。

AWS CLI

リポジトリの関連付けを解除するには

次のdisassociate-repository例では、 リポジトリを使用している AWS CodeCommit リポジトリの関連付けを解除します。

aws codeguru-reviewer disassociate-repository \ --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "RepositoryAssociation": { "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "my-repository", "Owner": "123456789012", "ProviderType": "CodeCommit", "State": "Disassociating", "LastUpdatedTimeStamp": 1618939174.759, "CreatedTimeStamp": 1595636947.096 }, "Tags": { "Status": "Secret", "Team": "Saanvi" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レビューワーのリポジトリの関連付けを解除する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスDisassociateRepository」の「」を参照してください。 AWS CLI

次の例は、list-code-reviews を使用する方法を説明しています。

AWS CLI

過去 90 日間に AWS アカウントで作成されたコードレビューを一覧表示するには。

次のlist-code-reviews例では、プルリクエストを使用して過去 90 日間に作成されたコードレビューを一覧表示します。

aws codeguru-reviewer list-code-reviews \ --type PullRequest

出力:

{ "CodeReviewSummaries": [ { "LastUpdatedTimeStamp": 1588897288.054, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProviderType": "GitHub", "PullRequestId": "5", "MetricsSummary": { "MeteredLinesOfCodeCount": 24, "FindingsCount": 1 }, "CreatedTimeStamp": 1588897068.512, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588869793.263, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProviderType": "GitHub", "PullRequestId": "4", "MetricsSummary": { "MeteredLinesOfCodeCount": 29, "FindingsCount": 0 }, "CreatedTimeStamp": 1588869575.949, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588870511.211, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "ProviderType": "GitHub", "PullRequestId": "4", "MetricsSummary": { "MeteredLinesOfCodeCount": 2, "FindingsCount": 0 }, "CreatedTimeStamp": 1588870292.425, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588118522.452, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "ProviderType": "GitHub", "PullRequestId": "3", "MetricsSummary": { "MeteredLinesOfCodeCount": 29, "FindingsCount": 0 }, "CreatedTimeStamp": 1588118301.131, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588112205.207, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "ProviderType": "GitHub", "PullRequestId": "2", "MetricsSummary": { "MeteredLinesOfCodeCount": 25, "FindingsCount": 0 }, "CreatedTimeStamp": 1588111987.443, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588104489.981, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "ProviderType": "GitHub", "PullRequestId": "1", "MetricsSummary": { "MeteredLinesOfCodeCount": 25, "FindingsCount": 0 }, "CreatedTimeStamp": 1588104270.223, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" } ] }

詳細については、「Amazon Reviewer ユーザーガイド」の「すべてのコードレビューを表示する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスListCodeReviews」の「」を参照してください。 AWS CLI

次のコード例は、list-recommendation-feedback を使用する方法を示しています。

AWS CLI

関連付けられたリポジトリのレコメンデーションに関する顧客レコメンデーションのフィードバックを表示するには

以下はlist-recommendation-feedback、コードレビューに関するすべてのレコメンデーションに関するお客様からのフィードバックの一覧です。このコードレビューには、お客様からの「」というフィードバックが 1 ThumbsUpつあります。

aws codeguru-reviewer list-recommendation-feedback \ --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678

出力:

{ "RecommendationFeedbackSummaries": [ { "RecommendationId": "3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb", "Reactions": [ "ThumbsUp" ], "UserId": "aws-user-id" } ] }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「ステップ 4: フィードバックを提供する」を参照してください。

  • API 詳細については、「 コマンドリファレンスListRecommendationFeedback」の「」を参照してください。 AWS CLI

次のコード例は、list-recommendations を使用する方法を示しています。

AWS CLI

完了したコードレビューのレコメンデーションを一覧表示するには

次のlist-recommendations例では、完了したコードレビューの推奨事項を一覧表示します。このコードレビューには 1 つのレコメンデーションがあります。

aws codeguru-reviewer list-recommendations \ --code-review-arn arn:aws:codeguru-reviewer:us-west-2:544120495673:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "RecommendationSummaries": [ { "Description": "\n\n**Problem** \n You are using a `ConcurrentHashMap`, but your usage of `containsKey()` and `get()` may not be thread-safe at lines: **63 and 64**. In between the check and the `get()` another thread can remove the key and the `get()` will return `null`. The remove that can remove the key is at line: **59**.\n\n**Fix** \n Consider calling `get()`, checking instead of your current check if the returned object is `null`, and then using that object only, without calling `get()` again.\n\n**More info** \n [View an example on GitHub](https://github.com/apache/hadoop/blob/f16cf877e565084c66bc63605659b157c4394dc8/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3Guard.java#L302-L304) (external link).", "RecommendationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "StartLine": 63, "EndLine": 64, "FilePath": "src/main/java/com/company/sample/application/CreateOrderThread.java" } ] }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「ステップ 4: フィードバックを提供する」を参照してください。

  • API 詳細については、「 コマンドリファレンスListRecommendations」の「」を参照してください。 AWS CLI

次のコード例は、list-repository-associations を使用する方法を示しています。

AWS CLI

AWS アカウントのリポジトリの関連付けを一覧表示するには

次のlist-repository-associations例では、アカウント内のリポジトリの関連付けの概要オブジェクトのリストを返します。返されたリストは、ProviderType、、NameStateおよび でフィルタリングできますOwner

aws codeguru-reviewer list-repository-associations

出力:

{ "RepositoryAssociationSummaries": [ { "LastUpdatedTimeStamp": 1595886609.616, "Name": "test", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProviderType": "Bitbucket" }, { "LastUpdatedTimeStamp": 1595636969.035, "Name": "CodeDeploy-CodePipeline-ECS-Tutorial", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1595634785.983, "Name": "My-ecs-beta-repo", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1590712811.77, "Name": "MyTestCodeCommit", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1588102637.649, "Name": "aws-codeguru-profiler-sample-application", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "ProviderType": "GitHub" }, { "LastUpdatedTimeStamp": 1588028233.995, "Name": "codeguru-profiler-demo-app", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "ProviderType": "GitHub" } ] }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レビューワーですべてのリポジトリの関連付けを表示する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスListRepositoryAssociations」の「」を参照してください。 AWS CLI

次の例は、list-tags-for-resource を使用する方法を説明しています。

AWS CLI

関連付けられたリポジトリのタグを一覧表示するには

以下に、関連付けられたリポジトリのタグlist-tags-for-resourceを示します。この関連付けられたリポジトリには 2 つのタグがあります。

aws codeguru-reviewer list-tags-for-resource \ --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "Tags": { "Status": "Secret", "Team": "Saanvi" } }

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レビューワーに関連付けられたリポジトリ (AWS CLI) のタグを表示する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスListTagsForResource」の「」を参照してください。 AWS CLI

次の例は、put-recommendation-feedback を使用する方法を説明しています。

AWS CLI

コードレビューにレコメンデーションを追加するには

以下にput-recommendation-feedback、コードレビューに関するThumbsUp推奨事項を示します。

aws codeguru-reviewer put-recommendation-feedback \ --code-review-arn \arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb \ --reactions ThumbsUp

このコマンドでは何も出力されません。

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「ステップ 4: フィードバックを提供する」を参照してください。

  • API 詳細については、「 コマンドリファレンスPutRecommendationFeedback」の「」を参照してください。 AWS CLI

次の例は、tag-resource を使用する方法を説明しています。

AWS CLI

関連付けられたリポジトリにタグを追加するには

次に、関連付けられたリポジトリに 2 つのタグtag-resourceを追加します。

aws codeguru-reviewer tag-resource \ --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ --tags Status=Secret,Team=Saanvi

このコマンドでは何も出力されません。

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レビューワーに関連付けられたリポジトリにタグを追加する (AWS CLI)」および CodeGuru 「レビューワーに関連付けられたリポジトリのタグを追加または更新する (AWS CLI)」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスTagResource」の「」を参照してください。 AWS CLI

次のコード例は、untag-resource を使用する方法を示しています。

AWS CLI

関連付けられたリポジトリのタグを解除するには

以下では、キー「Secret」と「Team」を含む 2 つのタグを、関連付けられたリポジトリuntag-resourceから削除します。

aws codeguru-reviewer untag-resource \ --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ --tag-keys Status Team

このコマンドでは何も出力されません。

詳細については、「Amazon CodeGuru Reviewer ユーザーガイド」の「レビューワーに関連付けられたリポジトリ (AWS CLI) からタグを削除する」を参照してください。 CodeGuru

  • API 詳細については、「 コマンドリファレンスUntagResource」の「」を参照してください。 AWS CLI