feat(sheets): add copy-paste (fill) command mapping to CopyPasteRequest#663
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 4:00 PM ET / 20:00 UTC. Summary Reproducibility: not applicable. This PR implements a new command rather than fixing broken existing behavior. Source inspection confirms current main only exposes spreadsheet copy, read-only raw, and values batch-update rather than range-level Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow command after normal maintainer review and CI, preserving the existing Sheets helper patterns and adding live disposable-spreadsheet proof only if maintainers want extra API confidence. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR implements a new command rather than fixing broken existing behavior. Source inspection confirms current main only exposes spreadsheet copy, read-only raw, and values batch-update rather than range-level Is this the best way to solve the issue? Yes; mapping the command to Sheets API AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5e4daadbc929. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was no way to copy a range's values/formulas/format to another range — `sheets copy` is sheet-level, `sheets raw` is read-only, and `sheets batch-update` only writes value ranges. Filling per-row formulas down a column meant inlining every fully-spelled-out formula via large value writes (high-token, error-prone). Add `gog sheets copy-paste <spreadsheetId> <source> <dest> [--type=...] [--transpose]` (aliases: fill, copy-range), mapping to the Sheets API's CopyPasteRequest. A destination larger than the source tiles it, so `copy-paste Sheet1!A2:H71 Sheet1!A2:H120 --type=FORMULA` fills the formulas down with relative references adjusted — one call instead of hundreds of inlined formulas. Regenerated the command reference (make docs-commands). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@clawsweeper re-review — restored |
61b4b67 to
6b2a0df
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
# Conflicts: # docs/commands/README.md
Fixes #661.
Problem
There's no primitive to copy a range's formulas/format down or across with relative-reference adjustment.
sheets copyis sheet-level,sheets rawis read-only (Spreadsheets.Get), andsheets batch-updateonly writes value ranges. Filling per-row formulas down a column currently means inlining every fully-spelled-out formula via large value writes — high-token and error-prone.Change
gog sheets copy-paste <spreadsheetId> <source> <dest> [--type=NORMAL|VALUES|FORMAT|FORMULA|NO_BORDERS|DATA_VALIDATION|CONDITIONAL_FORMATTING] [--transpose](aliasesfill,copy-range), mapping tospreadsheets.batchUpdateCopyPasteRequest. A destination larger than the source tiles it, so a fill-down is one call. Built on the existingparseSheetRange/gridRangeFromMap/runSheetsMutation/applySheetsBatchUpdatehelpers (same shape assheets merge). Command reference regenerated viamake docs-commands; no CHANGELOG edit (release-owned).Real-behavior proof (built from this branch)
gog sheets copy-paste --help:--dry-run(fill formulas down a buffer):Tests
internal/cmd/sheets_copy_paste_test.goover the existinghttptestSheets stub: asserts the wire-levelCopyPasteRequest(paste type incl.PASTE_FORMULA, transpose →TRANSPOSEorientation, source/dest GridRanges with a taller destination for fill-down), invalid-type rejection, and empty-range guards.make fmt+make lint(0 issues) +go test ./internal/cmd/green.