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

Fix scope attribute validation for codebuild webhooks #38513

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

markmullme
Copy link
Contributor

Description

When scope_configuration was added to the aws_codebuild_webhook resource the validation for scopes was incorrectly applied to the domain section. As a result the validation is checking if example.com matches either GITHUB_ORGANIZATION or GITHUB_GLOBAL (which would make sense if applied to scopes instead of domains). Moving the validation line fixes errors like:

│ Error: expected domain to be one of ["GITHUB_ORGANIZATION" "GITHUB_GLOBAL"], got example.com

when using a scope_configuration like:

scope_configuration {                                                                                                                                                                         
  domain = "example.com"
  name   = "my-org-name"
  scope  = "GITHUB_ORGANIZATION"
}

Relations

Relates #38199 (tyvm!)

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_webhook
https://docs.aws.amazon.com/codebuild/latest/userguide/github-global-organization-webhook.html

In the webhook's scope configuration, set the scope to either GITHUB_ORGANIZATION or GITHUB_GLOBAL depending on whether it should be an organization or[ global webhook](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/exploring-user-activity-in-your-enterprise/managing-global-webhooks)

@markmullme markmullme requested a review from a team as a code owner July 24, 2024 16:18
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@terraform-aws-provider terraform-aws-provider bot added service/codebuild Issues and PRs that pertain to the codebuild service. size/XS Managed by automation to categorize the size of a PR. labels Jul 24, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @markmullme 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@jar-b jar-b self-assigned this Jul 24, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jar-b
Copy link
Member

jar-b commented Jul 24, 2024

Thanks for the fix, @markmullme! 👍

@jar-b jar-b merged commit f717e58 into hashicorp:main Jul 24, 2024
31 checks passed
@github-actions github-actions bot added this to the v5.60.0 milestone Jul 24, 2024
Copy link

This functionality has been released in v5.60.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/codebuild Issues and PRs that pertain to the codebuild service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants