feat(cli): add text list column controls (#165)#252
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThe CLI adds ChangesText table column controls
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/project.ts`:
- Line 90: Validate and resolve --columns before credentials or network access:
in src/commands/project.ts lines 90-90, preflight text columns before
makeClient; in src/commands/test.ts lines 541-543, add the same preflight for
test list; and in src/commands/test.ts lines 4524-4524, validate history columns
before listTestRuns, including empty results. Ensure unknown column keys
consistently produce validation exit code 5.
In `@src/commands/test.ts`:
- Line 4446: Update the run-history output branching around
renderRunHistoryTable so JSON, CSV, and NDJSON all use their existing machine
serializers before processing table options. Ensure --columns and --noHeader are
ignored in every machine-output mode, while preserving the current table
rendering only for text output.
- Around line 4526-4547: Update the history formatting flow around
includeDetailLines in src/commands/test.ts:4526-4547 so options.noHeader
suppresses only the header and separator, while targetUrl detail lines remain
enabled whenever custom columns are not selected. Update the expected output in
src/commands/test.result.history.spec.ts:260-264 to retain the targetUrl: line
while omitting only the header and separator.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: aa362466-4282-4b03-8536-ced07cfe82a3
⛔ Files ignored due to path filters (1)
test/__snapshots__/help.snapshot.test.ts.snapis excluded by!**/*.snap,!**/*.snap
📒 Files selected for processing (6)
src/commands/project.test.tssrc/commands/project.tssrc/commands/test.result.history.spec.tssrc/commands/test.test.tssrc/commands/test.tssrc/lib/text-table.ts
|
All code checks are passing (CI, coverage, CodeRabbit). The remaining failing \gate\ check is crashing before it reaches the issue-link/assignment validation with \Cannot find module '@actions/github'\ inside \�ctions/github-script. Issue #165 is now assigned to @naufalfx805-source and the PR body closes #165. |
What does this PR do?
Adds text-table shaping controls for the list surfaces from #165:
--columns <list>selects and reorders text table columns by normalized header key.--no-headersuppresses the text table header row.project list,test list, andtest result --historyin text mode.--output json.The implementation centralizes text-table column parsing/rendering in
src/lib/text-table.ts, while keeping each command's column definitions local to the existing renderer.Related issue
Closes #165
Type of change
Checklist
mainbranch.npm run lintpasses.npm run typecheckpasses.Notes for reviewers
Local verification:
npm run lintnpm run buildnpm run typechecknpm test -- src/commands/project.test.ts src/commands/test.test.ts src/commands/test.result.history.spec.ts(381 passed)project list,test list, andtest result --historywith--columns ... --no-headernpm test -- test/help.snapshot.test.tsis blocked on this Windows host before snapshot comparison byspawnSync npm ENOENTin the test harness. I updated the affected help snapshots manually from the built CLI output.Summary by CodeRabbit
--columns <list>to customize, select, and reorder columns in project and test list outputs.--no-headerto suppress table headers (including test result history).--columnsvalues now fail fast with a clearVALIDATION_ERROR(details.field: columns, exit code 5).--columnsand--no-header.