Skip to content

Commit

Permalink
Merge branch '8.11' into backport/8.11/pr-169708
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Nov 6, 2023
2 parents 7f09902 + 8e8c143 commit d12b793
Show file tree
Hide file tree
Showing 31 changed files with 351 additions and 14 deletions.
19 changes: 19 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ Review important information about the {kib} 8.x releases.
For information about the {kib} 8.11.0 release, review the following information.


[float]
[[known-issues-8.11.0]]
=== Known issues

// tag::known-issue-169170[]
[discrete]
.Gatekeeper error on macOS
[%collapsible]
====
*Details* +
Due to a version upgrade of the server binary used by {kib} and an upstream notarization issue, a Gatekeeper error may display for "node"
when starting {kib} in macOS environments.
*Workaround* +
More information can be found at <<install-darwin64>>.
====
// end::known-issue-169170[]

[float]
[[breaking-changes-8.11.0]]
=== Breaking changes
Expand Down
Binary file added docs/user/images/alerting-rule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/annotation-editing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/ccs-query-inspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/color-mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/custom-field.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/data-drift.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/edit-links-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/edit-links.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/elser-model-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/endpoints-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/endpoints.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/enrich-index-management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/enrich-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/esql-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/esql-enrich.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/esql-rule-type.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/grok-use-case.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/grok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/lens-inline-editing.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/links-panel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/obv-use-case.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/obvs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/start-esql-in-discover.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/term-aggs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/text-field-support.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
240 changes: 235 additions & 5 deletions docs/user/whats-new.asciidoc

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions x-pack/plugins/elastic_assistant/server/lib/executor.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { executeAction } from './executor';
import { KibanaRequest } from '@kbn/core-http-server';
import { RequestBody } from './langchain/types';
import { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server';
const request = {
body: {
params: {},
},
} as KibanaRequest<unknown, unknown, RequestBody>;

describe('executeAction', () => {
beforeEach(() => {
jest.clearAllMocks();
});
it('should execute an action with the provided connectorId and request body params', async () => {
const actions = {
getActionsClientWithRequest: jest.fn().mockResolvedValue({
execute: jest.fn().mockResolvedValue({
status: 'ok',
data: {
message: 'Test message',
},
}),
}),
} as unknown as ActionsPluginStart;

const connectorId = '12345';

const response = await executeAction({ actions, request, connectorId });

expect(actions.getActionsClientWithRequest).toHaveBeenCalledWith(request);
expect(actions.getActionsClientWithRequest).toHaveBeenCalledTimes(1);
expect(response.connector_id).toBe(connectorId);
expect(response.data).toBe('Test message');
expect(response.status).toBe('ok');
});

it('should throw an error if action result status is "error"', async () => {
const actions = {
getActionsClientWithRequest: jest.fn().mockResolvedValue({
execute: jest.fn().mockResolvedValue({
status: 'error',
message: 'Error message',
serviceMessage: 'Service error message',
}),
}),
} as unknown as ActionsPluginStart;
const connectorId = '12345';

await expect(executeAction({ actions, request, connectorId })).rejects.toThrowError(
'Action result status is error: Error message - Service error message'
);
});

it('should throw an error if content of response data is not a string', async () => {
const actions = {
getActionsClientWithRequest: jest.fn().mockResolvedValue({
execute: jest.fn().mockResolvedValue({
status: 'ok',
data: {
message: 12345,
},
}),
}),
} as unknown as ActionsPluginStart;
const connectorId = '12345';

await expect(executeAction({ actions, request, connectorId })).rejects.toThrowError(
'Action result status is error: content should be a string, but it had an unexpected type: number'
);
});
});
22 changes: 15 additions & 7 deletions x-pack/plugins/elastic_assistant/server/lib/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ export const executeAction = async ({
actionId: connectorId,
params: request.body.params,
});

if (actionResult.status === 'error') {
throw new Error(
`Action result status is error: ${actionResult?.message} - ${actionResult?.serviceMessage}`
);
}
const content = get('data.message', actionResult);
if (typeof content === 'string') {
return {
connector_id: connectorId,
data: content, // the response from the actions framework
status: 'ok',
};
if (typeof content !== 'string') {
throw new Error(
`Action result status is error: content should be a string, but it had an unexpected type: ${typeof content}`
);
}
throw new Error('Unexpected action result');
return {
connector_id: connectorId,
data: content, // the response from the actions framework
status: 'ok',
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class ActionsClientLlm extends LLM {
`${LLM_TYPE}: action result status is error: ${actionResult?.message} - ${actionResult?.serviceMessage}`
);
}
// TODO: handle errors from the connector

const content = get('data.message', actionResult);

if (typeof content !== 'string') {
Expand Down
3 changes: 2 additions & 1 deletion x-pack/test/fleet_api_integration/apis/agents/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const es = getService('es');
let elasticAgentpkgVersion: string;
describe('fleet_list_agent', () => {
// Failing: See https://github.com/elastic/kibana/issues/170690
describe.skip('fleet_list_agent', () => {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/fleet/agents');
const getPkRes = await supertest
Expand Down

0 comments on commit d12b793

Please sign in to comment.