Skip to content

feat: Add inspection and scroll paging - #57

Merged
moshloop merged 5 commits into
mainfrom
feat/inspection-scroll-paging
Aug 27, 2026
Merged

feat: Add inspection and scroll paging#57
moshloop merged 5 commits into
mainfrom
feat/inspection-scroll-paging

Conversation

@moshloop

@moshloop moshloop commented Aug 27, 2026

Copy link
Copy Markdown
Member

What

  • Add scroll-based OpenSearch cursor paging by default, with optional PIT mode.
  • Add profile inspection actions and reconciliation request tracking.
  • Render inspection metadata including cardinality, filters, and paging details.

Notes

  • Update cursor validation, conformance coverage, and profile inspection tests.

Summary by CodeRabbit

  • New Features
    • Added profile and connection inspection, including fields, cardinality, filters, limits, paging, cache status, and optional sampling.
    • Added an Inspect action to the profile interface.
    • Added configurable OpenSearch and Elasticsearch paging modes: Scroll or Point in time.
    • Added server-side column sorting with ascending and descending order support.
  • Bug Fixes
    • Restored sorting for server-paged result tables and improved sort parameter handling.
    • Improved reconciliation diagnostics and field labels.

Claude-Session-Id: 01a03cbc-7182-7871-b339-13e6c1c4a005
Claude-Session-Id: aae36fe4-614d-49af-8aa3-6400d2a8c9ea
This change introduces OpenSearch scroll-based pagination as the default cursor mechanism, replacing the previous point-in-time (PIT) only approach. Key additions:

- New `OpenScroll`, `ScrollNext`, and `ClearScroll` methods in the searcher for scroll lifecycle management
- `ScrollRequest` and `ScrollPageRequest` types for scroll API calls
- Refactored `SearchRaw` to use extracted `decodeSearchResponse` helper
- `CursorEncoding` struct replaces `EncodeCursor` parameters for cleaner API
- Cursor version bumped to 5; scroll context support added to cursor payload
- Connection-level `paging_mode` property (scroll|pit) to select backend strategy
- Updated conformance tests and walk implementations to support both paging modes
- New inspection result rendering with cardinality, filter resolution, and paging metadata

Scroll is now the default due to better consistency guarantees and simpler lifecycle management compared to PIT. Connections can explicitly select PIT mode via properties. Cursors validate that the paging mode hasn't changed between requests.(opensearch): add scroll-based paging as default cursor strategy
body: "Add Inspect action to profiles service that samples stored profiles and returns field metadata including cardinality and auto-filters. Improve reconciliation endpoint routing to extract profile names from /profiles/{name}/reconcile paths. Integrate devtools request recorder with reconciliation to track inspection metadata. New inspect_test.go validates that stored profiles are sampled instead of accepting replacement documents."(api): add profile inspection action with reconciliation request tracking
@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
(unknown) 0 0 1 -

Totals: 0 passed · 0 failed · 1 skipped · -

View full results

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 74564cf3-87e5-4c4b-b6b7-c34a424686a2

📥 Commits

Reviewing files that changed from the base of the PR and between d4929d4 and a043340.

