Skip to content
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

feat: maintain compatibility with octokit/openapi v8.0.0 and later by querying against the ghec schema bundle #78

Merged
merged 4 commits into from
Sep 23, 2022

Conversation

timrogers
Copy link
Collaborator

As of v8.0.0 of octokit/openapi, the api.github.com bundle does not include API operations exclusive to GitHub Enterprise Cloud.

If you want to see the GHEC-exclusive operations and all of the other normal ones, you have to look at the ghec bundle, not the api.github.com one.

This points our GraphQL queries to use the ghec bundle if the requested version is on or after v8.0.0. This will ensure that all expected operations are returned, and you can still filter them to find the ones you care about using the githubCloudOnly input.

This repository uses data generated and stored in `octokit/openapi`.
Where one API version has an operation and another doesn't, then
we add a special operation entry representing the missing operation.
This is done in the [`addRemovedOperations` method][1].

When these special operation entries are added, they doesn't have
the `X-GitHub` extension data included. Currently, we expect that
to be there and blow up if it isn't. This makes the code more tolerant.

[1]:
https://github.com/octokit/openapi/blob/65f7b1ce4f0d90fa1db433d7f0904ecd6cc3bdc4/scripts/build.js#L413
@timrogers timrogers requested a review from gr2m September 22, 2022 22:56
versions v8.0.0 onwards

As of v8.0.0 of `octokit/openapi`, the `api.github.com` bundle
does not include API operations exclusive to GitHub Enterprise
Cloud. If you want to see the GHEC-exclusive operations and all
of the other normal ones, you have to look at the `ghec` bundle.

This points our GraphQL queries to use the `ghec` bundle if the
requested version is on or after v8.0.0. This will ensure that
all expected operations are returned, and you can still filter
them to find the ones you care about using the `githubCloudOnly`
input.
@timrogers timrogers changed the title feat: use the ghec schema bundle when querying data in octokit/openapi v8.0.0 and later feat: maintain compatibility with octokit/openapi v8.0.0 and later by querying against the ghec schema bundle Sep 22, 2022
Copy link
Owner

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gr2m gr2m merged commit f666d8a into gr2m:main Sep 23, 2022
@github-actions
Copy link

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants