-
Notifications
You must be signed in to change notification settings - Fork 762
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
Provide "require signed commits" on github_branch_protection
#214
Provide "require signed commits" on github_branch_protection
#214
Conversation
fb80993
to
eaa247d
Compare
github_branch_protection
github_branch_protection
This commit provides changing the toggle to require signed commits on branch protection. The [API for signed commits](https://developer.github.com/v3/repos/branches/#get-required-signatures-of-protected-branch) is separate endpoint from the branch protection url, and does not come on the same payload. This means that we need to make an extra request to read and modify it. This changes requires `go-github` at least v19. Need: - [ ] Update `go-github` version: https://github.com/terraform-providers/terraform-provider-github/pull/207 - [ ] Provide default required reviewers count to avoid GitHub update error: https://github.com/terraform-providers/terraform-provider-github/pull/211 Closes https://github.com/terraform-providers/terraform-provider-github/issues/87
@paultyng I've updated this PR to use the latest changes recently landed on |
@bltavares would it be possible to add acceptance test coverage and docs for this? |
I'm not used to acceptance tests on Terraform. Should I include it on the current branch protection test, or create a new one? |
@bltavares adding to the existing one is probably fine if you don't think there is a reason to have an additional test. I'm not sure what the API interactions look like and if it would be useful to have tests turning it on and off, etc. |
@paultyng I've changed the test to create the signed commit requirement, then remove it, as well as documentation. Let me know if they are good enough. |
Hey folks, any update on this? From my perspective, automating the branch protection rules is the most fiddly thing to standardise in the UI and we're very keen to add the signed_commit stuff to our internal state management as well 👍 We're not so au-fait with terraform provider dev but please let me know if any help is needed to get this over the line 🎉 |
@bltavares @tobypinder we're reviewing it this week. Thank you for being patient with us! |
Weird, as of today the official docs regarding the resource |
@maelvls it looks like the documentation updated landed on a different resource. Mention me on any PRs that would fix the documentation flow for you in this use case. |
…rations#214) * Provide "require signed commits" on `github_branch_protection` This commit provides changing the toggle to require signed commits on branch protection. The [API for signed commits](https://developer.github.com/v3/repos/branches/#get-required-signatures-of-protected-branch) is separate endpoint from the branch protection url, and does not come on the same payload. This means that we need to make an extra request to read and modify it. This changes requires `go-github` at least v19. Need: - [ ] Update `go-github` version: https://github.com/terraform-providers/terraform-provider-github/pull/207 - [ ] Provide default required reviewers count to avoid GitHub update error: https://github.com/terraform-providers/terraform-provider-github/pull/211 Closes https://github.com/terraform-providers/terraform-provider-github/issues/87 * Include tests * Adds documentation
This commit provides changing the toggle to require signed commits on branch protection.
The API for signed commits is separate endpoint from the branch protection url, and does not come on the same payload. This means that we need to make an extra request to read and modify it.
Closes https://github.com/terraform-providers/terraform-provider-github/issues/87