📒 Files selected for processing (73)
  • cmd/query/connections/inspect.go
  • cmd/query/connections/inspect_filters.go
  • cmd/query/connections/inspect_sample.go
  • cmd/query/connections/inspect_test.go
  • cmd/query/connections/service.go
  • cmd/query/devtools/handler_test.go
  • cmd/query/devtools/middleware.go
  • cmd/query/profiles/execute_post.go
  • cmd/query/profiles/execution.go
  • cmd/query/profiles/inspect.go
  • cmd/query/profiles/inspect_test.go
  • cmd/query/profiles/openapi.go
  • cmd/query/profiles/openapi_test.go
  • cmd/query/profiles/paging.go
  • cmd/query/profiles/reconcile.go
  • cmd/query/profiles/reconcile_devtools_test.go
  • cmd/query/profiles/sample_test.go
  • cmd/query/profiles/service.go
  • cmd/query/snapshots/manager_test.go
  • cmd/query/www/src/App.tsx
  • cmd/query/www/src/profileInspectAction.tsx
  • cmd/query/www/src/profileInspectOperation.test.ts
  • cmd/query/www/src/profileInspectOperation.ts
  • cmd/query/www/src/profileRowDetails.test.ts
  • cmd/query/www/src/profileRowDetails.tsx
  • cmd/query/www/src/reconcileBench.test.tsx
  • cmd/query/www/src/reconcileBench.tsx
  • cmd/query/www/src/reconcileModel.test.ts
  • cmd/query/www/src/reconcileModel.ts
  • cmd/query/www/src/reconcileResults.test.ts
  • cmd/query/www/src/reconcileResults.tsx
  • logs/opensearch/search.go
  • logs/opensearch/types.go
  • models/opensearch.go
  • query/column_filter_kind.go
  • query/column_filter_target.go
  • query/column_inspection.go
  • query/column_inspection_test.go
  • query/cursor.go
  • query/cursor_test.go
  • query/engine.go
  • query/execute_pages.go
  • query/inspection_result.go
  • query/inspection_result_test.go
  • query/order_derive.go
  • query/order_request.go
  • query/order_request_test.go
  • query/paging.go
  • query/param.go
  • query/processor/dedupe_test.go
  • query/providers/conformance_test.go
  • query/providers/k8slogs.go
  • query/providers/opensearch.go
  • query/providers/opensearch_column_inspection.go
  • query/providers/opensearch_lookup.go
  • query/providers/opensearch_walk.go
  • query/providers/opentelemetry.go
  • query/providers/providers_test.go
  • query/providers/sql.go
  • query/render.go
  • query/row.go
  • query/sample.go
  • query/sample_inspection_columns.go
  • query/sample_resolution.go
  • query/sample_resolution_test.go
  • query/sample_value.go
  • query/schema/connection.go
  • query/schema/connection_providers.go
  • query/schema/profile_instance.go
  • query/schema/schema_test.go
  • schemas/connection.json
  • schemas/src/connections/elasticsearch.json
  • schemas/src/connections/opensearch.json

Walkthrough

This PR adds inspect actions for connections and profiles, request sorting for pageable profiles, OpenSearch scroll paging with configurable paging mode, reconcile request capture in devtools, and related schema, rendering, UI, and test updates.

Changes

Inspection, sorting, paging, and reconcile updates

