feat(codebuild): add support of organization webhook in github source
Issue # (if applicable)
closes #31736
Reason for this change
Currently, the AWS CDK aws-codebuild module lacks native support for creating GitHub organization-level webhooks through the Source construct. Users need to manually use the CfnProject to enable organization webhooks, which adds complexity and inconsistency to the CodeBuild setup. This PR introduces support for creating GitHub organization webhooks directly within the Source construct, streamlining the experience and making it more consistent with the rest of the AWS CDK's high-level constructs.
Description of changes
- Enhanced the
GitHubSourceconstruct in theaws-codebuildmodule to support GitHub organization webhooks. - Updated the
GitHubSourceconstruct's configuration to so when repo is not specified an organization webhook is created. - Added filter of
REPOSITORY_NAMEto FilterGroups.
Description of how you validated changes
- [x] Added unit tests to validate that organization-level webhooks are created correctly when repo is not specified.
- [x] Ran integration tests to ensure that the changes do not break any existing functionality related to project webhooks.
- [x] Tested deployment of a CodeBuild project with organization webhook setup in a sample CDK application to verify end-to-end functionality.
Checklist
- [x] My code adheres to the CONTRIBUTING GUIDE and DESIGN GUIDELINES
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
This is great - any blockers on getting this merged
@dviryamin do you need any help with the failed integ test?
Hi @GavinZZ, Thank you for offering to help! I’ve updated the integration test snapshot with the new default image, so the tests should pass now. I’d really appreciate it if you could take a moment to review the PR when you have time. Looking forward to your feedback!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).
AWS CodeBuild CI Report
- CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
- Commit ID: 12d982547aeddbb7d69e7d5ad2ccbadb6260e06c
- Result: SUCCEEDED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.