feat(sheets): add readAsRecords operation#57
Conversation
… type names
Bug 1: Spec advertised nested { formId, question: { title, type } } but handler
expects flat { formId, title, type, required, ... }. Fixed spec to match handler.
Bug 2: Spec used SHORT_ANSWER/PARAGRAPH/SCALE but handler expects
TEXT/PARAGRAPH_TEXT/LINEAR_SCALE. Fixed spec to use correct type names.
Also fixed listTools.ts which used 'questionType' (wrong param name) and 'SCALE'.
Added Linear team ID to CLAUDE.md for future reference.
Implements sheets.readAsRecords — reads a Google Sheet range and returns data as an array of keyed objects using the first row as column headers. - readAsRecords function in src/modules/sheets/read.ts - ReadAsRecordsResult type exported from module index - SDK spec entry in src/sdk/spec.ts (sheets section) - SDK runtime registration in src/sdk/runtime.ts - 4 unit tests covering: keyed objects, header-only, sparse rows, empty sheet AC-1: Returns array of objects with column headers as keys ✓ AC-2: Handles edge cases (empty sheet throws, sparse rows use null) ✓ AC-3: SDK spec and runtime follow existing sheets operation pattern ✓ Closes #50
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR updates the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Type Coverage ReportType Coverage: 98.61% This PR's TypeScript type coverage analysis is complete. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gdrive-mcp | b537a20 | Commit Preview URL Branch Preview URL |
Mar 28 2026, 07:21 PM |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/tools/listTools.ts (1)
141-145: MissingscaleMinLabelandscaleMaxLabelparameters in signature.The signature omits
scaleMinLabel?: stringandscaleMaxLabel?: stringwhich are present insrc/sdk/spec.ts(line 300) and the implementation atsrc/modules/forms/questions.ts. This inconsistency may mislead agents using this tool discovery resource.♻️ Proposed fix to include all LINEAR_SCALE parameters
{ name: 'addQuestion', - signature: 'addQuestion({ formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number })', + signature: 'addQuestion({ formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number, scaleMinLabel?: string, scaleMaxLabel?: string })', description: 'Add a question to a form. QuestionType: TEXT | PARAGRAPH_TEXT | MULTIPLE_CHOICE | CHECKBOX | DROPDOWN | LINEAR_SCALE | DATE | TIME', example: 'forms.addQuestion({ formId: "abc123", title: "Your rating", type: "LINEAR_SCALE", scaleMin: 1, scaleMax: 5 })', },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/tools/listTools.ts` around lines 141 - 145, The tool signature for addQuestion in src/tools/listTools.ts is missing the optional scaleMinLabel?: string and scaleMaxLabel?: string parameters used by the LINEAR_SCALE question type; update the signature string for the entry with name 'addQuestion' to include scaleMinLabel?: string and scaleMaxLabel?: string (matching the parameters defined in src/sdk/spec.ts and the implementation in src/modules/forms/questions.ts) so tool discovery reflects the actual API.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/tools/listTools.ts`:
- Around line 141-145: The tool signature for addQuestion in
src/tools/listTools.ts is missing the optional scaleMinLabel?: string and
scaleMaxLabel?: string parameters used by the LINEAR_SCALE question type; update
the signature string for the entry with name 'addQuestion' to include
scaleMinLabel?: string and scaleMaxLabel?: string (matching the parameters
defined in src/sdk/spec.ts and the implementation in
src/modules/forms/questions.ts) so tool discovery reflects the actual API.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cc775817-050b-4016-92dc-b3ed9794633f
📒 Files selected for processing (4)
.gitignoreCLAUDE.mdsrc/sdk/spec.tssrc/tools/listTools.ts
🔒 Security Scan SummaryGenerated on: Sat Mar 28 19:22:11 UTC 2026 Scan Results
Summary
Recommendations
Security report generated by Claude Code |
Performance Comparison ReportOperation Performance
Memory Usage
Summary
Performance report generated by Claude Code |
Updates @hono/node-server, express-rate-limit, hono, and path-to-regexp to patched versions to address high-severity CVEs reported by npm audit.
📊 Type Coverage ReportType Coverage: 98.61% This PR's TypeScript type coverage analysis is complete. |
Summary
Implements
sheets.readAsRecords— reads a Google Sheet range and returns data as an array of keyed objects using the first row as column headers. Foundational for mail-merge style outreach workflows.Closes #50
Resolves GDRIVE-17
Changes
readAsRecordsfunction insrc/modules/sheets/read.tsReadAsRecordsResulttype exported from module index (src/modules/sheets/index.ts)src/sdk/spec.ts(sheets section)src/sdk/runtime.tssrc/modules/sheets/__tests__/readAsRecords.test.tsAcceptance Criteria
nullTest Evidence
TypeScript type-check: no errors.
Summary by CodeRabbit
Release Notes
New Features
Updates
Chores