Architecture to integrate git repositories with AWS services via webhook to validate pull-requests for code reviews and coverage quality.
For every pull-request and consecutive commits on PR, github webhkook will trigger an API gateway which is bound to a lambda where the payload will be extracted and a codebuild will be triggered which will save the test and coverage reports as part of codebuild report groups and a cloudwatch event will trigger another lambda on build completion to update PR commit staus and post a comment with metrics.
- Create two lambdas - pre-pr-build-lambda and post-pr-build-lambda (override necessary config values inside).
- Create a codebuild enabled with report groups.
- Create a cloudwatch event to trigger post-pr-build-lambda
- Create an API Gateway mapped to pre-pr-build-lambda
- Configure Github repo webhook with API Gateway URL and the secret key used inside pre-pr-build-lambda
Happy coding :) !!