fix: allow jq examples in quality gate dry-runs#1979
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDry-run command preparation now validates jq and output flags, removes compatible jq filters from preview invocations, conditionally normalizes pretty output to JSON, and preserves invalid combinations for deterministic CLI errors. Tests cover request previews and argument variants. ChangesDry-run jq handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@5cdcefcea4ef0149e91dbc8747353ed6606d2591🧩 Skill updatenpx skills add larksuite/cli#fix/quality-gate-jq-dry-run -y -g |
Summary
The deterministic quality gate executes documented CLI examples with
--dry-runto validate their request previews. Examples using-qor--jqcould filter the synthetic dry-run envelope intonullor fail at runtime, causing valid examples such as those in PR #1906 to be rejected.This change validates jq-related output flags first, then removes valid jq filters only from the synthetic dry-run invocation so the underlying request preview remains available for validation.
Changes
--formatand--outputbefore normalizing dry-run examples.-qand--jqfilters from synthetic dry-run invocations while preserving the original documented command.im +flag-listexample affected in PR fix(im): warn when flag pagination is truncated #1906.Test Plan
go test ./internal/qualitygate/... -count=1go vet ./...go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=upstream/mainQUALITY_GATE_CHANGED_FROM=upstream/main make quality-gatego mod tidyproduced no changesim +flag-list -q ...examples produced the expectedGET /open-apis/im/v1/flagsrequest previewThe full stock-example scan also reported pre-existing unrelated reference and placeholder-validation findings outside this PR's changed files.
Related Issues
Summary by CodeRabbit
jqoutput filters.