Repository navigation
fix(cli): apply jq filters to batch command output - #4257
Open
rudycelekli wants to merge 2 commits into
Open
rudycelekli wants to merge 2 commits into
rudycelekli wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Empty recursive uploads still bypass EmitBatch and ignore --jq.
1 open finding
What changed in this PR
Routes batch JSON/NDJSON output through the existing jq filter while preserving the canonical envelope.
Changes:
- Extracts reusable batch-envelope construction.
- Applies
--jqfiltering inEmitBatch. - Adds six document-delete regression cases.
| File | Description |
|---|---|
cli/internal/output/batch.go |
Extracts canonical envelope construction. |
cli/internal/cmdutil/batch.go |
Applies jq filters to batch envelopes. |
cli/cmd/doc/delete_jq_test.go |
Tests JSON/NDJSON batch projections. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Batch commands ignored
--jqand emitted the entire envelope even when callers requested a projection. Route JSON/NDJSON batch output through the existing filter using the same envelope construction, preserving verdicts, per-item results, counters, and exit status.Validation
go test -count=1 ./...andgo vet ./...pass.run --new-from-rev=origin/main --concurrency=2 --timeout=2m ./..., passes fromcli/.Validation uses temporary configuration and synthetic loopback HTTP, with no live customer services. Full backend checks remain blocked by uncached backend dependencies; these results cover the CLI module. Developed and reviewed with AI assistance.