Resync app-permissions overrides with current API schema#529
Resync app-permissions overrides with current API schema#529salmanmkc wants to merge 2 commits intooctokit:mainfrom
Conversation
The override files for /app/installations contained a stale copy of the app-permissions schema that used team_discussions instead of discussions. The upstream schema (rest-api-description) was updated from team_discussions to discussions, but these hardcoded overrides were never updated to match. This caused @octokit/openapi consumers to see team_discussions instead of discussions in the app-permissions schema.
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
Note: broader permissions drift While investigating this, I noticed the override files are frozen snapshots and have drifted beyond just This PR fixes the most impactful rename ( Breaking change note: This renames a schema property from |
|
Thanks, feel free to update the override completely in this PR. Best to tackle it all at once. Do note that GitHub has abandoned Octokit and other open source projects. It is entirely possible that the release workflow is broken due to the recent revocation of long lived NPM tokens, and not being able to publish new packages using OIDC authentication. |
Update the frozen permission snapshots in override files to include all current GitHub API permissions. Beyond the team_discussions to discussions rename, this adds 20 missing permissions including: artifact_metadata, attestations, codespaces, merge_queues, dependabot_secrets, interaction_limits, email_addresses, organization_copilot_agent_settings, organization_copilot_seat_management, organization_custom_org_roles, organization_custom_properties, organization_events, enterprise_custom_properties_for_organizations, custom_properties_for_organizations, repository_custom_properties, followers, git_ssh_keys, gpg_keys, profile, and starring.
team_discussions → discussions in app-installations overrides|
Closing in favour of #531 |
Problem
The override files for
/app/installations(scripts/overrides/get-app-installations.jsonand.deref.json) contained a stale copy of theapp-permissionsschema. The most impactful issue was using the oldteam_discussionskey instead ofdiscussions, but the permissions block had also drifted significantly — missing 20 permissions that exist in the current GitHub API.Root Cause
These overrides exist to work around a
anyOfissue (octokit/openapi-types.ts#305). ThereplaceOperation()function inscripts/overrides/index.mjsreplaces the entire operation with a frozen JSON snapshot, which means the permissions block drifts every time GitHub adds a new permission scope upstream.Ideally, the override would only patch the
anyOfstructure rather than replacing the whole operation — that way permissions would stay in sync automatically. That's a bigger refactor but would prevent this class of drift entirely.Fix
team_discussions→discussionswith updated descriptionapp-permissionsschema:artifact_metadata,attestations,codespaces,custom_properties_for_organizations,dependabot_secrets,email_addresses,enterprise_custom_properties_for_organizations,followers,git_ssh_keys,gpg_keys,interaction_limits,merge_queues,organization_copilot_agent_settings,organization_copilot_seat_management,organization_custom_org_roles,organization_custom_properties,organization_events,profile,repository_custom_properties,starringImpact
Downstream consumers (e.g.
actions/create-github-app-token) that generate permission inputs fromapp-permissionswill now correctly seediscussionsinstead ofteam_discussions, and will have access to all current permission scopes.This also helps fix github/gh-aw#25709 due to the regression from github/gh-aw#25508.
Fixes #528