-
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: drop support for Enterprise Server and Enterprise Cloud-specific APIs, and add support for 10 new APIs #474
Conversation
we're using the Enterprise Cloud schema
when generating types
APIs, and add support for 10 new APIs * 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: This drops support for a number of APIs which are only available in GitHub Enterprise Server (GHES) and GitHub Enterprise Cloud (GHEC). If you want to use these APIs and/or see TypeScript errors after upgrading to this version, you may need to start using the [`@octokit/plugin-enterprise-cloud`]https://github.com/octokit/plugin-enterprise-cloud.js) and/or [`@octokit/plugin-enterprise-server`]*https://github.com/octokit/plugin-enterprise-server.js) packages.
I've validated that I can use @octokit/plugin-enterprise-cloud to perform operations for enterprise-cloud specific routes, e.g. getting an audit log for a test organization in a cloud enterprise: import { Octokit } from "@octokit/core";
import { enterpriseCloud } from "@octokit/plugin-enterprise-cloud";
async function main() {
console.log("enterprise cloud version: " + enterpriseCloud.VERSION);
const MyOctokit = Octokit.plugin(enterpriseCloud);
// note that GITHUB_TOKEN needs to be exported in the environment
const octokit = new MyOctokit({ auth: process.env.GITHUB_TOKEN });
const res = await octokit.orgs.getAuditLog({
org: "octokit-js-sdk-testing",
})
console.log(JSON.stringify(res));
}
main(); |
I've also validated that I can use @octokit/plugin-enterprise-server to perform operations for GHES-specific routes, e.g. getting enterprise stats for a GHES instance: import { Octokit } from "@octokit/core";
const {
enterpriseServer36Admin,
} = require("@octokit/plugin-enterprise-server");
async function main() {
const MyOctokit = Octokit.plugin(enterpriseServer36Admin);
// note that GITHUB_TOKEN needs to be exported
const octokit = new MyOctokit({
auth: process.env.GITHUB_TOKEN,
baseUrl: "https://REDACTED.ghe-test.com/api/v3",
});
// TODO: create a request using server-specific routes
const res = await octokit.enterpriseAdmin.getAllStats({});
console.log(JSON.stringify(res));
}
main(); With that, I've gained confidence that the GHES and GHEC plugins to Octokit.js are valid/operational. |
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.
This change looks good to me given the above validation. The PR description already contains the "BREAKING CHANGE" string as specified in the maintaining.md.
sorry I totally missed this PR 🤦🏼 I just merged #463 which was the same change? |
done via #463 |
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: This drops support for a number of APIs which are only available in GitHub Enterprise Server (GHES) and GitHub Enterprise Cloud (GHEC). If you want to use these APIs and/or see TypeScript errors after upgrading to this version, you may need to start using the
@octokit/plugin-enterprise-cloud
and/or@octokit/plugin-enterprise-server
packages.