Skip to content

feat(events): render json-layouts/json-values as a table by default (FT-1970)#45

Merged
joalves merged 2 commits into
mainfrom
feat/FT-1970/events-json-table
May 29, 2026
Merged

feat(events): render json-layouts/json-values as a table by default (FT-1970)#45
joalves merged 2 commits into
mainfrom
feat/FT-1970/events-json-table

Conversation

@joalves
Copy link
Copy Markdown
Collaborator

@joalves joalves commented May 29, 2026

Summary

events json-layouts and events json-values printed the raw columnar API object ({columnNames, columnTypes, rows}), which is hard to read. They now mirror the existing events list/history pattern and render a proper table by default:

  • default → row-oriented table (json-layouts: key | value_type | last_event_at; json-values: value | last_event_at)
  • -o json → a clean array of row objects
  • --raw → the columnar {columnNames, columnTypes, rows} object (unchanged escape hatch)

Client-side filters (--match/--top-level/--max-depth) still run first on the columnar data, then conversion — so filtering + table compose. Reuses the existing columnarToRows helper; no new abstractions.

Bumps CLI version to 1.10.0.

JIRA: FT-1970

Test Plan

  • Updated existing json-layouts/json-values filter tests to the row-object shape
  • Added tests: default renders row objects; --raw keeps the columnar shape (both commands)
  • Full suite green (2533 passed, 0 failed); typecheck + lint + prettier clean
  • After merge: abs --profile latam events json-layouts --source unit_goal_property --phase after_enrichment --source-id 164 --from 14d --match segment_flight renders a table; --raw still returns columnar

Summary by CodeRabbit

Release Notes

  • New Features

    • json-values and json-layouts commands now support conditional output formatting via the --raw flag to preserve original columnar data structure.
  • Tests

    • Enhanced test coverage for json-values and json-layouts commands with improved render mode validation.
  • Chores

    • Package version updated to 1.10.0.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9bf9d086-8bcb-4ad5-94bc-eacd1d6b0f3f

📥 Commits

Reviewing files that changed from the base of the PR and between 4e31d5b and 6a2a166.

📒 Files selected for processing (3)
  • package.json
  • src/commands/events/events.test.ts
  • src/commands/events/index.ts

Walkthrough

This pull request introduces conditional output formatting for the json-values and json-layouts commands. When the --raw flag is disabled, client-filtered columnar results are now converted to row objects for human-readable output; when --raw is enabled, the columnar structure is preserved. Test assertions have been updated to validate the new row-object output shape, and comprehensive new test coverage confirms that --raw mode correctly preserves the columnar payload. The package version has been bumped to 1.10.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • absmartly/cli-ts#43: This PR's conditional output formatting logic directly extends the columnar client-side filtering behaviour introduced in that PR, enabling both human-readable row output and raw columnar output modes.

Poem

🐰 A formatter hops with dual delight,
Raw or rounded, the output's just right!
Tests verify both the paths that we take,
Version bumped up for the feature we make.
Column and row dance—a well-tested sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately describes the main change: adding table-by-default rendering for json-layouts and json-values commands, which aligns with the core modifications across package.json, index.ts, and test files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/FT-1970/events-json-table

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/commands/events/events.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/commands/events/index.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands and usage tips.

@joalves joalves added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit 1e823ba May 29, 2026
5 checks passed
@joalves joalves deleted the feat/FT-1970/events-json-table branch May 29, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant