Q: 19
A development team uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild to develop
and deploy an application. Changes to the code are submitted by pull requests. The development
team reviews and merges the pull requests, and then the pipeline builds and tests the application.
Over time, the number of pull requests has increased. The pipeline is frequently blocked because of
failing tests. To prevent this blockage, the development team wants to run the unit and integration
tests on each pull request before it is merged.
Which solution will meet these requirements?
Options
Discussion
Option B
B makes sense here since it hooks into the pullRequestCreated event using EventBridge, then triggers CodeBuild for testing. That way, you automatically run tests before merges, which is what they want. D looks tempting but notification rules just send messages, they don't directly invoke builds. Pretty sure B is right on this one but open to other ideas if I've missed something.
C or D. Both seem to let you run tests before merging, and I think some practice exams mention similar setups using notification rules for pre-merge checks. Worth reviewing the official AWS guide on CodeCommit integrations just to make sure.
C/D? Notification rules (D) can send messages but only trigger CodeBuild if you wire up extra Lambda or step functions. EventBridge in B can directly invoke builds on pullRequestCreated, which fits what AWS recommends for pre-merge checks. From what I've seen, B is technically more correct here, unless there's a recent update to how notification rules are handled. Anyone spot a catch I'm missing?
A is wrong, D. The notification rule can fire on pull request creation or updates and trigger CodeBuild for tests, which should help prevent those merge blockages before code gets in. Not 100% sure since EventBridge is also commonly used, but D seems to fit the flow.
B is wrong, D. If the requirement was about the best way to enforce pre-merge tests (like a gating rule), would that change which AWS service or method you'd pick? The official guide covers this distinction.
Be respectful. No spam.