Upgrading octokit 3 to 4
Breaking3.8.0 → 4.25.1Breaking3Security1Deprecated2New86Changed39Fixed52Other67
SecurityVersion 4.23.0 was published with world-writeable files, as described in a published security advisory.GHSA-g28x-pgr3-qqx6 ↗
BreakingUpgrade verdict
3 breaking changes and a security fix.
In plain terms
- Creating file contents no longer supports the very old Ruby 1.9.2.
- Callers of edit_hook must now supply the arguments that previously had defaults.
- Calling protect_branch no longer requires the required_status_check argument; you can pass it in the options hash instead.
- The gem package was shipped with file permissions that let any user on the machine modify its files, so you should upgrade to a fixed release.
Must act Top 5 of 6 that need code or config changes
Ruby requirement changed in 4.4.0: >= 1.9.2 → >= 2.0.0.
Adds faraday >= 1, < 3.
Moves sawyer >= 0.5.3, ~> 0.6.0 → ~> 0.9. Your build may pick other versions.
What you must change
Breaking3
Drops support for Ruby 1.9.2 in Octokit::Client::Contents#create_contents.
Octokit::Client::Contents#create_contentsRemoves defaults for Client#edit_hook.
Client#edit_hookMakes the required_status_check parameter optional in protect_branch, changing the method call signature; it can now be passed in the options hash.
protect_branchrequired_status_checkSecurity1
Version 4.23.0 was published with world-writeable files, as described in a published security advisory.
Deprecations to plan for
Deprecated2
Marks version 4.22.0 as deprecated and directs users to update to >= v4.23.0.
Adds a deprecation warning when the :permission parameter is passed to Organizations.create_team.
Organizations.create_teamOrganizations.add_team_repository:permissionAPI changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- removed:
const URI.TBLDECWWWCOMP_ - removed:
const URI.TBLENCWWWCOMP_ - removed:
module URI - removed:
static method Octokit.respond_to?(_, _ = …) - removed:
static method URI.decode_www_form_component(_, _ = …) - removed:
static method URI.encode_www_form_component(_) - added:
const Octokit.RATE_LIMITED_ERRORS - added:
static method Octokit.enterprise_admin_client() - added:
static method Octokit.enterprise_management_console_client()
- removed:
const Default.RACK_BUILDER_CLASS - removed:
method Client.agent() - removed:
method Client.delete(_, _ = …) - removed:
method Client.get(_, _ = …) - removed:
method Client.head(_, _ = …) - removed:
method Client.last_response() - removed:
method Client.octokit_warn(*) - removed:
method Client.paginate(_, _ = …) - removed:
method Client.patch(_, _ = …) - removed:
method Client.post(_, _ = …) - removed:
method Client.put(_, _ = …) - removed:
method Client.root() - removed:
method Client.same_options?(_) - added:
class AccountSuspended < Forbidden - added:
class BillingIssue < Forbidden - added:
class BranchNotProtected < ClientError - added:
class CommitIsNotPartOfPullRequest < UnprocessableEntity - added:
class EnterpriseAdminClient - added:
class EnterpriseManagementConsoleClient - added:
class InstallationSuspended < Forbidden - added:
class InvalidRepository < ArgumentError - added:
class PathDiffTooLarge < UnprocessableEntity - added:
class SAMLProtected < Forbidden - added:
class TooLargeContent < Forbidden - added:
class UnavailableForLegalReasons < ClientError - added:
class UnverifiedEmail < Forbidden - added:
const Authentication.FARADAY_BASIC_AUTH_KEYS - added:
const Preview.PREVIEW_TYPES - added:
const Repository.NAME_WITH_OWNER_PATTERN - added:
const Response.BaseMiddleware - added:
constructor EnterpriseAdminClient(_ = …) - added:
constructor EnterpriseManagementConsoleClient(_ = …) - added:
method Authentication.bearer_authenticated?() - added:
method Client.client_without_redirects(_ = …) - added:
method Configurable.management_console_endpoint() - added:
method Configurable.same_options?(_) - added:
method Connection.agent() - added:
method Connection.delete(_, _ = …) - added:
method Connection.get(_, _ = …) - added:
method Connection.head(_, _ = …) - added:
method Connection.last_response() - added:
method Connection.paginate(_, _ = …) - added:
method Connection.patch(_, _ = …) - added:
method Connection.post(_, _ = …) - added:
method Connection.put(_, _ = …) - added:
method Connection.root() - added:
method Error.build_error_context() - added:
method Error.response_body() - added:
method Error.response_headers() - added:
method Error.response_status() - added:
method Preview.ensure_api_media_type(_, _) - added:
method Preview.warn_preview(_) - added:
module Connection - added:
module Middleware - added:
module Preview - added:
module Warnable - added:
property Configurable.bearer_token: accessor - added:
property Configurable.management_console_endpoint: writer - added:
property Configurable.management_console_password: writer - added:
property Configurable.ssl_verify_mode: accessor - added:
property Error.context: reader - added:
protected method Connection.endpoint() - added:
protected method EnterpriseManagementConsoleClient.endpoint() - added:
protected set EnterpriseManagementConsoleClient.management_console_endpoint(_) - added:
protected set EnterpriseManagementConsoleClient.management_console_password(_) - added:
set Client.bearer_token(_) - added:
static method Default.bearer_token() - added:
static method Default.management_console_endpoint() - added:
static method Default.management_console_password() - added:
static method Default.ssl_verify_mode() - added:
static method Error.error_for_404(_) - added:
static method Error.error_for_422(_) - added:
static method Warnable.octokit_warn(*)
- removed:
const Hooks.ORG_HOOKS_PREVIEW_MEDIA_TYPE - removed:
method Authorizations.check_application_authorization(_, _ = …) - removed:
method Authorizations.delete_application_authorization(_, _ = …) - removed:
method Authorizations.reset_application_authorization(_, _ = …) - removed:
method Authorizations.revoke_application_authorization(_, _ = …) - changed:
class CONVENIENCE_HEADERS < Set.new([:accept, :content_type]) → class CONVENIENCE_HEADERS < Set.new(%i[accept content_type]) - changed:
method Authorizations.scopes(_ = …) → method Authorizations.scopes(_ = …, _ = …) - changed:
method PullRequests.pull_requests(*) → method PullRequests.pull_requests(_, _ = …) - changed:
method PullRequests.pulls(*) → method PullRequests.pulls(_, _ = …) - added:
const ServiceStatus.COMPONENTS_ROOT - added:
const ServiceStatus.SUMMARY_ROOT - added:
method ActionsSecrets.create_or_update_secret(_, _, _) - added:
method ActionsSecrets.delete_secret(_, _) - added:
method ActionsSecrets.get_public_key(_) - added:
method ActionsSecrets.get_secret(_, _) - added:
method ActionsSecrets.list_secrets(_) - added:
method ActionsWorkflowRuns.cancel_workflow_run(_, _, _ = …) - added:
method ActionsWorkflowRuns.delete_workflow_run(_, _, _ = …) - added:
method ActionsWorkflowRuns.delete_workflow_run_logs(_, _, _ = …) - added:
method ActionsWorkflowRuns.list_repository_workflow_runs(_, _ = …) - added:
method ActionsWorkflowRuns.list_workflow_runs(_, _, _ = …) - added:
method ActionsWorkflowRuns.repository_workflow_runs(_, _ = …) - added:
method ActionsWorkflowRuns.rerun_workflow_run(_, _, _ = …) - added:
method ActionsWorkflowRuns.workflow_run(_, _, _ = …) - added:
method ActionsWorkflowRuns.workflow_run_logs(_, _, _ = …) - added:
method ActionsWorkflowRuns.workflow_runs(_, _, _ = …) - added:
method ActionsWorkflows.list_workflows(_, _ = …) - added:
method ActionsWorkflows.workflow(_, _, _ = …) - added:
method ActionsWorkflows.workflow_dispatch(_, _, _, _ = …) - added:
method ActionsWorkflows.workflows(_, _ = …) - added:
method Apps.add_repo_to_installation(_, _, _ = …) - added:
method Apps.add_repository_to_app_installation(_, _, _ = …) - added:
method Apps.add_repository_to_integration_installation(_, _, _ = …) - added:
method Apps.app(_ = …) - added:
method Apps.create_app_installation_access_token(_, _ = …) - added:
method Apps.create_installation_access_token(_, _ = …) - added:
method Apps.create_integration_installation_access_token(_, _ = …) - added:
method Apps.delete_installation(_, _ = …) - added:
method Apps.find_app_installations(_ = …) - added:
method Apps.find_installation_repositories_for_user(_, _ = …) - added:
method Apps.find_installations(_ = …) - added:
method Apps.find_integration_installations(_ = …) - added:
method Apps.find_organization_installation(_, _ = …) - added:
method Apps.find_repository_installation(_, _ = …) - added:
method Apps.find_user_installation(_, _ = …) - added:
method Apps.find_user_installations(_ = …) - added:
method Apps.installation(_, _ = …) - added:
method Apps.list_app_installation_repositories(_ = …) - added:
method Apps.list_installation_repos(_ = …) - added:
method Apps.list_integration_installation_repositories(_ = …) - added:
method Apps.remove_repo_from_installation(_, _, _ = …) - added:
method Apps.remove_repository_from_app_installation(_, _, _ = …) - added:
method Apps.remove_repository_from_integration_installation(_, _, _ = …) - added:
method Checks.check_run(_, _, _ = …) - added:
method Checks.check_run_annotations(_, _, _ = …) - added:
method Checks.check_runs_for_check_suite(_, _, _ = …) - added:
method Checks.check_runs_for_ref(_, _, _ = …) - added:
method Checks.check_suite(_, _, _ = …) - added:
method Checks.check_suites_for_ref(_, _, _ = …) - added:
method Checks.create_check_run(_, _, _, _ = …) - added:
method Checks.create_check_suite(_, _, _ = …) - added:
method Checks.list_check_runs_for_check_suite(_, _, _ = …) - added:
method Checks.list_check_runs_for_ref(_, _, _ = …) - added:
method Checks.list_check_suites_for_ref(_, _, _ = …) - added:
method Checks.rerequest_check_suite(_, _, _ = …) - added:
method Checks.set_check_suite_preferences(_, _ = …) - added:
method Checks.update_check_run(_, _, _ = …) - added:
method CommitBranches.commit_branches(_, _, _ = …) - added:
method CommitPulls.commit_pulls(_, _, _ = …) - added:
method CommunityProfile.community_profile(_, _ = …) - added:
method Deployments.delete_deployment(_, _, _ = …) - added:
method Deployments.deployment(_, _, _ = …) - added:
method Gists.gist_commits(_, _ = …) - added:
method Gists.gist_forks(_, _ = …) - added:
method Hooks.parse_payload(_) - added:
method Hooks.ping_hook(_, _, _ = …) - added:
method Issues.add_assignees(_, _, _, _ = …) - added:
method Issues.issue_timeline(_, _, _ = …) - added:
method Issues.list_assignees(_, _ = …) - added:
method Issues.lock_issue(_, _, _ = …) - added:
method Issues.remove_assignees(_, _, _, _ = …) - added:
method Issues.unlock_issue(_, _, _ = …) - added:
method Licenses.license(_, _ = …) - added:
method Licenses.licenses(_ = …) - added:
method Licenses.repository_license_contents(_, _ = …) - added:
method Marketplace.list_accounts_for_plan(_, _ = …) - added:
method Marketplace.list_plans(_ = …) - added:
method Marketplace.marketplace_purchases(_ = …) - added:
method Marketplace.plan_for_account(_, _ = …) - added:
method OauthApplications.check_application_authorization(_, _ = …) - added:
method OauthApplications.check_token(_, _ = …) - added:
method OauthApplications.delete_app_authorization(_, _ = …) - added:
method OauthApplications.delete_app_token(_, _ = …) - added:
method OauthApplications.delete_application_authorization(_, _ = …) - added:
method OauthApplications.reset_application_authorization(_, _ = …) - added:
method OauthApplications.reset_token(_, _ = …) - added:
method OauthApplications.revoke_application_authorization(_, _ = …) - added:
method Organizations.all_organizations(_ = …) - added:
method Organizations.all_orgs(_ = …) - added:
method Organizations.billing_actions(_) - added:
method Organizations.child_teams(_, _ = …) - added:
method Organizations.convert_to_outside_collaborator(_, _, _ = …) - added:
method Organizations.delete_migration_archive(_, _, _ = …) - added:
method Organizations.migration_archive_url(_, _, _ = …) - added:
method Organizations.migration_status(_, _, _ = …) - added:
method Organizations.migrations(_, _ = …) - added:
method Organizations.org_invitations(_, _ = …) - added:
method Organizations.organization_invitations(_, _ = …) - added:
method Organizations.outside_collaborators(_, _ = …) - added:
method Organizations.remove_org_membership(_, _ = …) - added:
method Organizations.remove_organization_membership(_, _ = …) - added:
method Organizations.remove_outside_collaborator(_, _, _ = …) - added:
method Organizations.start_migration(_, _, _ = …) - added:
method Organizations.team_by_name(_, _, _ = …) - added:
method Organizations.team_invitations(_, _ = …) - added:
method Organizations.unlock_repository(_, _, _, _ = …) - added:
method Pages.pages_build(_, _, _ = …) - added:
method Pages.request_page_build(_, _ = …) - added:
method Projects.column_cards(_, _ = …) - added:
method Projects.create_org_project(_, _, _ = …) - added:
method Projects.create_organization_project(_, _, _ = …) - added:
method Projects.create_project(_, _, _ = …) - added:
method Projects.create_project_card(_, _ = …) - added:
method Projects.create_project_column(_, _, _ = …) - added:
method Projects.delete_project(_, _ = …) - added:
method Projects.delete_project_card(_, _ = …) - added:
method Projects.delete_project_column(_, _ = …) - added:
method Projects.move_project_card(_, _, _ = …) - added:
method Projects.move_project_column(_, _, _ = …) - added:
method Projects.org_projects(_, _ = …) - added:
method Projects.organization_projects(_, _ = …) - added:
method Projects.project(_, _ = …) - added:
method Projects.project_card(_, _ = …) - added:
method Projects.project_column(_, _ = …) - added:
method Projects.project_columns(_, _ = …) - added:
method Projects.projects(_, _ = …) - added:
method Projects.update_project(_, _ = …) - added:
method Projects.update_project_card(_, _ = …) - added:
method Projects.update_project_column(_, _, _ = …) - added:
method Reactions.commit_comment_reactions(_, _, _ = …) - added:
method Reactions.create_commit_comment_reaction(_, _, _, _ = …) - added:
method Reactions.create_issue_comment_reaction(_, _, _, _ = …) - added:
method Reactions.create_issue_reaction(_, _, _, _ = …) - added:
method Reactions.create_pull_request_review_comment_reaction(_, _, _, _ = …) - added:
method Reactions.delete_reaction(_, _ = …) - added:
method Reactions.issue_comment_reactions(_, _, _ = …) - added:
method Reactions.issue_reactions(_, _, _ = …) - added:
method Reactions.pull_request_review_comment_reactions(_, _, _ = …) - added:
method Refs.matching_refs(_, _, _ = …) - added:
method Repositories.branch_protection(_, _, _ = …) - added:
method Repositories.create_repo_from_template(_, _, _ = …) - added:
method Repositories.create_repository_from_template(_, _, _ = …) - added:
method Repositories.disable_vulnerability_alerts(_, _ = …) - added:
method Repositories.dispatch_event(_, _, _ = …) - added:
method Repositories.enable_vulnerability_alerts(_, _ = …) - added:
method Repositories.permission_level(_, _, _ = …) - added:
method Repositories.protect_branch(_, _, _ = …) - added:
method Repositories.rename_branch(_, _, _, _ = …) - added:
method Repositories.replace_all_topics(_, _, _ = …) - added:
method Repositories.topics(_, _ = …) - added:
method Repositories.transfer_repo(_, _, _ = …) - added:
method Repositories.transfer_repository(_, _, _ = …) - added:
method Repositories.unprotect_branch(_, _, _ = …) - added:
method Repositories.vulnerability_alerts_enabled?(_, _ = …) - added:
method RepositoryInvitations.accept_repo_invitation(_, _ = …) - added:
method RepositoryInvitations.accept_repository_invitation(_, _ = …) - added:
method RepositoryInvitations.decline_invitation(_, _ = …) - added:
method RepositoryInvitations.decline_repository_invitation(_, _ = …) - added:
method RepositoryInvitations.delete_repo_invitation(_, _, _ = …) - added:
method RepositoryInvitations.delete_repository_invitation(_, _, _ = …) - added:
method RepositoryInvitations.invite_user_to_repo(_, _, _ = …) - added:
method RepositoryInvitations.invite_user_to_repository(_, _, _ = …) - added:
method RepositoryInvitations.repo_invitations(_, _ = …) - added:
method RepositoryInvitations.repository_invitations(_, _ = …) - added:
method RepositoryInvitations.update_repo_invitation(_, _, _ = …) - added:
method RepositoryInvitations.update_repository_invitation(_, _, _ = …) - added:
method RepositoryInvitations.user_repo_invitations(_ = …) - added:
method RepositoryInvitations.user_repository_invitations(_ = …) - added:
method Reviews.create_pull_request_review(_, _, _ = …) - added:
method Reviews.delete_pull_request_review(_, _, _, _ = …) - added:
method Reviews.delete_pull_request_review_request(_, _, _ = …, _ = …) - added:
method Reviews.dismiss_pull_request_review(_, _, _, _, _ = …) - added:
method Reviews.pull_request_review(_, _, _, _ = …) - added:
method Reviews.pull_request_review_comments(_, _, _, _ = …) - added:
method Reviews.pull_request_review_requests(_, _, _ = …) - added:
method Reviews.pull_request_reviews(_, _, _ = …) - added:
method Reviews.request_pull_request_review(_, _, _ = …, _ = …) - added:
method Reviews.submit_pull_request_review(_, _, _, _, _ = …) - added:
method Reviews.update_pull_request_review(_, _, _, _, _ = …) - added:
method Search.search_commits(_, _ = …) - added:
method ServiceStatus.github_status_summary() - added:
method SourceImport.cancel_source_import(_, _ = …) - added:
method SourceImport.map_source_import_commit_author(_, _, _ = …) - added:
method SourceImport.set_source_import_lfs_preference(_, _, _ = …) - added:
method SourceImport.source_import_commit_authors(_, _ = …) - added:
method SourceImport.source_import_large_files(_, _ = …) - added:
method SourceImport.source_import_progress(_, _ = …) - added:
method SourceImport.start_source_import(*) - added:
method SourceImport.update_source_import(_, _ = …) - added:
method Traffic.clones(_, _ = …) - added:
method Traffic.top_paths(_, _ = …) - added:
method Traffic.top_referrers(_, _ = …) - added:
method Traffic.views(_, _ = …) - added:
method Users.delete_user_migration_archive(_, _ = …) - added:
method Users.start_user_migration(_, _ = …) - added:
method Users.unlock_user_repository(_, _, _ = …) - added:
method Users.user_migration_archive_url(_, _ = …) - added:
method Users.user_migration_repositories(_, _ = …) - added:
method Users.user_migration_status(_, _ = …) - added:
method Users.user_migrations(_ = …) - added:
module ActionsSecrets - added:
module ActionsWorkflowRuns - added:
module ActionsWorkflows - added:
module Apps - added:
module Checks - added:
module CommitBranches - added:
module CommitPulls - added:
module CommunityProfile - added:
module Licenses - added:
module Marketplace - added:
module OauthApplications - added:
module Projects - added:
module Reactions - added:
module RepositoryInvitations - added:
module Reviews - added:
module SourceImport - added:
module Traffic
- added:
class CONVENIENCE_HEADERS < Set.new(%i[accept content_type])
- changed:
class MIDDLEWARE < RACK_BUILDER_CLASS.new → class MIDDLEWARE < Faraday::RackBuilder.new
- added:
method AdminStats.admin_comments_stats() - added:
method AdminStats.admin_gists_stats() - added:
method AdminStats.admin_hooks_stats() - added:
method AdminStats.admin_issues_stats() - added:
method AdminStats.admin_milestones_stats() - added:
method AdminStats.admin_organization_stats() - added:
method AdminStats.admin_pages_stats() - added:
method AdminStats.admin_pull_requests_stats() - added:
method AdminStats.admin_repository_stats() - added:
method AdminStats.admin_stats() - added:
method AdminStats.admin_users_stats() - added:
method License.license_info() - added:
method Orgs.create_organization(_, _, _ = …) - added:
method SearchIndexing.index_organization(_) - added:
method SearchIndexing.index_organizations_repositories(_) - added:
method SearchIndexing.index_organizations_repositories_code(_) - added:
method SearchIndexing.index_organizations_repositories_issues(_) - added:
method SearchIndexing.index_repository(_) - added:
method SearchIndexing.index_repository_code(_) - added:
method SearchIndexing.index_repository_issues(_) - added:
method SearchIndexing.index_user(_) - added:
method SearchIndexing.index_users_repositories(_) - added:
method SearchIndexing.index_users_repositories_code(_) - added:
method SearchIndexing.index_users_repositories_issues(_) - added:
method Users.create_impersonation_token(_, _ = …) - added:
method Users.create_user(_, _, _ = …) - added:
method Users.delete_impersonation_token(_, _ = …) - added:
method Users.delete_key(_, _ = …) - added:
method Users.delete_user(_, _ = …) - added:
method Users.demote(_, _ = …) - added:
method Users.list_all_keys(_ = …) - added:
method Users.promote(_, _ = …) - added:
method Users.rename_user(_, _, _ = …) - added:
method Users.suspend(_, _ = …) - added:
method Users.unsuspend(_, _ = …) - added:
module AdminStats - added:
module License - added:
module Orgs - added:
module SearchIndexing - added:
module Users
- added:
method ManagementConsole.add_authorized_key(_) - added:
method ManagementConsole.authorized_keys() - added:
method ManagementConsole.config_check() - added:
method ManagementConsole.config_status() - added:
method ManagementConsole.delete_authorized_key(_) - added:
method ManagementConsole.edit_maintenance_status(_) - added:
method ManagementConsole.edit_settings(_) - added:
method ManagementConsole.get_authorized_keys() - added:
method ManagementConsole.get_maintenance_status() - added:
method ManagementConsole.get_settings() - added:
method ManagementConsole.maintenance_status() - added:
method ManagementConsole.remove_authorized_key(_) - added:
method ManagementConsole.set_maintenance_status(_) - added:
method ManagementConsole.settings() - added:
method ManagementConsole.start_configuration() - added:
method ManagementConsole.upgrade(_) - added:
method ManagementConsole.upload_license(_, _ = …) - added:
module ManagementConsole
- added:
class FollowRedirects < Faraday::Middleware - added:
class RedirectLimitReached < Faraday::ClientError - added:
const FollowRedirects.FOLLOW_LIMIT - added:
const FollowRedirects.URI_UNSAFE - added:
constructor FollowRedirects(_, _ = …) - added:
constructor RedirectLimitReached(_) - added:
method FollowRedirects.call(_) - added:
property RedirectLimitReached.response: reader
- added:
class ALLOWED_METHODS < Set.new - added:
class ENV_TO_CLEAR < Set.new - added:
class REDIRECT_CODES < Set.new
- changed:
class FeedParser < Faraday::Response::Middleware → class FeedParser < BaseMiddleware - changed:
class RaiseError < Faraday::Response::Middleware → class RaiseError < BaseMiddleware - added:
method FeedParser.on_complete(_) - added:
method RaiseError.on_complete(_)