feat(sheets): add updateRecords operation for key-column-based row updates#61
Conversation
…dates
Wire updateRecords into sheets-schemas.ts (Zod schema + operation enum)
and sheets-handler.ts (case dispatch + handler function). The core
implementation in src/modules/sheets/update.ts, SDK spec/runtime/types,
and unit tests already existed — this completes the legacy handler layer.
- SheetsUpdateRecordsSchema: validates spreadsheetId, range, keyColumn,
updates (array of {key, values}), optional sheetName
- handleUpdateRecords: reads sheet, matches key column, updates individual
cells per matched row, returns {updated, notFound, errors, message}
- All 568 tests pass, type-check clean
Closes #55
Related to GDRIVE-22
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 0 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gdrive-mcp | ddcd66e | Commit Preview URL Branch Preview URL |
Mar 28 2026, 08:23 PM |
📊 Type Coverage ReportType Coverage: 98.62% This PR's TypeScript type coverage analysis is complete. |
🔒 Security Scan SummaryGenerated on: Sat Mar 28 20:24:53 UTC 2026 Scan Results
Summary
Recommendations
Security report generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddcd66e1bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue; // skip unknown columns | ||
| } | ||
|
|
||
| const cellRef = `${sheetPrefix}${columnIndexToLetter(colIndex)}${rowIndex + 1}`; |
There was a problem hiding this comment.
Use range origin when building update cell references
handleUpdateRecords computes each target cell as columnIndexToLetter(colIndex) plus rowIndex + 1, which treats the fetched data as if it always starts at A1. For valid inputs like range: 'Contacts!C5:H', this writes to A2, B2, etc. instead of the intended columns/rows under C5, causing updates to land in the wrong part of the sheet and potentially overwrite unrelated data.
Useful? React with 👍 / 👎.
Performance Comparison ReportOperation Performance
Memory Usage
Summary
Performance report generated by Claude Code |
Summary
Closes #55 | Linear: GDRIVE-22
Implements
sheets.updateRecords— update Google Sheet rows by matching a key column value. Enables writing tracking/status data back to a contact sheet after campaign execution.What Changed
The core implementation (module function, SDK spec/runtime/types, unit tests) was already in place. This PR completes the legacy handler layer:
src/sheets/sheets-schemas.tsupdateRecordstoSheetsOperationEnumUpdateEntrySchema(validates{ key, values }entries)SheetsUpdateRecordsSchema(spreadsheetId, range, keyColumn, updates, optional sheetName)SheetsUpdateRecordsSchematoSheetsToolSchemadiscriminated unionsrc/sheets/sheets-handler.tsUpdateRecordsArgstype aliascase 'updateRecords'dispatch in the switch statementhandleUpdateRecordsfunction — reads sheet, locates key column, iterates updates, matches rows by key, writes individual cells, returns{ updated, notFound, errors, message }Acceptance Criteria
{ updated: number, notFound: string[], errors: string[] }Testing
npm run type-checkclean (no errors)src/modules/sheets/__tests__/updateRecords.test.tscover key column matching and notFound reporting