
Ultimate access to all questions.
A development team utilizes AWS CodeCommit for version control, AWS CodePipeline, AWS CodeBuild, and AWS CodeDeploy for their CI/CD infrastructure. Recently, they merged pull requests in CodeCommit without ensuring they passed long-running tests, leading to rollbacks and wasted effort. To prevent this in the future, a DevOps engineer needs to automate the testing of pull requests in CodeCommit so that reviewers can easily view the results of these automated tests during the review process. What solution should the DevOps engineer implement to achieve this?
A
Create an Amazon EventBridge rule that reacts to the pullRequestStatusChanged event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild badge as a comment on the pull request so that developers will see the badge in their code review.
B
Create an Amazon EventBridge rule that reacts to the pullRequestCreated event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild test results as a comment on the pull request when the test results are complete.
C
Create an Amazon EventBridge rule that reacts to pullRequestCreated and pullRequestSourceBranchUpdated events. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild badge as a comment on the pull request so that developers will see the badge in their code review.
D
Create an Amazon EventBridge rule that reacts to the pullRequestStatusChanged event. Create an AWS Lambda function that invokes a CodePipeline pipeline with a CodeBuild action that runs the tests for the application. Program the Lambda function to post the CodeBuild test results as a comment on the pull request when the test results are complete.