Skip to content
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

Open
2 tasks done
colyoonamaz opened this issue Oct 11, 2024 · 4 comments · May be fixed by #31740
Open
2 tasks done
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@colyoonamaz
Copy link

Describe the feature

CodeBuild webhooks in CDK should support the REPOSITORY_NAME/WORKFLOW name filters e.g.

const source = codebuild.Source.gitHub({
      owner: 'owner',
      repo: 'repo',
      webhook: true,
      webhookFilters: [FilterGroup.inEventOf(EventAction.WORKFLOW_JOB_QUEUED).andRepositoryNameIs("repo_name")],
    })

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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.162.1

Environment details (OS name and version, etc.)

Any

@colyoonamaz colyoonamaz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 11, 2024
@github-actions github-actions bot added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Oct 11, 2024
@khushail
Copy link
Contributor

Hi @colyoonamaz , thanks for reaching out.

Is this FR in accordance with this bug reported - #31726

Could you please check and share your insights ?

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 11, 2024
@khushail khushail self-assigned this Oct 11, 2024
@khushail khushail added the effort/medium Medium work item – several days of effort label Oct 12, 2024
@dviryamin
Copy link

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!

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 12, 2024
@khushail
Copy link
Contributor

Thanks @dviryamin for submtting a PR. For guidance/help, you could-

  1. Reach out to CDK.DEV community and ask for help.
  2. Youtube tutorials.
  3. Community posts.

Hope this would be helpful!

@khushail khushail removed their assignment Oct 14, 2024
@colyoonamaz
Copy link
Author

@khushail, #31726 looks like a separate issue, as this is in relation to missing attributes rather than webhook creation failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants