-
Notifications
You must be signed in to change notification settings - Fork 764
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
Include required review count #211
Include required review count #211
Conversation
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Update imports as go-github converted to using modules starting with v18. Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
This commit includes the `required_approving_review_count` field on the `github_branch_protection` resource, allowing to manage the miminum amount of reviewers to allow a merge to happen. This field must be between 1 - 6, according to the docs, and must be valid if present. Bumping the `go-github` to `v24` made it default to `0` when not present, causing the followin error <detail> <summary>GitHub API error when count is 0</summary> ``` 422 Invalid request. No subschema in "anyOf" matched. 0 must be greater than or equal to 1. Not all subschemas of "allOf" matched. For 'anyOf/1', {"dismissal_restrictions"=>{"users"=>[], "teams"=>[]}, "dismiss_stale_reviews"=>false, "require_code_owner_reviews"=>true, "required_approving_review_count"=>0} is not a null. [] Payload: { "required_status_checks": { "strict": true, "contexts": [ "lint", "test" ] }, "required_pull_request_reviews": { "dismissal_restrictions": { "users": [], "teams": [] }, "dismiss_stale_reviews": false, "require_code_owner_reviews": true, "required_approving_review_count": 0 }, "enforce_admins": true, "restrictions": null } ``` </detail> This PR is important when upgrading `go-github`. Built on top of: https://github.com/terraform-providers/terraform-provider-github/pull/207
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
@apparentlymart sorry to bother here. This change is important to include on I've opened a PR (https://github.com/terraform-providers/terraform-provider-github/pull/213) against |
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
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
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
|
* 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 includes the
required_approving_review_count
field on thegithub_branch_protection
resource, allowing to manage the miminumamount of reviewers to allow a merge to happen.
This field must be between 1 - 6, according to the docs, and must be
valid if present.
Bumping the
go-github
tov24
made it default to0
when notpresent, causing the followin error
GitHub API error when count is 0
This PR is important when upgrading
go-github
.Built on top of: #207