-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_codebuild: REPOSITORY_NAME/WORKFLOW_NAME webhook filters and webhook scope configuration #31736
Comments
Hi @colyoonamaz , thanks for reaching out. Is this FR in accordance with this bug reported - #31726 Could you please check and share your insights ? |
I've submitted a PR that adds support for creating GitHub organization-level webhooks directly in the GitHubSource construct for CodeBuild. However, I'm currently running into issues with building the aws-cdk-lib package locally and could use some help testing this feature. If anyone can assist by setting up a CodeBuild project with the new organization webhook property and verifying that it works as expected, I would greatly appreciate it! Thanks in advance for any help and feedback! |
Thanks @dviryamin for submtting a PR. For guidance/help, you could-
Hope this would be helpful! |
Hi @colyoonamaz, It would be great if you could test it out as well and let me know if it resolves the issue you were facing. I’d really appreciate your feedback! |
@dviryamin could you post a snippet on how to currently get this done configuring the underlying codebuild CfnProject, until your PR is reviewed and merged? |
@shivatalwar I just posted a Gist Post with detailed tutorial |
Comments on closed issues and PRs are hard for our team to see. |
Thanks, marked the issue as completed |
…#31740) ### 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 `GitHubSource` construct in the `aws-codebuild` module to support GitHub organization webhooks. - Updated the `GitHubSource` construct's configuration to so when repo is not specified an organization webhook is created. - Added filter of `REPOSITORY_NAME` to 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](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the feature
CodeBuild webhooks in CDK should support the REPOSITORY_NAME/WORKFLOW name filters e.g.
as these filter types are currently missing (https://docs.aws.amazon.com/codebuild/latest/APIReference/API_WebhookFilter.html). Additionally, there is no option to provide a scope configuration for the webhook in the source (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-scopeconfiguration.html).
Use Case
The REPOSITORY_NAME/WORKFLOW_NAME filters are used to filter out organization/global webhook events, so that the webhook doesn't trigger builds for specific repositories/workflows. Additionally, scope configuration is needed to create an organization or global webhook (https://docs.aws.amazon.com/codebuild/latest/userguide/github-global-organization-webhook.html)
Proposed Solution
Add repository name and workflow name to the list of webhook filters and allow a scope configuration to be provided in the source for the webhook
Other Information
No response
Acknowledgements
CDK version used
2.162.1
Environment details (OS name and version, etc.)
Any
The text was updated successfully, but these errors were encountered: