Skip to content

feat(sheets): add data validation commands#728

Merged
steipete merged 1 commit into
mainfrom
feat/sheets-validation-710
Jun 10, 2026
Merged

feat(sheets): add data validation commands#728
steipete merged 1 commit into
mainfrom
feat/sheets-validation-710

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • add sheets validation get|set|clear with JSON/plain output, named ranges, common rule types, strict/UI/input-message controls, and dry-run coverage
  • preserve provider-managed table dropdown metadata during validation set, clear, copy/paste, and --copy-validation-from
  • bound large tiled copies, preserve typed table columns, preflight ordinary validation mapped into tables, and wrap fetched sheet/A1/input-message text as untrusted content
  • update generated command docs, safety profiles, and changelog

Closes #710.

Verification

  • DEVELOPER_DIR=/Library/Developer/CommandLineTools make ci
  • autoreview: clean, no accepted/actionable findings
  • disposable live Google Sheets proof with [email protected], followed by Drive trash cleanup:
    • common rule matrix, named/unqualified reads, literal whitespace, clear
    • ordinary and table validation copy for NORMAL, FORMAT, NO_BORDERS, DATA_VALIDATION, small/unbounded/non-multiple destinations, and update copy
    • table set/get/clear, filtered-row guard, partial same-rule copy, TEXT-to-DROPDOWN conversion, DROPDOWN-to-TEXT clearing
    • typed DATE preservation for no-rule copies, mixed table/ordinary sources, effective small-destination preflight, and mapped-cell ordinary validation checks
    • canonical case-insensitive Validation1 named-range read

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 5:34 AM ET / 09:34 UTC.

Summary
Adds a sheets validation get|set|clear command family, generated docs and safety-profile entries, table-managed dropdown handling for validation set/clear/copy paths, untrusted-output wrapping for new Sheets fields, and focused unit/dry-run coverage.

Reproducibility: not applicable. as a proposed feature PR rather than a bug-only report. Current main source and generated docs show no first-class validation command, and the linked issue includes live reproduction context for the table-managed dropdown copy gap.

Review metrics: 3 noteworthy metrics.

  • Diff size: 21 files changed, +3355/-54. This is a large feature PR touching command code, generated docs, tests, safety profiles, and output hygiene.
  • Command surface: 1 command family, 3 subcommands. The PR adds a new user-facing Sheets command family that should receive maintainer command-shape review.
  • Existing behavior touched: 4 paste types carry validation supplements. NORMAL, FORMAT, NO_BORDERS, and DATA_VALIDATION copy-paste paths now invoke table-validation preservation logic.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Have a maintainer explicitly accept or narrow the copy-paste compatibility behavior before merge.

Risk before merge

  • [P1] Existing sheets copy-paste workflows for NORMAL, FORMAT, NO_BORDERS, and DATA_VALIDATION can now run supplemental validation/table-update requests or fail early around table columns instead of only sending the original CopyPaste request; that upgrade behavior should be an explicit maintainer choice before merge.

Maintainer options:

  1. Accept the table-aware copy upgrade (recommended)
    Merge after maintainers accept that existing copy-paste operations involving table validation may now perform supplemental validation/table updates or reject unsafe mappings instead of silently dropping metadata.
  2. Narrow the compatibility surface first
    If maintainers want a lower-risk upgrade, restrict supplemental table-validation behavior to DATA_VALIDATION and --copy-validation-from while leaving NORMAL, FORMAT, and NO_BORDERS copy-paste behavior unchanged.

Next step before merge

  • [P2] No narrow automated repair is indicated; maintainer review should focus on accepting the new command surface and copy-paste compatibility behavior.

Security
Cleared: No concrete security or supply-chain regression was found; the PR does not change CI, dependencies, credentials, or install scripts, and it extends untrusted-output wrapping for new fetched Sheets fields.

Review details

Best possible solution:

