From b477847d04a6c5217ae4bcc0ddec95042879863b Mon Sep 17 00:00:00 2001 From: hammad-nasir-elastic Date: Fri, 30 Jan 2026 15:57:12 -0500 Subject: [PATCH 1/7] Implement fallback to test mode in saved objects CLI checks - Added a new task to fallback to test mode when no real saved object types have been updated, ensuring migration logic is tested on every PR. - Updated TaskContext to include a flag for fallback mode. - Adjusted automated rollback tests to utilize test baseline mappings in both test and fallback modes. --- .../commands/run_check_saved_objects_cli.ts | 16 ++++++ .../tasks/automated_rollback_tests.ts | 7 ++- .../commands/tasks/fallback_to_test_mode.ts | 50 +++++++++++++++++++ .../src/commands/tasks/index.ts | 1 + .../src/commands/types.ts | 1 + 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts diff --git a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts index 0f92028cd121a..30cd31ad6b6a3 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts @@ -14,6 +14,7 @@ import type { TaskContext } from './types'; import { automatedRollbackTests, checkRemovedTypes, + fallbackToTestMode, getSnapshots, validateNewTypes, validateUpdatedTypes, @@ -126,6 +127,21 @@ export function runCheckSavedObjectsCli() { task: validateUpdatedTypes, enabled: !server, }, + /** + * ================================================================== + * Fallback to test mode when no real SO types have been updated. + * + * This provides a smoke test for the migration logic on every PR, + * ensuring no regressions in the migration code even when no SO + * type definitions have changed. + * ================================================================== + */ + { + title: 'Fallback to test mode (no updated types detected)', + task: fallbackToTestMode, + enabled: !server && !test, + skip: (ctx) => ctx.updatedTypes.length > 0 || globalTask.errors.length > 0, + }, { title: 'Automated rollback tests', task: automatedRollbackTests, diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts index b942e193d090e..dbf1861cf1926 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts @@ -17,6 +17,9 @@ import { fileToJson, getFileFromKibanaRepo } from '../../util'; import { BASELINE_MAPPINGS_TEST } from '../test'; export const automatedRollbackTests: Task = (ctx, task) => { + // Use test baseline mappings in test mode OR fallback mode + const useTestBaseline = ctx.test || ctx.fallbackToTestMode === true; + const subtasks: ListrTask[] = [ { title: 'Fetch baseline mappings', @@ -26,7 +29,7 @@ export const automatedRollbackTests: Task = (ctx, task) => { ref: ctx.gitRev, })), retry: { tries: 5, delay: 2_000 }, - enabled: () => !ctx.test, + enabled: () => !useTestBaseline, }, { title: 'Fetch baseline mappings (test mode)', @@ -34,7 +37,7 @@ export const automatedRollbackTests: Task = (ctx, task) => { (ctx.baselineMappings = (await fileToJson( BASELINE_MAPPINGS_TEST )) as SavedObjectsTypeMappingDefinitions), - enabled: () => ctx.test, + enabled: () => useTestBaseline, }, { title: 'Create baseline', diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts new file mode 100644 index 0000000000000..7e5dcfe48dfd1 --- /dev/null +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { defaultKibanaIndex } from '@kbn/migrator-test-kit'; +import type { Task } from '../types'; +import { TEST_TYPES } from '../test'; +import { takeSnapshot } from '../../snapshots'; +import { getLatestTypeFixtures } from '../../migrations/fixtures'; +import { getVersions } from '../../migrations/versions'; + +/** + * Fallback to test mode when no real SO types have been updated. + * + * This provides a smoke test for the migration logic on every PR, + * ensuring no regressions in the migration code even when no SO + * type definitions have changed. + */ +export const fallbackToTestMode: Task = async (ctx, task) => { + ctx.updatedTypes = TEST_TYPES.map((type) => ({ + ...type, + indexPattern: defaultKibanaIndex, + })); + ctx.fallbackToTestMode = true; + ctx.to = await takeSnapshot(ctx.updatedTypes); + + // Load fixtures for each test type + for (const type of ctx.updatedTypes) { + const { name } = type; + const typeSnapshot = ctx.to.typeDefinitions[name]; + const [current, previous] = getVersions(typeSnapshot); + + const typeFixtures = await getLatestTypeFixtures({ + type, + current, + previous, + fix: ctx.fix, + }); + + ctx.fixtures.previous[name] = typeFixtures.previous; + ctx.fixtures.current[name] = typeFixtures.current; + } + + task.title = `Fallback to test mode: using ${ctx.updatedTypes.length} test types for rollback tests`; +}; diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts index 813bf94f7be37..56a3b77a8d457 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts @@ -12,3 +12,4 @@ export { validateNewTypes } from './validate_new_types'; export { validateUpdatedTypes } from './validate_updated_types'; export { automatedRollbackTests } from './automated_rollback_tests'; export { checkRemovedTypes } from './check_removed_types'; +export { fallbackToTestMode } from './fallback_to_test_mode'; \ No newline at end of file diff --git a/packages/kbn-check-saved-objects-cli/src/commands/types.ts b/packages/kbn-check-saved-objects-cli/src/commands/types.ts index e2d1937ca03ff..4e1924bb2d377 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/types.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/types.ts @@ -36,4 +36,5 @@ export interface TaskContext { }; test: boolean; // whether the script is running with TEST data fix: boolean; + fallbackToTestMode?: boolean; // whether we're using test data as fallback (no real SO types updated) } From d720721cc2395cebafadc780c14206fd55355cd4 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 30 Jan 2026 21:37:50 +0000 Subject: [PATCH 2/7] Changes from node scripts/eslint_all_files --no-cache --fix --- .../kbn-check-saved-objects-cli/src/commands/tasks/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts index 56a3b77a8d457..05b463cd6424b 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts @@ -12,4 +12,4 @@ export { validateNewTypes } from './validate_new_types'; export { validateUpdatedTypes } from './validate_updated_types'; export { automatedRollbackTests } from './automated_rollback_tests'; export { checkRemovedTypes } from './check_removed_types'; -export { fallbackToTestMode } from './fallback_to_test_mode'; \ No newline at end of file +export { fallbackToTestMode } from './fallback_to_test_mode'; From b5783dddb8e18b40d13e89026eeed752bbac987a Mon Sep 17 00:00:00 2001 From: hammad-nasir-elastic Date: Mon, 2 Feb 2026 12:43:22 -0500 Subject: [PATCH 3/7] Always run Saved Objects checks as a smoke test for migration logic in the pull request pipeline. --- .../scripts/pipelines/pull_request/pipeline.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 324254786ccfe..ac2c0bdf6c5d9 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -519,16 +519,8 @@ const SKIPPABLE_PR_MATCHERS = prConfig.skip_ci_on_only_changed!.map((r) => new R pipeline.push(getPipeline('.buildkite/pipelines/pull_request/prompt_changes.yml')); } - // Run Saved Objects checks conditionally - if ( - await doAnyChangesMatch([ - /^packages\/kbn-check-saved-objects-cli\/current_fields.json/, - /^packages\/kbn-check-saved-objects-cli\/current_mappings.json/, - /^src\/core\/server\/integration_tests\/ci_checks\/saved_objects\/check_registered_types.test.ts/, - ]) - ) { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml')); - } + // Always run Saved Objects checks as a smoke test for migration logic + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml')); if ( (await doAnyChangesMatch([ From 99ce18e2d04c3fe6eca7af089470021db3c5a312 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:00:48 +0000 Subject: [PATCH 4/7] Changes from yarn openapi:bundle --- oas_docs/bundle.json | 182 +++++++++++++++++++++++++++++--- oas_docs/bundle.serverless.json | 182 +++++++++++++++++++++++++++++--- 2 files changed, 336 insertions(+), 28 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index f8ef17734e065..5b24d56d09730 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -1222,7 +1222,7 @@ }, "/api/agent_builder/agents": { "get": { - "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents", "parameters": [], "responses": { @@ -1293,7 +1293,7 @@ "x-state": "Added in 9.2.0" }, "post": { - "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-agents", "parameters": [ { @@ -1465,7 +1465,7 @@ }, "/api/agent_builder/agents/{id}": { "delete": { - "description": "Delete an agent by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete an agent by ID. This action cannot be undone. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-agents-id", "parameters": [ { @@ -1512,7 +1512,7 @@ "x-state": "Added in 9.2.0" }, "get": { - "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents-id", "parameters": [ { @@ -1571,7 +1571,7 @@ "x-state": "Added in 9.2.0" }, "put": { - "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-agents-id", "parameters": [ { @@ -2483,7 +2483,7 @@ }, "/api/agent_builder/converse": { "post": { - "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/chat).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-converse", "parameters": [ { @@ -2954,9 +2954,19 @@ }, "/api/agent_builder/mcp": { "post": { - "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.\nTo learn more, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-mcp", - "parameters": [], + "parameters": [ + { + "description": "Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.", + "in": "query", + "name": "namespace", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -3021,7 +3031,7 @@ }, "/api/agent_builder/tools": { "get": { - "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools", "parameters": [], "responses": { @@ -3195,7 +3205,7 @@ "x-state": "Added in 9.2.0" }, "post": { - "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-tools", "parameters": [ { @@ -3398,7 +3408,7 @@ }, "/api/agent_builder/tools/_execute": { "post": { - "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-tools-execute", "parameters": [ { @@ -3703,7 +3713,7 @@ }, "/api/agent_builder/tools/{toolId}": { "delete": { - "description": "Delete a tool by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete a tool by ID. This action cannot be undone. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-tools-toolid", "parameters": [ { @@ -3750,7 +3760,7 @@ "x-state": "Added in 9.2.0" }, "get": { - "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools-toolid", "parameters": [ { @@ -3887,7 +3897,7 @@ "x-state": "Added in 9.2.0" }, "put": { - "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-tools-toolid", "parameters": [ { @@ -57355,6 +57365,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -62268,6 +62301,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -65416,6 +65450,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -70329,6 +70386,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -73011,6 +73069,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -77924,6 +78005,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -80721,6 +80803,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -85634,6 +85739,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -88269,6 +88375,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -93182,6 +93311,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -95790,6 +95920,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -100703,6 +100856,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index e95f2b7d8af5a..a484eca3e7e04 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -1222,7 +1222,7 @@ }, "/api/agent_builder/agents": { "get": { - "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents", "parameters": [], "responses": { @@ -1293,7 +1293,7 @@ "x-state": "" }, "post": { - "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-agents", "parameters": [ { @@ -1465,7 +1465,7 @@ }, "/api/agent_builder/agents/{id}": { "delete": { - "description": "Delete an agent by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete an agent by ID. This action cannot be undone. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-agents-id", "parameters": [ { @@ -1512,7 +1512,7 @@ "x-state": "" }, "get": { - "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents-id", "parameters": [ { @@ -1571,7 +1571,7 @@ "x-state": "" }, "put": { - "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-agents-id", "parameters": [ { @@ -2483,7 +2483,7 @@ }, "/api/agent_builder/converse": { "post": { - "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/chat).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-converse", "parameters": [ { @@ -2954,9 +2954,19 @@ }, "/api/agent_builder/mcp": { "post": { - "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.\nTo learn more, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-mcp", - "parameters": [], + "parameters": [ + { + "description": "Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.", + "in": "query", + "name": "namespace", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -3021,7 +3031,7 @@ }, "/api/agent_builder/tools": { "get": { - "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools", "parameters": [], "responses": { @@ -3195,7 +3205,7 @@ "x-state": "" }, "post": { - "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-tools", "parameters": [ { @@ -3398,7 +3408,7 @@ }, "/api/agent_builder/tools/_execute": { "post": { - "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-tools-execute", "parameters": [ { @@ -3703,7 +3713,7 @@ }, "/api/agent_builder/tools/{toolId}": { "delete": { - "description": "Delete a tool by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete a tool by ID. This action cannot be undone. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-tools-toolid", "parameters": [ { @@ -3750,7 +3760,7 @@ "x-state": "" }, "get": { - "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools-toolid", "parameters": [ { @@ -3887,7 +3897,7 @@ "x-state": "" }, "put": { - "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-tools-toolid", "parameters": [ { @@ -56423,6 +56433,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -61336,6 +61369,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -64484,6 +64518,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -69397,6 +69454,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -72079,6 +72137,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -76992,6 +77073,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -79789,6 +79871,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -84702,6 +84807,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -87337,6 +87443,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -92250,6 +92379,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -94858,6 +94988,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -99771,6 +99924,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { From ec85d2e07b2d17166fda53efc1cf39575b2d30da Mon Sep 17 00:00:00 2001 From: hammad-nasir-elastic Date: Fri, 6 Feb 2026 15:10:42 -0500 Subject: [PATCH 5/7] Refactor saved objects CLI validation tasks - Removed fallback to test mode functionality and related tasks. - Introduced new validation tasks: `validateSOChanges` and `validateTestFlow`. - Updated `TaskContext` to remove `fallbackToTestMode` property. - Adjusted automated rollback tests to use the new context structure. --- .../commands/run_check_saved_objects_cli.ts | 59 +++++-------------- .../tasks/automated_rollback_tests.ts | 7 +-- .../commands/tasks/fallback_to_test_mode.ts | 50 ---------------- .../src/commands/tasks/index.ts | 6 +- .../src/commands/tasks/validate_so_changes.ts | 40 +++++++++++++ .../src/commands/tasks/validate_test_flow.ts | 34 +++++++++++ .../src/commands/types.ts | 1 - 7 files changed, 93 insertions(+), 104 deletions(-) delete mode 100644 packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts create mode 100644 packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts create mode 100644 packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_test_flow.ts diff --git a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts index 30cd31ad6b6a3..3b1062daf8565 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts @@ -13,13 +13,10 @@ import { setupKibana, startElasticsearch, stopElasticsearch, stopKibana } from ' import type { TaskContext } from './types'; import { automatedRollbackTests, - checkRemovedTypes, - fallbackToTestMode, getSnapshots, - validateNewTypes, - validateUpdatedTypes, + validateSOChanges, + validateTestFlow, } from './tasks'; -import { getTestSnapshots, TEST_TYPES } from './test'; export function runCheckSavedObjectsCli() { let globalTask: Listr; @@ -91,56 +88,30 @@ export function runCheckSavedObjectsCli() { }, /** * ================================================================== - * The following tasks only run in "--test mode". + * Validate SO changes. * - * Instead of starting Kibana and getting the actual typeRegistry - * we use a test registry with a bunch of fake SO types. + * Checks for removed types, new types, and updated types. * ================================================================== */ { - title: 'Obtain type registry (test mode)', - task: async (ctx) => (ctx.registeredTypes = TEST_TYPES), - enabled: !server && test, - }, - { - title: 'Get type registry snapshots (test mode)', - task: getTestSnapshots, - enabled: !server && test, - }, - /** - * ================================================================== - * The following tasks run systematically - * ================================================================== - */ - { - title: 'Check removed SO types', - task: checkRemovedTypes, - enabled: !server, - }, - { - title: 'Validate new SO types', - task: validateNewTypes, - enabled: !server, - }, - { - title: 'Validate existing SO types', - task: validateUpdatedTypes, - enabled: !server, + title: 'Validate SO changes', + task: validateSOChanges, + enabled: !server && !test, + skip: test, }, /** * ================================================================== - * Fallback to test mode when no real SO types have been updated. + * Validate test flow (runs in test mode or after fallback). * - * This provides a smoke test for the migration logic on every PR, - * ensuring no regressions in the migration code even when no SO - * type definitions have changed. + * Sets up a test type registry and test snapshots, then runs + * the same validation pipeline with test data. * ================================================================== */ { - title: 'Fallback to test mode (no updated types detected)', - task: fallbackToTestMode, - enabled: !server && !test, - skip: (ctx) => ctx.updatedTypes.length > 0 || globalTask.errors.length > 0, + title: 'Validate test flow', + task: validateTestFlow, + enabled: !server, + skip: (ctx) => !ctx.test, }, { title: 'Automated rollback tests', diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts index dbf1861cf1926..b942e193d090e 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/automated_rollback_tests.ts @@ -17,9 +17,6 @@ import { fileToJson, getFileFromKibanaRepo } from '../../util'; import { BASELINE_MAPPINGS_TEST } from '../test'; export const automatedRollbackTests: Task = (ctx, task) => { - // Use test baseline mappings in test mode OR fallback mode - const useTestBaseline = ctx.test || ctx.fallbackToTestMode === true; - const subtasks: ListrTask[] = [ { title: 'Fetch baseline mappings', @@ -29,7 +26,7 @@ export const automatedRollbackTests: Task = (ctx, task) => { ref: ctx.gitRev, })), retry: { tries: 5, delay: 2_000 }, - enabled: () => !useTestBaseline, + enabled: () => !ctx.test, }, { title: 'Fetch baseline mappings (test mode)', @@ -37,7 +34,7 @@ export const automatedRollbackTests: Task = (ctx, task) => { (ctx.baselineMappings = (await fileToJson( BASELINE_MAPPINGS_TEST )) as SavedObjectsTypeMappingDefinitions), - enabled: () => useTestBaseline, + enabled: () => ctx.test, }, { title: 'Create baseline', diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts deleted file mode 100644 index 7e5dcfe48dfd1..0000000000000 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/fallback_to_test_mode.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { defaultKibanaIndex } from '@kbn/migrator-test-kit'; -import type { Task } from '../types'; -import { TEST_TYPES } from '../test'; -import { takeSnapshot } from '../../snapshots'; -import { getLatestTypeFixtures } from '../../migrations/fixtures'; -import { getVersions } from '../../migrations/versions'; - -/** - * Fallback to test mode when no real SO types have been updated. - * - * This provides a smoke test for the migration logic on every PR, - * ensuring no regressions in the migration code even when no SO - * type definitions have changed. - */ -export const fallbackToTestMode: Task = async (ctx, task) => { - ctx.updatedTypes = TEST_TYPES.map((type) => ({ - ...type, - indexPattern: defaultKibanaIndex, - })); - ctx.fallbackToTestMode = true; - ctx.to = await takeSnapshot(ctx.updatedTypes); - - // Load fixtures for each test type - for (const type of ctx.updatedTypes) { - const { name } = type; - const typeSnapshot = ctx.to.typeDefinitions[name]; - const [current, previous] = getVersions(typeSnapshot); - - const typeFixtures = await getLatestTypeFixtures({ - type, - current, - previous, - fix: ctx.fix, - }); - - ctx.fixtures.previous[name] = typeFixtures.previous; - ctx.fixtures.current[name] = typeFixtures.current; - } - - task.title = `Fallback to test mode: using ${ctx.updatedTypes.length} test types for rollback tests`; -}; diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts index 05b463cd6424b..2409b9d2662df 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/index.ts @@ -8,8 +8,6 @@ */ export { getSnapshots } from './get_snapshots'; -export { validateNewTypes } from './validate_new_types'; -export { validateUpdatedTypes } from './validate_updated_types'; export { automatedRollbackTests } from './automated_rollback_tests'; -export { checkRemovedTypes } from './check_removed_types'; -export { fallbackToTestMode } from './fallback_to_test_mode'; +export { validateSOChanges } from './validate_so_changes'; +export { validateTestFlow } from './validate_test_flow'; diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts new file mode 100644 index 0000000000000..17a18786c2da5 --- /dev/null +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { ListrTask } from 'listr2'; +import type { Task, TaskContext } from '../types'; +import { checkRemovedTypes } from './check_removed_types'; +import { validateNewTypes } from './validate_new_types'; +import { validateUpdatedTypes } from './validate_updated_types'; + +export const validateSOChanges: Task = (ctx, task) => { + const subtasks: ListrTask[] = [ + { + title: 'Check removed SO types', + task: checkRemovedTypes, + }, + { + title: 'Validate new SO types', + task: validateNewTypes, + }, + { + title: 'Validate existing SO types', + task: validateUpdatedTypes, + }, + { + title: 'Fallback to test mode (no updated types detected)', + task: () => { + ctx.test = true; + }, + skip: () => ctx.updatedTypes.length > 0, + }, + ]; + + return task.newListr(subtasks); +}; diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_test_flow.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_test_flow.ts new file mode 100644 index 0000000000000..d336605a6c896 --- /dev/null +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_test_flow.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { ListrTask } from 'listr2'; +import type { Task, TaskContext } from '../types'; +import { TEST_TYPES, getTestSnapshots } from '../test'; +import { validateSOChanges } from './validate_so_changes'; + +export const validateTestFlow: Task = (ctx, task) => { + const subtasks: ListrTask[] = [ + { + title: 'Obtain type registry (test mode)', + task: async () => { + ctx.registeredTypes = TEST_TYPES; + }, + }, + { + title: 'Get type registry snapshots (test mode)', + task: getTestSnapshots, + }, + { + title: 'Validate SO changes', + task: validateSOChanges, + }, + ]; + + return task.newListr(subtasks); +}; diff --git a/packages/kbn-check-saved-objects-cli/src/commands/types.ts b/packages/kbn-check-saved-objects-cli/src/commands/types.ts index 4e1924bb2d377..e2d1937ca03ff 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/types.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/types.ts @@ -36,5 +36,4 @@ export interface TaskContext { }; test: boolean; // whether the script is running with TEST data fix: boolean; - fallbackToTestMode?: boolean; // whether we're using test data as fallback (no real SO types updated) } From 2b61ca3319f16e20dfb470f6711e219d9f19a905 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 6 Feb 2026 20:37:52 +0000 Subject: [PATCH 6/7] Changes from node scripts/eslint_all_files --no-cache --fix --- .../src/commands/run_check_saved_objects_cli.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts index 3b1062daf8565..c54f3ae529a1b 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts @@ -11,12 +11,7 @@ import { Listr, PRESET_TIMER } from 'listr2'; import { run } from '@kbn/dev-cli-runner'; import { setupKibana, startElasticsearch, stopElasticsearch, stopKibana } from '../util'; import type { TaskContext } from './types'; -import { - automatedRollbackTests, - getSnapshots, - validateSOChanges, - validateTestFlow, -} from './tasks'; +import { automatedRollbackTests, getSnapshots, validateSOChanges, validateTestFlow } from './tasks'; export function runCheckSavedObjectsCli() { let globalTask: Listr; From 6ec39d3d8c8657296da60ccccf7c40a5ccd43157 Mon Sep 17 00:00:00 2001 From: hammad-nasir-elastic Date: Mon, 9 Feb 2026 13:12:01 -0500 Subject: [PATCH 7/7] slight updates --- .buildkite/scripts/pipelines/pull_request/pipeline.ts | 3 ++- .../src/commands/run_check_saved_objects_cli.ts | 8 ++++++++ .../src/commands/tasks/validate_so_changes.ts | 7 ------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 3bf9bdc630237..3669b966f634f 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -516,7 +516,8 @@ const SKIPPABLE_PR_MATCHERS = prConfig.skip_ci_on_only_changed!.map((r) => new R pipeline.push(getPipeline('.buildkite/pipelines/pull_request/prompt_changes.yml')); } - // Always run Saved Objects checks as a smoke test for migration logic + // Always run Saved Objects checks. + // If there aren't any SO types modified, the check will run with test data as a smoke test for migration logic pipeline.push(getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml')); if ( diff --git a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts index c54f3ae529a1b..926292133f32d 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/run_check_saved_objects_cli.ts @@ -94,6 +94,14 @@ export function runCheckSavedObjectsCli() { enabled: !server && !test, skip: test, }, + { + title: 'Fallback to test mode (no updated types detected)', + task: (ctx) => { + ctx.test = true; + }, + enabled: !server && !test, + skip: (ctx) => ctx.updatedTypes.length > 0, + }, /** * ================================================================== * Validate test flow (runs in test mode or after fallback). diff --git a/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts index 17a18786c2da5..3fb0d19ef0b7c 100644 --- a/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts +++ b/packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts @@ -27,13 +27,6 @@ export const validateSOChanges: Task = (ctx, task) => { title: 'Validate existing SO types', task: validateUpdatedTypes, }, - { - title: 'Fallback to test mode (no updated types detected)', - task: () => { - ctx.test = true; - }, - skip: () => ctx.updatedTypes.length > 0, - }, ]; return task.newListr(subtasks);