feat(core): add Node ID universal decoder for offline database ID extraction#248
Conversation
Add pure JavaScript implementation for decoding GitHub Node IDs without API calls. Supports both New format (MessagePack+Base64) and Legacy format (text Base64). [Auto-checkpoint from /please:dev Phase 6] Tasks: T001, T002 Files: 2 files added Issue: #244
- Re-export decoder functions from id-converter.ts - Enhance isNodeId() to detect both New and Legacy formats - Add integration tests for re-exported functions [Auto-checkpoint from /please:dev Phase 6] Tasks: T003, T004 Files: 2 files modified Issue: #244
- Add Node ID Formats section (New format: MessagePack+Base64, Legacy format: text Base64) - Add Offline Node ID Decoding section with usage examples - Document decodeNodeId() and extractDatabaseId() functions - Reference Greptile blog for original research Task: T005 Issue: #244
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement by providing a robust, offline utility for decoding GitHub Node IDs and extracting their corresponding Database IDs. This functionality eliminates the need for API calls, offering instant and reliable ID conversion for both modern MessagePack-based Node IDs and older text-based legacy formats. The change improves the tool's independence and performance by enabling local processing of these identifiers. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
이 PR은 API 호출 없이 GitHub Node ID를 로컬에서 디코딩하는 유용한 유틸리티를 추가합니다. 새로운 형식(MessagePack)과 레거시 형식을 모두 지원하며, 외부 의존성 없이 순수 TypeScript로 MessagePack 디코더를 구현한 점이 인상적입니다. 전체적인 코드 품질이 매우 높고, 테스트 커버리지도 훌륭합니다. 코드 중복을 줄이기 위한 작은 리팩토링 제안을 하나 드립니다. 훌륭한 기여에 감사드립니다!
- Add encodeNodeId() function for offline Node ID encoding - Support both type name and prefix input formats - Implement MessagePack array encoder (fixarray, fixint, uint8/16/32) - Add URL-safe Base64 encoding (without padding) - Roundtrip safe: decode(encode(x)) === x - Add 15 new test cases for encoding functionality - Update documentation with encoding examples Issue: #244
Extract common Base64 preparation logic (URL-safe character conversion and padding) into a dedicated prepareBase64() helper function. This reduces code duplication between decodeBase64ToBytes() and decodeBase64ToString() functions. Suggested-by: gemini-code-assist[bot]
|


Summary
encodeNodeId)Changes
src/lib/node-id-decoder.ts: Node ID 디코더/인코더 핵심 구현decodeNodeId(): Node ID 전체 정보 디코딩encodeNodeId(): Database ID → Node ID 인코딩 ✨ NEWextractDatabaseId(): Database ID만 추출isNewNodeId(),isLegacyNodeId(): 형식 감지getNodeIdType(),getNodeIdPrefix(): 타입/프리픽스 추출src/lib/id-converter.ts: 디코더/인코더 함수 통합 및 re-exporttest/lib/node-id-decoder.test.ts: 38개 단위 테스트test/lib/id-converter.test.ts: 통합 테스트 추가docs-dev/GITHUB_ID_SYSTEMS.md: 오프라인 디코딩/인코딩 문서 추가Test plan
Usage Examples
Decoding (Node ID → Database ID)
Encoding (Database ID → Node ID) ✨ NEW
Reference
Closes #244