Land the feature after maintainer acceptance of the copy-paste compatibility tradeoff and the reported live Google Sheets proof, keeping the focused unit coverage and safety-profile split between read-only get and mutating set/clear.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a proposed feature PR rather than a bug-only report. Current main source and generated docs show no first-class validation command, and the linked issue includes live reproduction context for the table-managed dropdown copy gap.

Is this the best way to solve the issue?

Yes, with maintainer acceptance of the compatibility tradeoff. A first-class sheets validation command family plus table-aware copy handling is a maintainable fit for the requested Sheets API surface, but the expanded behavior on existing copy-paste commands needs explicit review.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against b34e3033913a.

Label changes

Label changes:

  • add P2: This is a normal-priority Sheets feature and metadata-preservation improvement with limited blast radius but meaningful backup/restore value.
  • add merge-risk: 🚨 compatibility: The PR changes existing copy-paste behavior around Sheets table validation by adding supplemental table updates and new early-rejection paths.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this collaborator-authored PR; the body still reports make ci and disposable live Google Sheets verification with cleanup.

Label justifications:

  • P2: This is a normal-priority Sheets feature and metadata-preservation improvement with limited blast radius but meaningful backup/restore value.
  • merge-risk: 🚨 compatibility: The PR changes existing copy-paste behavior around Sheets table validation by adding supplemental table updates and new early-rejection paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this collaborator-authored PR; the body still reports make ci and disposable live Google Sheets verification with cleanup.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its PR review guidance reinforced read-only review without switching branches, and its parseable-output/dry-run expectations were relevant to the new CLI commands. (AGENTS.md:1, b34e3033913a)
  • Current main lacks the requested command family: The current SheetsCmd command tree on main has no Validation subcommand, while rg only finds existing copy-validation support and tests/docs, not sheets validation get|set|clear. (internal/cmd/sheets.go:29, b34e3033913a)
  • PR adds the validation command surface: The PR head defines SheetsValidationCmd with get, set, and clear subcommands and command help matching the requested surface. (internal/cmd/sheets_validation.go:17, 94beb36d0927)
  • PR changes existing copy-paste behavior: The PR head makes sheets copy-paste fetch table validation spans and append supplemental validation/table-update requests for paste types that carry validation. (internal/cmd/sheets_copy_paste.go:85, 94beb36d0927)
  • Unit coverage targets the new behavior: The added test file covers condition construction, validation set/get/clear, named range reads, table validation set/clear, large/sparse copy handling, ordinary-to-table guards, and copy-paste supplemental requests. (internal/cmd/sheets_data_validation_test.go:20, 94beb36d0927)
  • Related issue has live reproduction context: A contributor comment on the linked issue confirms that copy-paste --type DATA_VALIDATION on gog v0.22.0 does not round-trip table-managed dropdowns because the rule lives on the table column rather than per-cell dataValidation.

Likely related people:

  • steipete: Authored the PR and also appears in merged history for Sheets table basics, table row clearing, and recent release/current-main Sheets file ownership. (role: recent area contributor and likely follow-up owner; confidence: high; commits: 322695f78c82, aa7c0a2f90f6, 71a8504d0add; files: internal/cmd/sheets_table.go, internal/cmd/sheets_table_columns.go, internal/cmd/sheets_validation.go)
  • chrischall: Introduced the existing Sheets copy-paste fill command and provided the live reproduction context for the table-managed dropdown validation gap tracked by the linked issue. (role: prior feature contributor and reporter; confidence: high; commits: 1ad331ba0725; files: internal/cmd/sheets_copy_paste.go, docs/commands/gog-sheets-copy-paste.md)
  • Mahmoud Ashraf: Added the existing --copy-validation-from path and helper that this PR extends for table-managed validation preservation. (role: introduced related behavior; confidence: high; commits: 53225e224720; files: internal/cmd/sheets.go, internal/cmd/sheets_validation.go, internal/cmd/sheets_update_validation_test.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 10, 2026
@steipete
steipete merged commit e1be268 into main Jun 10, 2026
9 checks passed
@steipete
steipete deleted the feat/sheets-validation-710 branch June 10, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sheets): data-validation get / set / clear commands

1 participant