-
Notifications
You must be signed in to change notification settings - Fork 853
Introduce a working github_repository_prereceive_hook resource #252
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
Conversation
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.
It looks like we are getting a failure when running the tests. Here is the error
--- FAIL: TestAccGithubRepositoryPreReceiveHook_basic (4.78s)
testing.go:568: Step 0 error: errors during apply:
Error: GET https://api.github.com/repos/terraformtesting/foo-xd3xek6kxn/pre-receive-hooks?per_page=100: 404 Not Found []
}) | ||
} | ||
|
||
func testAccCheckGitHubPreReceiveHookEnforcement(n string, enforcement string) resource.TestCheckFunc { |
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.
This is not required as we should be checking what's in state matches reality. This can be accomplished using an import state verifier
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
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.
This is a check against the API; not state? I don't have an importer for this resource. I can skip validating against the API entirely though if that's preferred (I copied this pattern from the webhook tests).
@tracypholmes this is a feature that's only available in GitHub Enterprise. I don't believe the main GitHub website supports this API endpoint. I ran the tests against our GHE install and they passed. I'll get the other comments addressed shortly. 👍 |
Co-Authored-By: Tracy P Holmes <[email protected]>
…m-provider-github into jstump-prereceive-hook
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the |
👋 Hey Friends, this pull request has been automatically marked as |
What does this PR do?
This adds a new resource for managing pre-receive hooks in GitHub Enterprise.
Example HCL
TODO