Skip to content

Filter PR numbers exceeding GraphQL Int32 bound#51

Merged
RomainCscn merged 1 commit intomainfrom
romain/fix-pr-number-int32-overflow
May 5, 2026
Merged

Filter PR numbers exceeding GraphQL Int32 bound#51
RomainCscn merged 1 commit intomainfrom
romain/fix-pr-number-int32-overflow

Conversation

@RomainCscn
Copy link
Copy Markdown
Collaborator

Summary

extractPullRequestNumbersForCommit scans commit messages for #NNN and forwards each as pullRequestReferences[].number on the release sync mutation. That field is a GraphQL Int (signed 32-bit), so any token above 2,147,483,647 fails the entire mutation.

A real-world example: a commit body containing a Cursor Bugbot review id (#4211934690) overflows the bound. Because getLatestSha() only advances on a successful release, every subsequent push re-includes the same commit and the pipeline stays stuck.

Change

  • Add MAX_PR_NUMBER = 2_147_483_647 and a pushIfValid helper in extractors.ts.
  • Apply the bound to all three extraction paths (squash, merge, message-scan fallback).
  • Drop oversized tokens with a verbose log explaining why.

Tests cover the cursor reproducer, mixed valid+oversized in the fallback, oversized in squash and merge formats, and the boundary (2^31-1 accepted, 2^31 dropped).

A token like #4211934690 in a commit body (e.g. a Cursor Bugbot review id)
was extracted as a PR number and sent to the release sync mutation. Linear's
API types pullRequestReferences[].number as Int (signed 32-bit), so the
mutation was rejected and the release pipeline got stuck — every subsequent
push re-included the offending commit because the last released SHA never
advanced.

Drop any extracted #NNN that exceeds 2^31-1 across all three extraction
paths (squash / merge / message-scan fallback) and log the skip at verbose
level.
@RomainCscn RomainCscn requested a review from axelniklasson May 5, 2026 12:33
@RomainCscn RomainCscn merged commit ff7c6c9 into main May 5, 2026
2 checks passed
@RomainCscn RomainCscn deleted the romain/fix-pr-number-int32-overflow branch May 5, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants