fix: reject out-of-range base pagination flags#1495
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces ChangesPagination Alias and Typed Validation Rollout
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1495 +/- ##
==========================================
+ Coverage 73.42% 73.43% +0.01%
==========================================
Files 753 753
Lines 70111 70182 +71
==========================================
+ Hits 51476 51540 +64
- Misses 14826 14829 +3
- Partials 3809 3813 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4c36a08 to
9174e1b
Compare
9174e1b to
004a343
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@004a343c6e293786de0a1c73e2b6de38427c2b95🧩 Skill updatenpx skills add zgz2048/cli#codex/base-pagination-validation -y -g |
Test Report: Base Pagination Validation and Hidden AliasScopeValidated the current PR build for Base pagination behavior, including:
Build VerificationCommands run: make build
./lark-cli --version
go version -m ./lark-cliResult:
Live Test ResourceCreated a temporary empty Base with Redacted identifiers:
Live API Smoke TestsCommands verified successfully with real API responses ( ./lark-cli base +table-list --base-token JWvX...dnSb --page-size 40 --as user --format json
./lark-cli base +field-list --base-token JWvX...dnSb --table-id tbleTw6NxkdFq9RZ --page-size 40 --as user --format json
./lark-cli base +field-search-options --base-token JWvX...dnSb --table-id tbleTw6NxkdFq9RZ --field-id fldx3uO5rt --page-size 40 --as user --format json
./lark-cli base +view-list --base-token JWvX...dnSb --table-id tbleTw6NxkdFq9RZ --page-size 40 --as user --format json
./lark-cli base +record-list --base-token JWvX...dnSb --table-id tbleTw6NxkdFq9RZ --page-size 40 --as user --format json
./lark-cli base +record-search --base-token JWvX...dnSb --table-id tbleTw6NxkdFq9RZ --keyword test --search-field fldGvXYA6Q --page-size 40 --as user --format jsonObserved behavior:
Help and Default VerificationSubagent verification covered: ./lark-cli base +table-list --help
./lark-cli base +field-list --help
./lark-cli base +field-search-options --help
./lark-cli base +record-list --help
./lark-cli base +record-search --help
./lark-cli base +view-list --helpResult:
Dry-Run Alias VerificationSubagent dry-run verification covered all changed commands with Result:
No request used Validation BehaviorVerified error cases: ./lark-cli base +table-list --base-token JWvX...dnSb --limit 101 --as user --format json
./lark-cli base +table-list --base-token JWvX...dnSb --page-size 101 --as user --format json
./lark-cli base +table-list --base-token JWvX...dnSb --limit 20 --page-size 40 --as user --format jsonResults:
Subagent also verified
Automated TestsCommands run: go test ./shortcuts/base ./shortcuts/common ./tests/cli_e2e/base -run 'TestBase(Pagination|Limit|ListDryRun)|TestDryRun(Table|Field|Record|View)Ops' -count=1Result: passed. Cleanup NoteAttempted to delete the temporary Base via Drive delete with both user and bot identities, but the current auth/app lacks delete scopes:
The test Base token is intentionally redacted in this report. |
Summary
Reject out-of-range Base pagination flags instead of silently clamping or defaulting them. This makes
--limitand--page-sizefailures explicit and machine-readable for agent callers.Changes
limitandpage-sizepagination flag through the typed range helper.ParseIntBoundedclamp path and reuse the existing min/max validation message shape.Test Plan
make unit-testlark-cli base +table-list --limit 101 --dry-runflow returns a typed validation error viago test ./tests/cli_e2e/base -run 'DryRun|RejectsOutOfRangeLimit' -count=1\n\n## Related Issues\n- NoneSummary by CodeRabbit
Release Notes
New Features
Bug Fixes