Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"risk-engine-configuration": "533a0a3f2dbef1c95129146ec4d5714de305be1a",
"rules-settings": "53f94e5ce61f5e75d55ab8adbc1fb3d0937d2e0b",
"sample-data-telemetry": "c38daf1a49ed24f2a4fb091e6e1e833fccf19935",
"search": "edb9e325564c504e6c49f94115509dc28ccc4b81",
"search": "5078b5f3bc5ed31cd8c16317f17100637734ea2b",
"search-session": "fae0dfc63274d6a3b90ca583802c48cab8760637",
"search-telemetry": "1bbaf2db531b97fa04399440fa52d46e86d54dd8",
"search_playground": "3eba7e7c4563f03f76aea02f5dd3a7a739bf51a3",
Expand Down Expand Up @@ -989,6 +989,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"search|global: ce649a79d99c5ff5eb68d544635428ef87946d84",
"search|mappings: 432d4dfdb5a33ce29d00ccdcfcda70d7c5f94b52",
"search|schemas: 8d6477e08dfdf20335752a69994646f9da90741f",
"search|10.7.0: 39a6319c8a1cee1b3d3be546cff40381ada5c12a",
"search|10.6.0: 09025aae257ec5255b431558a613ec85b5b2defe",
"search|10.5.0: 1c03deb42d6a3e2e6b889fe9cfb72059dc0a27fb",
"search|10.4.0: 1186c880ca98f18121211a92912c5b1748cb8b5a",
Expand Down Expand Up @@ -1316,7 +1317,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"risk-engine-configuration": "10.2.0",
"rules-settings": "10.1.0",
"sample-data-telemetry": "10.0.0",
"search": "10.6.0",
"search": "10.7.0",
"search-session": "10.0.0",
"search-telemetry": "10.0.0",
"search_playground": "10.1.0",
Expand Down Expand Up @@ -1461,7 +1462,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"risk-engine-configuration": "10.2.0",
"rules-settings": "10.1.0",
"sample-data-telemetry": "0.0.0",
"search": "10.6.0",
"search": "10.7.0",
"search-session": "8.6.0",
"search-telemetry": "7.12.0",
"search_playground": "10.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
updateOptionsSchema,
createResultSchema,
} from '@kbn/content-management-utils';
import { SCHEMA_SEARCH_MODEL_VERSION_6 } from '../../../saved_objects/schema';
import { SCHEMA_SEARCH_MODEL_VERSION_7 } from '../../../saved_objects/schema';

const savedSearchSavedObjectSchema = savedObjectSchema(SCHEMA_SEARCH_MODEL_VERSION_6);
const savedSearchSavedObjectSchema = savedObjectSchema(SCHEMA_SEARCH_MODEL_VERSION_7);

const savedSearchCreateOptionsSchema = schema.maybe(
schema.object({
Expand Down Expand Up @@ -56,7 +56,7 @@ export const serviceDefinition: ServicesDefinition = {
schema: savedSearchCreateOptionsSchema,
},
data: {
schema: SCHEMA_SEARCH_MODEL_VERSION_6,
schema: SCHEMA_SEARCH_MODEL_VERSION_7,
},
},
out: {
Expand All @@ -71,7 +71,7 @@ export const serviceDefinition: ServicesDefinition = {
schema: savedSearchUpdateOptionsSchema,
},
data: {
schema: SCHEMA_SEARCH_MODEL_VERSION_6,
schema: SCHEMA_SEARCH_MODEL_VERSION_7,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,18 @@ export type DiscoverSessionTab = TypeOf<typeof SCHEMA_DISCOVER_SESSION_TAB>;
export const SCHEMA_SEARCH_MODEL_VERSION_6 = SCHEMA_SEARCH_MODEL_VERSION_5.extends({
tabs: schema.maybe(schema.arrayOf(SCHEMA_DISCOVER_SESSION_TAB, { minSize: 1 })),
});

const { columns, grid, hideChart, isTextBasedQuery, kibanaSavedObjectMeta, rowHeight, sort } =
SCHEMA_SEARCH_MODEL_VERSION_6.getPropSchemas();

// Mark top-level attributes (except title and description) optional, and mark tabs as required
export const SCHEMA_SEARCH_MODEL_VERSION_7 = SCHEMA_SEARCH_MODEL_VERSION_6.extends({
columns: schema.maybe(columns),
Copy link
Copy Markdown
Contributor Author

@lukasolson lukasolson Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only includes the properties that were not already marked as optional (schema.maybe).

grid: schema.maybe(grid),
hideChart: schema.maybe(hideChart),
isTextBasedQuery: schema.maybe(isTextBasedQuery),
kibanaSavedObjectMeta: schema.maybe(kibanaSavedObjectMeta),
rowHeight: schema.maybe(rowHeight),
sort: schema.maybe(sort),
tabs: schema.arrayOf(SCHEMA_DISCOVER_SESSION_TAB, { minSize: 1 }),
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
SCHEMA_SEARCH_MODEL_VERSION_4,
SCHEMA_SEARCH_MODEL_VERSION_5,
SCHEMA_SEARCH_MODEL_VERSION_6,
SCHEMA_SEARCH_MODEL_VERSION_7,
} from './schema';

export function getSavedSearchObjectType(
Expand Down Expand Up @@ -95,6 +96,13 @@ export function getSavedSearchObjectType(
create: SCHEMA_SEARCH_MODEL_VERSION_6,
},
},
7: {
changes: [],
schemas: {
forwardCompatibility: SCHEMA_SEARCH_MODEL_VERSION_7.extends({}, { unknowns: 'ignore' }),
create: SCHEMA_SEARCH_MODEL_VERSION_7,
},
},
},
mappings: {
dynamic: false,
Expand Down