-
Notifications
You must be signed in to change notification settings - Fork 32
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: add support for 10 new APIs and drop enterprise-level SCIM APIs which are only in GitHub Enterprise Server #471
base: main
Are you sure you want to change the base?
Conversation
… we're using the Enterprise Cloud schema
… which are only in GitHub Enterprise Server * feat: add support for new "Delete an organization secret" (`DELETE /organizations/{org}/codespaces/secrets/{secret_name}`) Codespaces API * feat: add support for new "Remove selected repository from an organization secret" (`DELETE /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}`) Codespaces API * feat: add support for new "List organization secrets" (`GET /organizations/{org}/codespaces/secrets`) Codespaces API * feat: add support for new "Get an organization public key" (`GET /organizations/{org}/codespaces/secrets/public-key`) Codespaces API * feat: add support for new "Get an organization secret" (`GET /organizations/{org}/codespaces/secrets/{secret_name}` ) Codespaces API * feat: add support for new "List selected repositories for an organization secret" (`GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories`) Codespaces API * * feat: add support for new "Get a Dependabot alert" API (`GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}`) * feat: add support for new "List Dependabot alerts for a repository" API (`GET /repos/{owner}/{repo}/dependabot/alerts`) * feat: add support for new "Update a Dependabot alert" API (`PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}`) * feat: adds support for new "Create or update an organization secret" (`PUT /organizations/{org}/codespaces/secrets/{secret_name}` ) Codespaces API * feat: add support for new "List selected repositories for an organization secret" (`GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories`) Codespaces API * feat: add support for new "Add selected repository to an organization secret" (`PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}`) Codespaces API BREAKING CHANGE: Removes support for enterprise-level SCIM APIs which are only available in GitHub Enterprise Server (`DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}`, `DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}`, `GET /scim/v2/enterprises/{enterprise}/Groups`, `GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}`, `GET /scim/v2/enterprises/{enterprise}/Users`, `GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}`, `PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}`, `PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}`, `POST /scim/v2/enterprises/{enterprise}/Groups`, `POST /scim/v2/enterprises/{enterprise}/Users`, `PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}`, `PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}`) # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch timrogers/manual-update
698468a
to
e3bb815
Compare
…types-ghec` This switches this package's dependency from `@octokit/openapi-types` to `@octokit/openapi-types-ghec`. This means that we still have access to and can expose types only relevant to GitHub Enterprise Server. These are now find in the `-ghec` package, whereas before they were in the basic package.
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.
LGTM! 🔥
why not remove the APIs that are GitHub Enterprise Cloud only, if we do a breaking change anyway? We can figure out the types for GHEC via |
@@ -6,7 +6,7 @@ | |||
}, | |||
"description": "Shared TypeScript definitions for Octokit projects", | |||
"dependencies": { | |||
"@octokit/openapi-types": "^13.11.0" | |||
"@octokit/openapi-types-ghec": "^14.0.0" |
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.
sorry my comment was about this change
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.
@gr2m Thanks for jumping in! Just to be clear, are you proposing that types.ts
would be basic non-GHEC types only, and then you would use plugin-enterprise-cloud.js
for GHEC-exclusive APIs? That is definitely an option.
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.
Yes that was my idea, similar to what we do for GHES here: https://github.com/octokit/plugin-enterprise-server.js/blob/master/src/generated/
This PR continues the work of rolling out our restructured OpenAPI specifications across Octokit.js.
Thanks to new functionality in the latest minor version of @gr2m's
github-openapi-graphql-query
introduced in gr2m/github-openapi-graphql-query#78, we now point to theghec.json
schema file for generating our types. This means that we will continue to expose normal APIs here and those only available to GitHub Enterprise Cloud customers. To maintain pretty documentation URLs in the types, we remove the Enterprise Cloud references from those URLs.Concretely, this introduces the following changes in the types:
DELETE /organizations/{org}/codespaces/secrets/{secret_name}
) Codespaces APIDELETE /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}
) Codespaces APIGET /organizations/{org}/codespaces/secrets
) Codespaces APIGET /organizations/{org}/codespaces/secrets/public-key
) Codespaces APIGET /organizations/{org}/codespaces/secrets/{secret_name}
) Codespaces APIGET /organizations/{org}/codespaces/secrets/{secret_name}/repositories
) Codespaces APIGET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}
)GET /repos/{owner}/{repo}/dependabot/alerts
)PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}
)PUT /organizations/{org}/codespaces/secrets/{secret_name}
) Codespaces APIGET /organizations/{org}/codespaces/secrets/{secret_name}/repositories
) Codespaces APIPUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}
) Codespaces APIBREAKING CHANGE: Removes support for enterprise-level SCIM APIs which are only available in GitHub Enterprise Server (
DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
,DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
,GET /scim/v2/enterprises/{enterprise}/Groups
,GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
,GET /scim/v2/enterprises/{enterprise}/Users
,GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
,PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
,PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
,POST /scim/v2/enterprises/{enterprise}/Groups
,POST /scim/v2/enterprises/{enterprise}/Users
,PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
,PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
)