Layer / File(s) Summary
Inspection result and sample metadata
query/inspection_result.go, query/sample*.go, query/column_inspection.go, query/sample_value.go, query/column_inspection_test.go, query/inspection_result_test.go, cmd/query/profiles/sample_test.go
Adds shared inspection result types, rendering, cache and paging summaries, sample resolution metadata, supplied inspection columns, inspection counts, and tests for sampled inspection output.
Request sorting and sortable result wiring
query/order_*.go, query/render.go, query/row.go, query/engine.go, query/paging.go, query/param.go, cmd/query/profiles/{execution.go,execute_post.go,paging.go,openapi.go}, cmd/query/www/src/{profileRowDetails.tsx,reconcileModel.ts,reconcileResults.tsx}, cmd/query/snapshots/manager_test.go
Adds sortable column discovery, requested order resolution, sort and order transport params, render sort keys, export and OpenAPI support, sortable snapshot requests, and UI state for sorted remote tables.
Connection and profile inspect actions
cmd/query/connections/*, cmd/query/profiles/inspect.go, cmd/query/profiles/service.go, cmd/query/www/src/{App.tsx,profileInspectAction.tsx,profileInspectOperation.ts}
Adds inspect actions for connections and profiles, target and database filters, target discovery, optional inspection sampling merge, inspect result formatting, and a profile Inspect button that opens the action dialog with initial values.
OpenSearch scroll paging mode
logs/opensearch/*, models/opensearch.go, query/cursor.go, query/providers/opensearch*.go, query/providers/opentelemetry.go, query/schema/connection*.go, schemas/.../opensearch.json, schemas/.../elasticsearch.json
Adds scroll request APIs, cursor scroll state, configurable OpenSearch paging mode (scroll or pit), scroll-based page walking and cleanup, provider runtime updates, and connection schema fields for paging mode.
Reconcile capture and field labeling
cmd/query/devtools/middleware.go, cmd/query/devtools/handler_test.go, cmd/query/profiles/reconcile.go, cmd/query/profiles/reconcile_devtools_test.go, cmd/query/www/src/{reconcileBench.tsx,reconcileModel.ts}
Adds devtools capture for /profiles/{name}/reconcile requests and updates reconcile field selection to use field objects and show labels with raw field names.

Sequence Diagram(s)

sequenceDiagram
  participant UI as ProfileInspectButton
  participant Service as profiles Service.Inspect
  participant Store as profile store
  participant Query as query.Sample
  UI->>Service: run inspect action
  Service->>Store: load named profile
  Store-->>Service: profile
  Service->>Query: sample with params and refresh
  Query-->>Service: InspectionResult
  Service-->>UI: inspect response
Loading
sequenceDiagram
  participant Client
  participant Provider as openSearchWalk
  participant Searcher as opensearch.Searcher
  participant OpenSearch
  Client->>Provider: request first page
  Provider->>Searcher: OpenScroll
  Searcher->>OpenSearch: search with scroll
  OpenSearch-->>Searcher: hits + _scroll_id
  Searcher-->>Provider: response
  Client->>Provider: request next page with cursor
  Provider->>Searcher: ScrollNext
  Searcher->>OpenSearch: _search/scroll
  OpenSearch-->>Searcher: next hits + _scroll_id
  Provider->>Searcher: ClearScroll when done
Loading
✨ 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/inspection-scroll-paging
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/inspection-scroll-paging

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.

❤️ Share

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

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
e2e 121 0 0 493ms

Totals: 121 passed · 0 failed · 0 skipped · 493ms

View full results

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
./www 237 0 0 935ms
app 7 0 0 538ms
commands 14 0 0 37ms
connection 10 0 0 32ms
connections 26 0 0 5.1s
context 39 0 0 13ms
db 14 0 1 2ms
dbtest 26 0 0 7.7s
devtools 61 0 0 99ms
drivers 2 0 0 447.627µs
esdsl 140 0 0 12ms
github.com/flanksource/commons-db/cmd/query/connections 135 0 0 350ms
github.com/flanksource/commons-db/cmd/query/internal/app 43 0 0 960ms
github.com/flanksource/commons-db/cmd/query/internal/paramfile 18 0 0 -
github.com/flanksource/commons-db/cmd/query/profiles 197 0 0 11.9s
github.com/flanksource/commons-db/cmd/query/sessions 34 0 0 1.1s
github.com/flanksource/commons-db/connection 37 0 0 10ms
github.com/flanksource/commons-db/context 23 0 0 -
github.com/flanksource/commons-db/db 20 0 2 1.1s
github.com/flanksource/commons-db/dbtest 16 0 0 -
github.com/flanksource/commons-db/fs 7 0 3 -
github.com/flanksource/commons-db/gorm 22 0 0 -
github.com/flanksource/commons-db/inspect/opensearch 7 0 0 -
github.com/flanksource/commons-db/inspect/sql 3 0 0 -
github.com/flanksource/commons-db/kubernetes 14 0 0 -
github.com/flanksource/commons-db/logs 37 0 0 -
github.com/flanksource/commons-db/logs/azureloganalytics 0 0 1 -
github.com/flanksource/commons-db/logs/bigquery 0 0 1 -
github.com/flanksource/commons-db/logs/opensearch 24 0 0 20ms
github.com/flanksource/commons-db/migrate 42 0 0 2.2s
github.com/flanksource/commons-db/pkg/allowlist 3 0 0 -
github.com/flanksource/commons-db/query 16 0 0 10ms
github.com/flanksource/commons-db/query/providers 13 0 0 -
github.com/flanksource/commons-db/secret 7 0 0 -
github.com/flanksource/commons-db/shell 23 0 1 530ms
github.com/flanksource/commons-db/shutdown 1 0 0 -
github.com/flanksource/commons-db/types 9 0 0 -
grammar 6 0 0 2ms
inspect 22 0 0 355ms
k8s 13 0 0 252ms
kubecatalog 2 0 0 333.935µs
labels 157 0 0 13ms
migrate 31 0 0 1.3s
observability 7 0 0 1ms
processor 66 0 0 55ms
profiles 48 0 0 510ms
providers 328 0 10 7.0s
query 679 0 0 3.0s
schema 51 0 0 415ms
secret 17 0 0 16ms
shell 12 0 0 169ms
snapshots 20 0 0 231ms
viewdeps 32 0 0 652ms
workload 10 0 0 9ms

Totals: 2828 passed · 0 failed · 19 skipped · 46.7s

View full results

@moshloop
moshloop merged commit 13df675 into main Aug 27, 2026
10 of 11 checks passed
@moshloop
moshloop deleted the feat/inspection-scroll-paging branch August 27, 2026 08:53
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