Enhancement: Support configuring GHE pre-receive hooks
Self-hosted GitHub Enterprise supports configuring pre-receive hooks at the organization and repository. I would like github-api to support configuring these hooks.
I needed to configure pre-receive hooks on several GHE repos, and extended github-api to support doing so. My enhancement mirrors the existing GHHook implementation because the two are similar in some ways, but the details are quite different.
I would like to contribute that enhancement if it would be welcomed. I know the enhancement works and is valuable to me. However, I'm not sure if the project wants to go down the path of supporting a relatively niche feature that not all users would have access to. So I wanted to check before putting in the work to write tests and put together a good PR.
Supporting niche features is fine as long as they have CI unit test coverage. If they require special setup to recreate test data (as with GHE features) that process should be documented.
Howdy! I came across this issue (and PR) as my team uses this package for our interactions with GHE instances and also has a need for configuring pre-receive hooks.
@michaelpigg I know it's a long shot but do you have any plans to finalize the PR? If not, I was considering doing it myself.
LMK, thanks!
Hi @rzvndn, glad to hear it could be useful. The blocker for me had been setting up the tests. I will take another look and see if I can finish it.
@rzvndn @michaelpigg If you have to record the data using your own instances and then anonymize it for use in our CI system that is fine to. The instructions can be written for people with GHE instance. You don't have to make it completely publicly reproducible as long as someone can update it.
@bitwiseman I recorded some interactions. The thing that I've been struggling with is that the current test infrastructure doesn't easily support the hostname and path structure that GHE needs, at least so far as I can tell. If there's an existing test that provides an example for GHE I'd appreciate a pointer to it. Otherwise it seems like I need to refactor the test support a bit or else adjust the recordings so that they work as if public GitHub supported this feature.
@michaelpigg Either of the solutions you mention are completely acceptable. I think refactoring the test support would be better since it would help others add GHE specific features as well, but it would be easier to a one-off search-and-replace in the test data.
It is completely up to you.