Skip to content

Commit

Permalink
Merge branch 'main' into add-functional-tests-for-painless-lab-flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
fake-haris committed Sep 24, 2024
2 parents 3d05363 + 6d584d4 commit 88b08b8
Show file tree
Hide file tree
Showing 156 changed files with 3,979 additions and 2,246 deletions.
5 changes: 1 addition & 4 deletions docs/setup/upgrade/resolving-migration-failures.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ If you fail to remedy this, your upgrade to 8.0+ will fail with a message like:

[source,sh]
--------------------------------------------
Unable to complete saved object migrations for the [.kibana] index: Migration failed because some documents were found which use unknown saved object types:
- "firstDocId" (type "someType")
- "secondtDocId" (type "someType")
- "thirdDocId" (type "someOtherType")
Unable to complete saved object migrations for the [.kibana] index: Migration failed because some documents were found which use unknown saved object types: someType,someOtherType
To proceed with the migration you can configure Kibana to discard unknown saved objects for this migration.
--------------------------------------------
Expand Down
40 changes: 20 additions & 20 deletions oas_docs/output/kibana.serverless.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8169,7 +8169,7 @@ paths:
- Security Solution Endpoint Management API
/api/entity_store/engines:
get:
operationId: ListEntityStoreEngines
operationId: ListEntityEngines
responses:
'200':
content:
Expand All @@ -8185,14 +8185,14 @@ paths:
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
type: array
description: Successful response
summary: List the Entity Store engines
summary: List the Entity Engines
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}:
delete:
operationId: DeleteEntityStore
operationId: DeleteEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8215,13 +8215,13 @@ paths:
deleted:
type: boolean
description: Successful response
summary: Delete the Entity Store engine
summary: Delete the Entity Engine
tags:
- Security Solution Entity Analytics API
get:
operationId: GetEntityStoreEngine
operationId: GetEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8236,14 +8236,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Get the Entity Store engine
summary: Get an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/init:
post:
operationId: InitEntityStore
operationId: InitEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -8271,14 +8271,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Initialize the Entity Store
summary: Initialize an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/start:
post:
operationId: StartEntityStore
operationId: StartEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8295,14 +8295,14 @@ paths:
started:
type: boolean
description: Successful response
summary: Start the Entity Store engine
summary: Start an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/stats:
post:
operationId: GetEntityStoreStats
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -8334,14 +8334,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EntityType
description: Successful response
summary: Get the Entity Store engine stats
summary: Get Entity Engine stats
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/stop:
post:
operationId: StopEntityStore
operationId: StopEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8358,7 +8358,7 @@ paths:
stopped:
type: boolean
description: Successful response
summary: Stop the Entity Store engine
summary: Stop an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/entities/list:
Expand Down
40 changes: 20 additions & 20 deletions oas_docs/output/kibana.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11616,7 +11616,7 @@ paths:
- Security Solution Endpoint Management API
/api/entity_store/engines:
get:
operationId: ListEntityStoreEngines
operationId: ListEntityEngines
responses:
'200':
content:
Expand All @@ -11632,14 +11632,14 @@ paths:
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
type: array
description: Successful response
summary: List the Entity Store engines
summary: List the Entity Engines
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}:
delete:
operationId: DeleteEntityStore
operationId: DeleteEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11662,13 +11662,13 @@ paths:
deleted:
type: boolean
description: Successful response
summary: Delete the Entity Store engine
summary: Delete the Entity Engine
tags:
- Security Solution Entity Analytics API
get:
operationId: GetEntityStoreEngine
operationId: GetEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11683,14 +11683,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Get the Entity Store engine
summary: Get an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/init:
post:
operationId: InitEntityStore
operationId: InitEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -11718,14 +11718,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Initialize the Entity Store
summary: Initialize an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/start:
post:
operationId: StartEntityStore
operationId: StartEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11742,14 +11742,14 @@ paths:
started:
type: boolean
description: Successful response
summary: Start the Entity Store engine
summary: Start an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/stats:
post:
operationId: GetEntityStoreStats
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -11781,14 +11781,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EntityType
description: Successful response
summary: Get the Entity Store engine stats
summary: Get Entity Engine stats
tags:
- Security Solution Entity Analytics API
/api/entity_store/engines/{entityType}/stop:
post:
operationId: StopEntityStore
operationId: StopEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11805,7 +11805,7 @@ paths:
stopped:
type: boolean
description: Successful response
summary: Stop the Entity Store engine
summary: Stop an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/entities/list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ describe('extractUnknownDocFailureReason', () => {
},
])
).toMatchInlineSnapshot(`
"Migration failed because some documents were found which use unknown saved object types:
- \\"unknownType:12\\" (type: \\"unknownType\\")
- \\"anotherUnknownType:42\\" (type: \\"anotherUnknownType\\")
"Migration failed because some documents were found which use unknown saved object types: unknownType,anotherUnknownType
To proceed with the migration you can configure Kibana to discard unknown saved objects for this migration.
Please refer to some-url.co for more information."
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ export function extractUnknownDocFailureReason(
resolveMigrationFailuresUrl: string,
unknownDocs: DocumentIdAndType[]
): string {
const typesSet = new Set(unknownDocs.map(({ type }) => type));
return (
`Migration failed because some documents were found which use unknown saved object types:\n` +
unknownDocs.map((doc) => `- "${doc.id}" (type: "${doc.type}")\n`).join('') +
`\nTo proceed with the migration you can configure Kibana to discard unknown saved objects for this migration.\n` +
`Migration failed because some documents were found which use unknown saved object types: ${Array.from(
typesSet.values()
)}\n` +
`To proceed with the migration you can configure Kibana to discard unknown saved objects for this migration.\n` +
`Please refer to ${resolveMigrationFailuresUrl} for more information.`
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,21 @@ export const model = (currentState: State, resW: ResponseType<AllActionStates>):
deleteByQueryTaskId: res.right.taskId,
};
} else {
const reason = extractUnknownDocFailureReason(
stateP.migrationDocLinks.resolveMigrationFailures,
res.left.unknownDocs
);
return {
...stateP,
controlState: 'FATAL',
reason: extractUnknownDocFailureReason(
stateP.migrationDocLinks.resolveMigrationFailures,
res.left.unknownDocs
),
reason,
logs: [
...logs,
{
level: 'error',
message: reason,
},
],
};
}
} else if (stateP.controlState === 'CLEANUP_UNKNOWN_AND_EXCLUDED_WAIT_FOR_TASK') {
Expand Down Expand Up @@ -700,13 +708,22 @@ export const model = (currentState: State, resW: ResponseType<AllActionStates>):

if (isTypeof(res.right, 'unknown_docs_found')) {
if (!stateP.discardUnknownObjects) {
const reason = extractUnknownDocFailureReason(
stateP.migrationDocLinks.resolveMigrationFailures,
res.right.unknownDocs
);

return {
...stateP,
controlState: 'FATAL',
reason: extractUnknownDocFailureReason(
stateP.migrationDocLinks.resolveMigrationFailures,
res.right.unknownDocs
),
reason,
logs: [
...logs,
{
level: 'error',
message: reason,
},
],
};
}

Expand Down Expand Up @@ -879,6 +896,13 @@ export const model = (currentState: State, resW: ResponseType<AllActionStates>):
corruptDocumentIds: [],
transformErrors: [],
progress: createInitialProgress(),
logs: [
...logs,
{
level: 'info',
message: `REINDEX_SOURCE_TO_TEMP_OPEN_PIT PitId:${res.right.pitId}`,
},
],
};
} else {
throwBadResponse(stateP, res);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 88b08b8

Please sign in to comment.