feat(events): add client-side --match/--top-level/--max-depth filters to json-layouts/json-values (FT-1969)#43
Conversation
…response shape (FT-1969)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR adds client-side filtering for columnar event query results across the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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 docstrings
🧪 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
src/commands/events/events.test.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/commands/events/index.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. src/core/events/json-filter.test.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.
Comment |
Summary
abs events json-layoutsandevents json-valuesreturn a columnar{ columnNames, columnTypes, rows }result with no way to narrow it — debugging goal property paths/values meant piping the JSON into ad-hoc scripts. This adds client-side filtering:events json-layouts:--match <regex>(case-insensitive, filters the path/keycolumn),--top-level(only no-slash paths),--max-depth <n>(paths with at most N/-separated segments;--top-levelis shorthand for--max-depth 1).events json-values:--match <regex>(case-insensitive, filters thevaluecolumn).Filtering is pure client-side post-processing — a single helper
filterColumnarRows(data, column, opts)filtersrowsagainst a named column and preserves the columnar shape, so table and-o jsonoutput are unaffected. Filters compose with AND. Invalid regex / non-positive--max-depthfail fast with a clear error. If the response shape or column is unexpectedly absent, the filter is skipped with a stderr warning (fail-open, but not silent).Bumps CLI version to 1.8.0.
JIRA: FT-1969
Test Plan
filterColumnarRows: regex (case-insensitive, alternation), key vs value column, invalid-regex error, top-level, max-depth, topLevel precedence, bad-depth error, AND composition, no-op returns (no filters / non-columnar / absent column) + non-mutation + stderr-warning behavior--matchCLI errorlatam, goal 164):--match segment_flight→ onlyitems/N/segment_flight_number;--top-level→ only no-slash keys;--match LA8186→ only matching valuesSummary by CodeRabbit
Release Notes
New Features
--matchoption for case-insensitive regex filtering of event data.--top-leveloption to display only top-level paths in layouts.--max-depthoption to limit path nesting depth in results.Documentation