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: add support for 10 new APIs and drop enterprise-level SCIM APIs which are only in GitHub Enterprise Server #471

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

timrogers
Copy link
Contributor

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 the ghec.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:

  • 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})

@ghost ghost added this to Inbox in JS Sep 28, 2022
@timrogers timrogers added the Type: Feature New feature or request label Sep 28, 2022
@ghost ghost moved this from Inbox to Features in JS Sep 28, 2022
@timrogers timrogers changed the title Update to match the latest state of the API feat: add support for 10 new APIs and drop enterprise-level SCIM APIs which are only in GitHub Enterprise Server Sep 28, 2022
… 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
…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.
Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

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

LGTM! 🔥

@gr2m
Copy link
Contributor

gr2m commented Sep 28, 2022

we now point to the ghec.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

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 @octokit/openapi-types-ghec and https://github.com/octokit/plugin-enterprise-cloud.js/?

@@ -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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
No open projects
JS
  
Features
Development

Successfully merging this pull request may close these issues.

None yet

3 participants