-
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
Add github_organization_block resource #181
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
added
the
size/XXL
label
Jan 30, 2019
This is based on the v0.12 upgrade branch. |
paultyng
force-pushed
the
paultyng/blocks
branch
from
April 25, 2019 17:24
2a64e3a
to
3939306
Compare
This comment has been minimized.
This comment has been minimized.
Breaking changes to schema in this commit include: * github_organization_webhook.name removed * github_repository_webhook.name removed
This comment has been minimized.
This comment has been minimized.
@bltavares I've included a number of your fixes in here as well, tests are all green. I had to go to v25 due to a bug in the organization hook calls. |
mbfrahry
approved these changes
May 2, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor changes
After bumping to go-github v24, a couple of signatures have changed. One of them, the `name` on `webhooks` has been removed. Previously, the only valid name was `web`, and now, it has been removed from the object. This commit is a breaking change on the provider, as it will not accept more taking `name` on the webhook resources.
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
$ make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -timeout 120m
? github.com/terraform-providers/terraform-provider-github [no test files]
=== RUN TestAccGithubIpRangesDataSource_existing
--- PASS: TestAccGithubIpRangesDataSource_existing (0.56s)
=== RUN TestAccGithubRepositoriesDataSource_basic
--- PASS: TestAccGithubRepositoriesDataSource_basic (5.29s)
=== RUN TestAccGithubRepositoriesDataSource_noMatch
--- PASS: TestAccGithubRepositoriesDataSource_noMatch (0.51s)
=== RUN TestAccGithubRepositoryDataSource_fullName_noMatchReturnsError
--- PASS: TestAccGithubRepositoryDataSource_fullName_noMatchReturnsError (0.10s)
=== RUN TestAccGithubRepositoryDataSource_name_noMatchReturnsError
--- PASS: TestAccGithubRepositoryDataSource_name_noMatchReturnsError (0.14s)
=== RUN TestAccGithubRepositoryDataSource_fullName_existing
--- PASS: TestAccGithubRepositoryDataSource_fullName_existing (1.41s)
=== RUN TestAccGithubRepositoryDataSource_name_existing
--- PASS: TestAccGithubRepositoryDataSource_name_existing (0.80s)
=== RUN TestAccGithubTeamDataSource_noMatchReturnsError
--- PASS: TestAccGithubTeamDataSource_noMatchReturnsError (0.14s)
=== RUN TestAccGithubUserDataSource_noMatchReturnsError
--- PASS: TestAccGithubUserDataSource_noMatchReturnsError (0.08s)
=== RUN TestAccGithubUserDataSource_existing
--- PASS: TestAccGithubUserDataSource_existing (2.45s)
=== RUN TestMigrateGithubWebhookStateV0toV1
--- PASS: TestMigrateGithubWebhookStateV0toV1 (0.00s)
=== RUN TestProvider
--- PASS: TestProvider (0.00s)
=== RUN TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN TestProvider_insecure
--- PASS: TestProvider_insecure (0.12s)
=== RUN TestAccGithubBranchProtection_basic
--- PASS: TestAccGithubBranchProtection_basic (13.49s)
=== RUN TestAccGithubBranchProtection_teams
--- PASS: TestAccGithubBranchProtection_teams (41.36s)
=== RUN TestAccGithubBranchProtection_emptyItems
--- PASS: TestAccGithubBranchProtection_emptyItems (8.60s)
=== RUN TestAccGithubBranchProtection_importBasic
--- PASS: TestAccGithubBranchProtection_importBasic (9.04s)
=== RUN TestAccGithubIssueLabel_basic
--- PASS: TestAccGithubIssueLabel_basic (9.59s)
=== RUN TestAccGithubIssueLabel_existingLabel
--- PASS: TestAccGithubIssueLabel_existingLabel (8.27s)
=== RUN TestAccGithubIssueLabel_importBasic
--- PASS: TestAccGithubIssueLabel_importBasic (8.81s)
=== RUN TestAccGithubIssueLabel_description
--- PASS: TestAccGithubIssueLabel_description (17.29s)
=== RUN TestAccGithubMembership_basic
--- PASS: TestAccGithubMembership_basic (3.50s)
=== RUN TestAccGithubMembership_importBasic
--- PASS: TestAccGithubMembership_importBasic (3.07s)
=== RUN TestAccGithubOrganizationProject_basic
--- PASS: TestAccGithubOrganizationProject_basic (3.48s)
=== RUN TestAccGithubOrganizationProject_importBasic
--- PASS: TestAccGithubOrganizationProject_importBasic (3.49s)
=== RUN TestAccGithubOrganizationWebhook_basic
--- PASS: TestAccGithubOrganizationWebhook_basic (4.38s)
=== RUN TestAccGithubOrganizationWebhook_secret
--- PASS: TestAccGithubOrganizationWebhook_secret (2.89s)
=== RUN TestAccGithubProjectColumn_basic
--- PASS: TestAccGithubProjectColumn_basic (8.64s)
=== RUN TestAccGithubProjectColumn_importBasic
--- PASS: TestAccGithubProjectColumn_importBasic (7.07s)
=== RUN TestAccGithubRepositoryCollaborator_basic
--- PASS: TestAccGithubRepositoryCollaborator_basic (9.28s)
=== RUN TestAccGithubRepositoryCollaborator_importBasic
--- PASS: TestAccGithubRepositoryCollaborator_importBasic (9.32s)
=== RUN TestSuppressDeployKeyDiff
--- PASS: TestSuppressDeployKeyDiff (0.00s)
=== RUN TestAccGithubRepositoryDeployKey_basic
--- PASS: TestAccGithubRepositoryDeployKey_basic (11.97s)
=== RUN TestAccGithubRepositoryDeployKey_importBasic
--- PASS: TestAccGithubRepositoryDeployKey_importBasic (8.24s)
=== RUN TestAccGithubRepositoryProject_basic
--- PASS: TestAccGithubRepositoryProject_basic (8.93s)
=== RUN TestAccGithubRepositoryProject_importBasic
--- PASS: TestAccGithubRepositoryProject_importBasic (8.83s)
=== RUN TestAccGithubRepository_basic
--- PASS: TestAccGithubRepository_basic (7.77s)
=== RUN TestAccGithubRepository_archive
--- PASS: TestAccGithubRepository_archive (6.54s)
=== RUN TestAccGithubRepository_archiveUpdate
--- PASS: TestAccGithubRepository_archiveUpdate (9.84s)
=== RUN TestAccGithubRepository_importBasic
--- PASS: TestAccGithubRepository_importBasic (5.78s)
=== RUN TestAccGithubRepository_defaultBranch
--- PASS: TestAccGithubRepository_defaultBranch (10.34s)
=== RUN TestAccGithubRepository_templates
--- PASS: TestAccGithubRepository_templates (6.45s)
=== RUN TestAccGithubRepository_topics
--- PASS: TestAccGithubRepository_topics (16.26s)
=== RUN TestAccGithubRepository_autoInitForceNew
--- PASS: TestAccGithubRepository_autoInitForceNew (16.48s)
=== RUN TestAccGithubRepositoryWebhook_basic
--- PASS: TestAccGithubRepositoryWebhook_basic (11.07s)
=== RUN TestAccGithubRepositoryWebhook_secret
--- PASS: TestAccGithubRepositoryWebhook_secret (8.75s)
=== RUN TestAccGithubRepositoryWebhook_importBasic
--- PASS: TestAccGithubRepositoryWebhook_importBasic (8.46s)
=== RUN TestAccGithubRepositoryWebhook_importSecret
--- PASS: TestAccGithubRepositoryWebhook_importSecret (9.53s)
=== RUN TestAccGithubTeamMembership_basic
--- PASS: TestAccGithubTeamMembership_basic (12.08s)
=== RUN TestAccGithubTeamMembership_importBasic
--- PASS: TestAccGithubTeamMembership_importBasic (11.09s)
=== RUN TestAccGithubTeamRepository_basic
--- PASS: TestAccGithubTeamRepository_basic (14.60s)
=== RUN TestAccGithubTeamRepository_importBasic
--- PASS: TestAccGithubTeamRepository_importBasic (12.43s)
=== RUN TestAccCheckGetPermissions
--- PASS: TestAccCheckGetPermissions (0.00s)
=== RUN TestAccGithubTeam_basic
--- PASS: TestAccGithubTeam_basic (5.60s)
=== RUN TestAccGithubTeam_slug
--- PASS: TestAccGithubTeam_slug (2.96s)
=== RUN TestAccGithubTeam_hierarchical
--- PASS: TestAccGithubTeam_hierarchical (6.29s)
=== RUN TestAccGithubTeam_importBasic
--- PASS: TestAccGithubTeam_importBasic (4.56s)
=== RUN TestAccGithubUserGpgKey_basic
--- PASS: TestAccGithubUserGpgKey_basic (2.79s)
=== RUN TestAccGithubUserInvitationAccepter_basic
--- SKIP: TestAccGithubUserInvitationAccepter_basic (0.00s)
resource_github_user_invitation_accepter_test.go:21: GITHUB_TEST_COLLABORATOR_TOKEN was not provided, skipping test
=== RUN TestAccGithubUserSshKey_basic
--- PASS: TestAccGithubUserSshKey_basic (3.37s)
=== RUN TestAccGithubUserSshKey_importBasic
--- PASS: TestAccGithubUserSshKey_importBasic (3.98s)
=== RUN TestAccOrganizationBlock_basic
--- PASS: TestAccOrganizationBlock_basic (4.74s)
=== RUN TestAccOrganizationBlock_importBasic
--- PASS: TestAccOrganizationBlock_importBasic (3.52s)
=== RUN TestEtagTransport
--- PASS: TestEtagTransport (0.00s)
=== RUN TestRateLimitTransport_abuseLimit_get
--- PASS: TestRateLimitTransport_abuseLimit_get (0.00s)
=== RUN TestRateLimitTransport_abuseLimit_post
--- PASS: TestRateLimitTransport_abuseLimit_post (0.00s)
=== RUN TestRateLimitTransport_abuseLimit_post_error
--- PASS: TestRateLimitTransport_abuseLimit_post_error (0.00s)
=== RUN TestAccGithubUtilRole_validation
--- PASS: TestAccGithubUtilRole_validation (0.00s)
=== RUN TestAccGithubUtilTwoPartID
--- PASS: TestAccGithubUtilTwoPartID (0.00s)
PASS
ok github.com/terraform-providers/terraform-provider-github/github 426.498s |
This was referenced May 28, 2019
kfcampbell
pushed a commit
to kfcampbell/terraform-provider-github
that referenced
this pull request
Jul 26, 2022
…/blocks Add github_organization_block resource, update github SDK, add 0.12 support, fix some other issues.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #179, #185, #89
Supersedes #215, #211, #207, #186, #160