Test Environment for API Usage

Hi everyone.

tl;dr: How is it meant to test applications that use the GitHub API? Is there some test environment which is reset regularly, can I start an own environment, or shall I “spam” GitHub.com with some test data for my purposes?

long version:
We lately bought GitHub Enterprise for the usage in our company. Our department got an own organization within it for our usage across the teams we have. Currently we’re administering all teams, repositories, memberships etc. manually via the GitHub Web Interface. This causes some troubles due to inconsistencies in naming conventions, and team memberships and people just not being familiar with GitHub and the policies we have.

So what I would like to do, is to move to a Terraform based administration (Infrastructure As A Code). Terraform has a GitHub provider which would allow us to manage the organization in a proper code workflow via PRs, Checks and Code Reviews. Instead of having many admins for all teams, they would just file a PR on the configuration repo where it is then approved or rejected. Some training will be needed here of course but having some examples/templates should solve this quickly.

The unfortunate thing is that I do not have a test environment where I could start learning about how this could work. I could register a test organization on GitHub.com or ask the admins of our GHE to give me one temporarily. But then I’m still without users to test.

Shall I just register a bunch of test users in GitHub.com for my purpose (will need likely around 10)? I could also ask some people but it just does not work out that smooth for any testing. Is there maybe a dedicated GitHub.com test environment that could be used or can I spin-up some local API environment for this? I would be even willing to just fire up a local trial GitHub Enterprise instance in a VM if this is possible.

I could not really find any recommendation or references on this topic in the docs.
This page shows some info about registering an app in your own account, but that’s more a WebHook based App which reacts on stuff happening in GH while I want to administer it.
For a GHE trial I need to get in contact with Sales which also gives me just 45 days to get started (not much if you just do this a side task).

Looking forward to get some input here.

Cheers
Daniel

:wave: @danielku15: Hello there! Thanks for sharing these questions and that additional context. While I can’t speak to the Terraform portion, I’d like to share some input towards the GitHub API and GitHub Enterprise items.

We are absolutely thrilled that you’d like to use our GitHub API for your workflow! :tada:

On GitHub.com, there is not a specific “area” or feature for spinning up a test environment to make test API calls. However, it is possible to have a “staging” area in GitHub Enterprise (more on that below).

If you’re interested in making some test calls to the GitHub.com API, we suggest creating a personal access token and using it to authenticate. We have a guide for getting started with the REST API as well as an extensive reference for all of the resources available for this interface.

As a new integrator, we have a set of best practices for integrators that’s intended to help make the most of your experience on our platform. You’re welcome to create a machine account that’s used exclusively for performing automated tasks (including interfacing with the GitHub API). We discourage using the API for “spamming” purposes, and you’re welcome to read more about our API terms regarding request usage.

If your GHE administrators already have access to an existing GitHub Enterprise instance, it’s possible to setup a staging instance for testing, including make requests to the API. As a next step, we suggest sharing that with them as a part of your testing; if they have any questions, they can open a new support ticket using the GitHub Enterprise Support portal.

Does this help with what you’re looking for as far as next steps go? :thought_balloon:

@francisfuzz Thanks for your reply. It is unfortunate to hear that there seems no straight forward way to do these kind of tests against the GitHub API. Repository and Team management can be done with a single account. But as soon as it comes to inviting people to orgs and assigning them to teams with permissions I will need some other accounts.

From an actual authentication and “getting started with the API” everything should be quite clear. The API docs there are very good and the main thing to learn will be to use Terraform together with GH. :nerd_face:

It is unlikely that within a company of our size there is a chance that our GHE admins (our IT) will setup a staging instance for me to test things. Such an environment will result in related costs (setting up, server operations etc.) which usually result in a decline of the request. I would do it on my own, but due to the lack of a license key I cannot really boot it up as our IT will not give me our company key. :sob:

I might rather ask some friends with accounts on GitHub.com and setup a public org for testing the permission management. Of course it would be more convenient to have some personal test accounts which I just delete afterwards once things are working. :thinking: