Repository navigation
feat(drive): return the committed revision from guarded uploads - #1346
nomadonwheels196 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesAdds an opt-in flag that returns available committed revision and checksum fields from a guarded Drive upload response. Example: Replace file1 at version 42 using --include-committed-revision --json.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it adds a distinct capability absent from main and implements the same author’s open request; the new flag still needs a product decision. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Drive upload command validates local input, performs the existing version-and-ETag guarded update through Drive v2, and formats the update response for scripts or terminal users. flowchart TD
A[CLI upload arguments] --> B[Validate upload options]
B --> C[Read version and ETag]
C --> D[Single conditional media update]
D --> E[Map returned file metadata]
E --> F[JSON or text output]
Technical reviewBest possible solution: Expose available receipt fields through the existing guarded update response while preserving default output and single-attempt guarantees. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the receipt fields are excluded from both the guarded update field mask and output mapping; no target code or tests were run. Is this the best way to solve the issue? Using the existing update response avoids the later-read race with a small extension; revision-list and metadata-read commands cannot reliably identify this particular write after another writer advances the file. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae8dbb2eef93. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 21, 2026, 5:16 PM ET / 22:16 UTC. |
What Problem This Solves
Scripts using
gog drive upload --replace --if-versionneed the exact revision their update committed. A subsequent metadata read can see a newer revision from another writer.User Impact
Add
--include-committed-revisionto a conditional replacement and use--jsonto getfile.headRevisionId,file.sha256Checksumandfile.md5Checksumfrom the update response when available. Existing JSON and text output stay compatible when the flag is omitted.Why This Change Was Made
The flag expands the field mask of the existing conditional Drive v2 upload. It preserves the file version and ETag checks and returns the provider fields from that same write, with no follow-up metadata request. Missing receipt fields remain absent. An HTTP 412 still reports a conflict, and an ambiguous failure still gets one write attempt.
Evidence
Local HTTP fixtures cover the exact conditional request, the committed response, default output, a response with missing receipt fields, a competing write, and a server failure. CLI cases cover invalid flag combinations and the dry-run output. Live Google Drive integration was not run.
On macOS the two packages passed 3,916 tests and 3,736 subtests. The existing interactive Keychain test skipped because the test runner had no unlocked Keychain.
Relates to #1345.