[Discover Sessions as Code] Integrate simplified filter schemas - fix type errors & add round-trip tests#257484
Closed
lukasolson wants to merge 12 commits into
Closed
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
… filter integration - Fix type error in get_legacy_log_stream_embeddable_factory.ts: convert API-format sort/columns to stored format using toStoredSort/toStoredColumns - Fix type error in get_search_embeddable_factory.tsx: replace stored-format comparator keys with API-format keys (snake_case) in initializeUnsavedChanges - Fix toStoredSearchEmbeddableState to not include empty grid objects - Add full round-trip tests (stored → API → stored) for by-value state including filters, query, columns, sort, grid, and row heights - Add round-trip test for by-reference state with panel overrides - Add filter-specific round-trip integration tests covering phrase, phrases, exists, range, DSL, and combined (group) filter types - Update search_embeddable_transforms tests for new API-format expectations Resolves remaining tasks from elastic#255213 for elastic#248927. Made-with: Cursor
67b601b to
399d289
Compare
Contributor
Author
|
Closing as this will be included in #255213. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves remaining work items from #255213 for #248927.
This PR builds on top of #255213 (the embeddable transforms PR) and addresses the outstanding tasks:
Changes
Fix type error in
get_legacy_log_stream_embeddable_factory.ts: The legacy log stream factory was passing API-formatsort(objects) andcolumns(objects) toSavedSearchwhich expects stored format (tuples/strings). Now usestoStoredSort()/toStoredColumns()to convert.Fix type error in
get_search_embeddable_factory.tsx: TheinitializeUnsavedChanges<DiscoverSessionEmbeddableState>comparators were using stored-format keys (sampleSize,rowHeight, etc.) and invalid legacy keys (attributes,breakdownField, etc.). Replaced with API-format keys (sample_size,row_height, etc.) matchingDiscoverSessionEmbeddableState.Fix
toStoredSearchEmbeddableState: No longer includes emptygrid: {}when no columns have explicit widths.Add full round-trip tests: End-to-end stored → API → stored tests for both by-value (with filters, query, columns, sort, grid) and by-reference (with panel overrides) states.
Add filter-specific round-trip integration tests: Covers phrase (
is), negated phrases (is_not_one_of), exists, range, custom DSL, and combined group filters throughfromStoredTab/toStoredTab.Update
search_embeddable_transformstests: Migrated a legacy test frommainthat used the oldSearchEmbeddableByValueStatetype to use the newDiscoverSessionEmbeddableByValueStateAPI format.Test plan
transform_utils,search_embeddable_transforms,serialization_utils)Related
Made with Cursor