Every GitHub object has two IDs
When building a feature for Greptile, an AI-powered code review tool, the engineering team encountered a challenge with GitHub's dual identification systems. They needed database IDs (integers) to generate clickable URLs for pull request comments, but their database only contained GraphQL node IDs (base64 strings). Instead of performing a massive data migration, they reverse-engineered the node ID structure. By decoding the base64 strings, they discovered that GitHub uses MessagePack to serialize arrays containing repository and object IDs. This finding allowed them to extract the required 32-bit database IDs directly from the node IDs using a simple bitmask and the MessagePack protocol. The investigation also revealed legacy ID formats and the complexities of GitHub's internal transitions from string-based enums to structured binary identifiers.
Summaries are AI-generated to help you scan faster. Open the original source for full context.