Skip to content

garden review apply

garden review apply <pr> applies a whole review from one YAML or JSON document (read from --file, -f -, or a pipe). It creates every comment/reply as a draft, then publishes them and posts the verdict — unless --draft, which stops at drafts you can inspect with garden review status.

# Optional verdict, applied on submit:
# approve -> approve the PR
# comment -> comment-only (this is also the default when omitted)
# A bare "comment" with nothing else is rejected as a no-op.
verdict: approve
# Review comments. Each needs a `body`; the target picks the kind:
comments:
# New inline thread — `at: path:line[:col][-line[:col]]`
- at: api/foo.go:42
body: |
nil check needed — cfg can be unset on the first request.
- at: api/foo.go:42-48 # a line range
body: extract this into a helper
- at: api/foo.go:42:5-42:18 # a column span
body: rename this symbol
rev: 3 # anchor revision (optional; 0/omitted = head)
# Reply to an existing thread — `reply_to: <thread-id>` (id from
# `garden review <pr> --json`). Optionally flip resolution:
- reply_to: <thread-id>
body: fixed in rev 4
resolve: true # or: unresolve: true
# Attach screenshots/video to any comment or reply. `attachments`
# uploads local files and appends them as image embeds; paths are
# relative to this document. Inline `![alt](./path)` refs in `body`
# are uploaded and rewritten too. png/jpg/gif/webp/mp4/webm only.
- at: web/app.tsx:10
body: new empty state
attachments: [before.png, after.png]
# Top-level (PR-level) comment — no `at`, no `reply_to`:
- body: overall the stack looks coherent
# Mark/clear per-file "reviewed" checkpoints (incremental review), applied
# on submit. Paths, or "*" for every file in the current diff.
reviewed: [api/foo.go, api/bar.go] # or: reviewed: ["*"]
unreviewed: [api/legacy.go] # clear a file's checkpoint

Notes:

  • Use reply_to: (not on:) — on is a YAML reserved word.
  • Resolution is draftable: it rides the created comment/reply and only takes effect for others once the review is submitted.
  • A document may contain only reviewed:/unreviewed: (no comments) — a pure “mark these files reviewed” review.
  • A comment may carry attachments: with an empty body: (image-only). To upload a file separately and paste the resource name in by hand, use garden attachment upload <file>.

See also: garden review --help, garden review comment --help.