Repository navigation
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped contract compatibility fix that drops only unknown server-advertised capability values while preserving known behavior and strict client inputs. The production change is self-contained and covered by existing helper tests plus a targeted regression test. You can add or adjust custom eligibility rules. Learn more. |
A server that offers a PR action an older client does not know, such as delete-branch, failed the client's whole pull request decode. Lists of actions, verdicts, merge methods, and update methods the server sends now decode with ForwardCompatibleArray, so unknown members are dropped.
tris203
force-pushed
the
fix/pr-actions-forward-compatible
branch
from
October 15, 2026 22:01
b79fe71 to
f6d8e00
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A mobile build from before #19257 can't open any GitHub pull request from a server that includes it. #19257 added
delete-branchtoPullRequestAction, and the old client's strict literal decode ofcapabilities.actionsfails the whole response:Any future action, verdict, or merge/update method would break older clients the same way, and mobile builds routinely lag servers.
Change
The PR contracts now use the existing forward-compatibility helper,
ForwardCompatibleArray(from #15951, already used for auth scopes and provider auth methods), for the lists of growing literal sets that the server sends:PullRequestCapabilities:actions,mergeMethods,updateMethods,review.verdictsPullRequestViewerPermissions:actions,verdicts,updateMethodsPullRequestProviderSummary:actionsUnknown members are dropped, so an older client simply doesn't offer the new control. Decoded types are unchanged. Client→server inputs, such as the action request's
action, stay strict.This only protects clients built from this change onward. Builds that have already shipped still need updating.
Scope and approval
This is a very small, focused fix for an obvious bug, so it doesn't need a prior issue:
Verification
The report. An Android client from before #19257, connected to a server that includes it, fails to open #14883:
Reproduction and fix, on the wire. I decoded
PullRequestCapabilitiesthrough its JSON wire codec (Schema.toCodecJson, as clients read RPC responses) using the contracts from three revisions:511d20c6f2)mainwithout this fix (42da166d13)b79fe71d95)Each decoded two payloads. The first is GitHub's capabilities exactly as upstream
mainsends them, which includesdelete-branch. The second is a later server that adds an action no build knows about yet (archive).mainhas the same weakness for the next new action.Tests and typechecks
packages/contracts/src/pullRequest.test.tscovers an unknown action and an unknown verdict in capabilities:vp test run packages/contracts/src/pullRequest.test.ts, 32 passed.packages/contracts,apps/server,apps/mobileandapps/webtypecheck.Not checked: a rebuilt mobile client against a newer server on a device. The other changed fields (viewer permissions, provider summary, merge and update methods) use the same
ForwardCompatibleArrayhelper, which is covered bybaseSchemas.test.ts.Written with Claude Opus 5.5 in Claude Code (T3 Code); reviewed by GPT-6.1-Sol (Codex).