-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Type: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PRproject
Description
We want to explore how to record responses for all endpoints of GitHub’s REST API.
Here is how I would approach this. My work-in-progress lives at gr2m/github-rest-api-responses
- Use
@octokit/routesto generate a list of requests that would need to be sent. Use preview headers where they are required
(There are 508 requests for api.github.com as of March 18) - Figure out required setups for each request. E.g. for "Add labels to issues" the setup would be
- Create repository
- Create issue
- Create label
Then after the "Add labels to issues" request was recorded, delete the temporary repository again.
We might be able to use the route path as an indication of the "hierarchy of requests", meaning what setup is needed to record a certain request.
- Once we have the list requests together with necessary setups, we have to create user accounts and other resources need to send the requests, e.g. an organization and apps.
- Run the requests, record the responses, referencing the routes recorded in
@ocotkit/routesso the two can be combined easily.
The endpoint responses would differ from the current scenarios as they would all be a single request/response.
Improvements
- Record response with all preview headers enabled for the endpoint.
- Normalize responses like we do in @octokit/fixtures
- Bonus: Once responses are normalized, we could add the responses to @octokit/fixtures for testing
- Reuse setups to record requests. E.g. when recording "create an issue", that setup can be used for "get an issue" and many others.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PRproject