Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
CAWilson94 authored Nov 5, 2024
2 parents e53c31f + 4869b8f commit 84723a3
Show file tree
Hide file tree
Showing 213 changed files with 4,785 additions and 2,941 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ src/plugins/saved_objects_finder @elastic/kibana-data-discovery
test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type @elastic/kibana-core
test/plugin_functional/plugins/saved_objects_hidden_type @elastic/kibana-core
src/plugins/saved_objects_management @elastic/kibana-core
src/plugins/saved_objects @elastic/kibana-core
src/plugins/saved_objects @elastic/appex-sharedux
packages/kbn-saved-objects-settings @elastic/appex-sharedux
src/plugins/saved_objects_tagging_oss @elastic/appex-sharedux
x-pack/plugins/saved_objects_tagging @elastic/appex-sharedux
Expand Down
357 changes: 356 additions & 1 deletion docs/CHANGELOG.asciidoc

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion docs/upgrade-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ In 8.1.0 and later, {kib} uses the field caps API, by default, to determine the
`visualization:visualize:legacyPieChartsLibrary` has been removed from *Advanced Settings*. The setting allowed you to create aggregation-based pie chart visualizations using the legacy charts library. For more information, refer to {kibana-pull}146990[#146990].
*Impact* +
In 7.14.0 and later, the new aggregation-based pie chart visualization is available by default. For more information, check link:https://www.elastic.co/guide/en/kibana/current/add-aggregation-based-visualization-panels.html[Aggregation-based].
In 7.14.0 and later, the new aggregation-based pie chart visualization is available by default. For more information, check <<add-aggregation-based-visualization-panels>>.
====

[discrete]
Expand Down Expand Up @@ -1694,6 +1694,30 @@ When you create *Lens* visualization, the default for the *Legend width* is now
[float]
==== Elastic Observability solution

[discrete]
[[deprecation-192003]]
* Deprecated the Observability AI Assistant specific advanced setting `observability:aiAssistantLogsIndexPattern`. (8.16)
[%collapsible]
====
*Details* +
The Observability AI Assistant specific advanced setting for Logs index patterns `observability:aiAssistantLogsIndexPattern` is deprecated and no longer used. The AI Assistant will now use the existing **Log sources** setting `observability:logSources` instead. For more information, refer to ({kibana-pull}192003[#192003]).
//*Impact* +
//!!TODO!!
====

[discrete]
[[deprecation-194519]]
* The Logs Stream was hidden by default in favor of the Logs Explorer app. (8.16)
[%collapsible]
====
*Details* +
You can find the Logs Explorer app in the navigation menu under Logs > Explorer, or as a separate tab in Discover. For more information, refer to ({kibana-pull}194519[#194519]).
*Impact* +
You can still show the Logs Stream app again by navigating to Stack Management > Advanced Settings and by enabling the `observability:enableLogsStream` setting.
====


[discrete]
[[deprecation-120689]]
Expand Down
Binary file added docs/user/images/dashboard-star.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/dashboard-usage.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/discover-log-level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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-suggestions.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/ip-location-processor.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/metric-customization.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/monaco-console.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/solution-view-obs.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/space-settings.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/table-coloring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 66 additions & 97 deletions docs/user/whats-new.asciidoc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
*/

import type { TypedUseSelectorHook } from 'react-redux';
import { useDispatch, useSelector, useStore } from 'react-redux';
import type { AppDispatch, AppStore, RootState } from './store';
import { useDispatch, useSelector } from 'react-redux';
import type { AppDispatch, RootState } from './store';

// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
export const useAppStore: () => AppStore = useStore;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@
"del": "^6.1.0",
"diff": "^5.1.0",
"dotenv": "^16.4.5",
"elastic-apm-node": "^4.8.0",
"elastic-apm-node": "^4.8.1",
"email-addresses": "^5.0.0",
"eventsource-parser": "^1.1.1",
"execa": "^5.1.1",
Expand Down Expand Up @@ -1497,7 +1497,7 @@
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@redocly/cli": "^1.25.7",
"@redocly/cli": "^1.25.8",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
"@storybook/addon-actions": "^6.5.16",
Expand Down Expand Up @@ -1718,7 +1718,7 @@
"exit-hook": "^2.2.0",
"expect": "^29.7.0",
"expose-loader": "^0.7.5",
"express": "^4.21.0",
"express": "^4.21.1",
"faker": "^5.1.0",
"fetch-mock": "^7.3.9",
"file-loader": "^4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ export class CommonHelper {
if (!id) {
return SavedObjectsUtils.generateId();
}
// only allow a specified ID if we're overwriting an existing ESO with a Version
// this helps us ensure that the document really was previously created using ESO
// and not being used to get around the specified ID limitation
const canSpecifyID = (overwrite && version) || SavedObjectsUtils.isRandomId(id);

const shouldEnforceRandomId = this.encryptionExtension?.shouldEnforceRandomId(type);

// Allow specified ID if:
// 1. we're overwriting an existing ESO with a Version (this helps us ensure that the document really was previously created using ESO)
// 2. enforceRandomId is explicitly set to false
const canSpecifyID =
!shouldEnforceRandomId || (overwrite && version) || SavedObjectsUtils.isRandomId(id);
if (!canSpecifyID) {
throw SavedObjectsErrorHelpers.createBadRequestError(
'Predefined IDs are not allowed for saved objects with encrypted attributes unless the ID is a UUID.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ describe('SavedObjectsRepository Encryption Extension', () => {

it(`fails if non-UUID ID is specified for encrypted type`, async () => {
mockEncryptionExt.isEncryptableType.mockReturnValue(true);
mockEncryptionExt.shouldEnforceRandomId.mockReturnValue(true);
mockEncryptionExt.decryptOrStripResponseAttributes.mockResolvedValue({
...encryptedSO,
...decryptedStrippedAttributes,
Expand Down Expand Up @@ -291,6 +292,25 @@ describe('SavedObjectsRepository Encryption Extension', () => {
).resolves.not.toThrowError();
});

it('allows to opt-out of random ID enforcement', async () => {
mockEncryptionExt.isEncryptableType.mockReturnValue(true);
mockEncryptionExt.shouldEnforceRandomId.mockReturnValue(false);
mockEncryptionExt.decryptOrStripResponseAttributes.mockResolvedValue({
...encryptedSO,
...decryptedStrippedAttributes,
});

const result = await repository.create(encryptedSO.type, encryptedSO.attributes, {
id: encryptedSO.id,
version: mockVersion,
});

expect(client.create).toHaveBeenCalled();
expect(mockEncryptionExt.isEncryptableType).toHaveBeenCalledWith(encryptedSO.type);
expect(mockEncryptionExt.shouldEnforceRandomId).toHaveBeenCalledWith(encryptedSO.type);
expect(result.id).toBe(encryptedSO.id);
});

describe('namespace', () => {
const doTest = async (optNamespace: string, expectNamespaceInDescriptor: boolean) => {
const options = { overwrite: true, namespace: optNamespace };
Expand Down Expand Up @@ -483,6 +503,7 @@ describe('SavedObjectsRepository Encryption Extension', () => {

it(`fails if non-UUID ID is specified for encrypted type`, async () => {
mockEncryptionExt.isEncryptableType.mockReturnValue(true);
mockEncryptionExt.shouldEnforceRandomId.mockReturnValue(true);
const result = await bulkCreateSuccess(client, repository, [
encryptedSO, // Predefined IDs are not allowed for saved objects with encrypted attributes unless the ID is a UUID
]);
Expand Down Expand Up @@ -529,6 +550,25 @@ describe('SavedObjectsRepository Encryption Extension', () => {
expect(result.saved_objects.length).toBe(1);
expect(result.saved_objects[0].error).toBeUndefined();
});

it('allows to opt-out of random ID enforcement', async () => {
mockEncryptionExt.isEncryptableType.mockReturnValue(true);
mockEncryptionExt.shouldEnforceRandomId.mockReturnValue(false);
mockEncryptionExt.decryptOrStripResponseAttributes.mockResolvedValue({
...encryptedSO,
...decryptedStrippedAttributes,
});

const result = await bulkCreateSuccess(client, repository, [
{ ...encryptedSO, version: mockVersion },
]);

expect(client.bulk).toHaveBeenCalled();
expect(result.saved_objects).not.toBeUndefined();
expect(result.saved_objects.length).toBe(1);
expect(result.saved_objects[0].error).toBeUndefined();
expect(result.saved_objects[0].id).toBe(encryptedSO.id);
});
});

describe('#bulkUpdate', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const createEncryptionExtension = (): jest.Mocked<ISavedObjectsEncryptionExtensi
isEncryptableType: jest.fn(),
decryptOrStripResponseAttributes: jest.fn(),
encryptAttributes: jest.fn(),
shouldEnforceRandomId: jest.fn(),
});

const createSecurityExtension = (): jest.Mocked<ISavedObjectsSecurityExtension> => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const createEncryptionExtension = (): jest.Mocked<ISavedObjectsEncryptionExtensi
isEncryptableType: jest.fn(),
decryptOrStripResponseAttributes: jest.fn(),
encryptAttributes: jest.fn(),
shouldEnforceRandomId: jest.fn(),
});

const createSecurityExtension = (): jest.Mocked<ISavedObjectsSecurityExtension> => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ export interface ISavedObjectsEncryptionExtension {
*/
isEncryptableType: (type: string) => boolean;

/**
* Returns false if ESO type explicitly opts out of highly random UID
*
* @param type the string name of the object type
* @returns boolean, true by default unless explicitly set to false
*/
shouldEnforceRandomId: (type: string) => boolean;

/**
* Given a saved object, will return a decrypted saved object or will strip
* attributes from the returned object if decryption fails.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ export const LanguageClientPanel: React.FC<SelectClientProps> = ({
width={euiTheme.size.xl}
/>
<EuiSpacer size="s" />
<EuiText textAlign="center" color={isSelectedLanguage ? 'default' : 'subdued'}>
<h5>{language.name}</h5>
<EuiText
size="relative"
textAlign="center"
color={isSelectedLanguage ? 'default' : 'subdued'}
>
<strong>{language.name}</strong>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('incompatible_cluster_routing_allocation', () => {
await root.preboot();
await root.setup();

root.start().catch(() => {
const startPromise = root.start().catch(() => {
// Silent catch because the test might be done and call shutdown before starting is completed, causing unwanted thrown errors.
});

Expand Down Expand Up @@ -165,6 +165,7 @@ describe('incompatible_cluster_routing_allocation', () => {
{ retryAttempts: 100, retryDelayMs: 500 }
);

await startPromise; // Wait for start phase to complete before shutting down
await root.shutdown();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export function useObservabilityAIAssistantContext({
},
metric: {
type: 'object',
properties: {},
},
gauge: {
type: 'object',
properties: {},
},
pie: {
type: 'object',
Expand Down Expand Up @@ -158,6 +160,7 @@ export function useObservabilityAIAssistantContext({
},
table: {
type: 'object',
properties: {},
},
tagcloud: {
type: 'object',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/server/search/session/session_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ export class SearchSessionService implements ISearchSessionService {
const session = await this.get(deps, user, sessionId);
const requestHash = createRequestHash(searchRequest.params);
if (!Object.hasOwn(session.attributes.idMapping, requestHash)) {
this.logger.error(`SearchSessionService: getId | ${sessionId} | ${requestHash} not found`);
this.logger.debug(
this.logger.debug(`SearchSessionService: getId | ${sessionId} | ${requestHash} not found`);
this.logger.error(
`SearchSessionService: getId not found search with params: ${JSON.stringify(
searchRequest.params
)}`
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/saved_objects/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "plugin",
"id": "@kbn/saved-objects-plugin",
"owner": [
"@elastic/kibana-core"
"@elastic/appex-sharedux"
],
"group": "platform",
"visibility": "shared",
Expand All @@ -15,4 +15,4 @@
"dataViews"
]
}
}
}
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"paths": {
"xpack.actions": "plugins/actions",
"xpack.aiops": [
"packages/ml/aiops_common",
"packages/ml/aiops_components",
"packages/ml/aiops_log_pattern_analysis",
"packages/ml/aiops_log_rate_analysis",
Expand Down
8 changes: 7 additions & 1 deletion x-pack/packages/ai-infra/inference-common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ export {
type ToolChoice,
type ChatCompleteAPI,
type ChatCompleteOptions,
type ChatCompletionResponse,
type ChatCompleteCompositeResponse,
type ChatCompletionTokenCountEvent,
type ChatCompletionEvent,
type ChatCompletionChunkEvent,
type ChatCompletionChunkToolCall,
type ChatCompletionMessageEvent,
type ChatCompleteStreamResponse,
type ChatCompleteResponse,
type ChatCompletionTokenCount,
withoutTokenCountEvents,
withoutChunkEvents,
isChatCompletionMessageEvent,
Expand All @@ -48,7 +51,10 @@ export {
export {
OutputEventType,
type OutputAPI,
type OutputOptions,
type OutputResponse,
type OutputCompositeResponse,
type OutputStreamResponse,
type OutputCompleteEvent,
type OutputUpdateEvent,
type Output,
Expand Down
Loading

0 comments on commit 84723a3

Please sign in to comment.